| name | eou-diagnose |
| description | Diagnose EOU failures using the Foundry failure taxonomy and recommend the smallest repair path. |
Diagnose EOU Failure
Diagnose the failure described in $target and recommend the minimum repair path.
Required reading
foundry/failure-taxonomy.yml — F1–F12 class definitions and repair heuristics
foundry/constitution.yml — invariants that constrain repair options
schemas/incident.schema.yml — validate the input incident report against this schema if it is a structured YAML file
Stop conditions
Halt and request clarification if:
$target does not identify an EOU ID and one cannot be inferred from the content.
- The incident report contains no observable failure symptom — only a conclusion or label.
foundry/failure-taxonomy.yml does not exist — failure classification cannot proceed without it.
Procedure
- Read
$target (incident report or audit finding) and extract the observable failure symptom.
- For each symptom, classify it against the F1–F12 taxonomy. One symptom may match multiple classes — list all that apply, ranked by confidence.
- For each classified failure, identify the minimum repair action using this precedence (smallest blast radius first):
- schema field addition or constraint
- validator strengthening
- stop condition
- regression case
- context manifest repair
- ECP (structural EOU change)
- human approval gate
- EOU split / merge / retire
- Rule out prompt-only explanations: if the failure recurs despite correct inputs, classify as structural (F3–F12), not F1 (prompt ambiguity).
- Write the diagnosis report.
Output
Every diagnosis produces one of two outcomes:
- Change warranted — write the diagnosis report, then use
$ecp-propose to open an ECP.
- No change warranted — write a no-change record to
foundry/audits/incidents/{incident_id}.no-change.yml with fields: incident_id, eou_id, diagnosis_summary, decision: no_change, rationale, reviewed_by, reviewed_at, reopen_condition.
A no-change record is not a failure of the diagnosis process. It is evidence that the system reviewed and rejected a change rather than silently ignoring the incident.
Write the diagnosis report to foundry/audits/incidents/{incident_id}.diagnosis.yml with the following structure:
incident_id:
eou_id:
failure_classes:
symptoms:
repair_options:
- repair_type:
description:
blast_radius:
requires_ecp:
recommended:
rationale:
Constraints
- Do not treat every failure as a prompt problem (F1). Require observable evidence for F1 classification.
- Do not recommend retirement without evidence that the EOU's operational value is gone.
- Do not recommend ECP when a stop condition or validator would suffice.
- Do not invent an
incident_id — use the one from $target or generate from {eou_id}-{YYYYMMDD} if absent.
- Confidence ratings (
high/medium/low) for failure class matches must be grounded in observable signals, not subjective judgment.