Keeps this page in sync as the body changes. Pause it any time for a quieter view.
Path /specs/failed-task-diagnostics-contract
Last refresh never
Failed-Task Diagnostics Completeness Contract
inventory_source local | spec_api /api/spec-registry/failed-task-diagnostics-contract | registry_updated 2026-04-09T03:10:08.889551Z
potential_value 0.00 | actual_value 1.00 | value_gap 0.00
estimated_cost 0.00 | actual_cost 1.00 | cost_gap 1.00
estimated_roi 0.00 | actual_roi 1.00
Missing contributor linkage. Submit a change request with contributor attribution.
Open process view for this spec
task_ids -
branches -
source_files specs/auto-heal-from-diagnostics.md, specs/data-driven-timeout-resume.md, specs/failed-task-diagnostics-contract.md, specs/heal-completion-issue-resolution.md, specs/incident-response-and-self-healing.md, specs/smart-reap.md, specs/stale-task-reaper.md, specs/task-deduplication.md
evidence_refs -
Open implementation view for this spec
implementation_refs spec-registry:auto-heal-from-diagnostics, spec-registry:data-driven-timeout-resume, spec-registry:failed-task-diagnostics-contract, spec-registry:heal-completion-issue-resolution, spec-registry:incident-response-and-self-healing, spec-registry:smart-reap, spec-registry:stale-task-reaper, spec-registry:task-deduplication
lineage_ids -
public_endpoints -
summary **Idea**: `agent-failed-task-diagnostics` (sub-idea of `coherence-network-agent-pipeline`)
process_summary Error fields on model: Add `error_summary: Optional[str]` and `error_category: Optional[str]` to `AgentTask`, `AgentTaskListItem`, `AgentTaskUp; Require diagnostics on failure: When a task transitions to `status=failed` via PATCH, require at least one of `error_summary` or `output` to be non-empt; Diagnostics service: `classify_error(output: str | None) -> tuple[str, str]` returns `(error_summary, error_category)` by pattern-matching th; Auto-classify on PATCH: When PATCH sets `status=failed` and `error_summary` is not provided, call `classify_error(output)` to auto-populate both; Diagnostics completeness endpoint: `GET /api/agent/diagnostics-completeness` returns `{"total_failed": N, "with_diagnostics": M, "missing_pct": float, "by_
pseudocode_summary -
implementation_summary api/app/services/failed_task_diagnostics_service.py (classify_error(), ensure_diagnostics()); api/app/models/agent.py (error_summary, error_category fields); api/app/services/agent_task_store_service.py (AgentTaskRecord.error_summary column)