# Pattern: diag-trace

Mandatory output contract for every diagnosis run under this skill.

## A. Step card (after each evidence fetch)

Emit one card before deciding the next step. Fields:

| Field | Required content |
|-------|------------------|
| `step` | Ordinal |
| `intent` | Plane + GK (or evidence id) + conditions; include `provider=…` when known |
| `method` | Bound `method-*`, or `agent-read-code` / `user-paste` |
| `result` | Summary (item_count / phase / short excerpt). On fetch failure: class, retries, hard/soft, action |
| `focus` | Fields watched and their values |
| `judgment` | One of: `enough` / `continue` / `handoff` / `blocked-uncertain` / `healthy` / `user-assist` / `out-of-scope` + one-line reason |
| `next` | If `continue`: next intent (Plane+GK+conditions) |
| `condition_provenance` | If `continue`: where next condition values came from (e.g. `step1.cluster_cr.spec.networkName`) |

Rules:

- Keep `intent` at Procedure level. Do not dump toolkit request JSON into the card.
- `judgment=blocked-uncertain`: say what is missing; do not invent a root cause.
- Provider must be visible on provider-specific steps.
- Health checklist items each get a card; all green → `judgment=healthy`.
- Fetch failures must show: `retryable` | `non_retryable` | `not_found_signal`;
  retry count; `hard` | `soft`; action `retried` | `bypassed` | `blocked`.
- Code-reachable deeper analysis: `method=agent-read-code` with path/symbol in
  focus. True external CLI: `judgment=user-assist` + assist card fields.
- Preflight missing info: ask only; no toolkit. Out of scope: `out-of-scope`;
  do not name another diagnosis skill.

## B. Final summary

When the run ends, emit:

| Block | Content |
|-------|---------|
| `Information chain` | Ordered steps (preflight, provider, bypasses, code read, user-assist) |
| `Evidence index` | Focus excerpts + provenance edges; missing hard/soft; user paste; preflight summary |
| `Conclusion` | Kind: `root_cause` \| `no_current_anomaly` \| `uncertain` \| `out_of_scope`; confidence; `provider=…`. Partial root cause may set `deeper_cause=pending_user_assist`. `no_current_anomaly` must list checklist coverage and confidence boundary. Missing **hard** evidence → never `healthy` / strong `root_cause` |
| `Next actions` | Read-only follow-ups, refetch missing evidence, user-assist card, handoff other `diag-*`, or ops if mutation needed. On `out_of_scope`: do **not** point to a sibling diagnosis skill by name |

## Hard bans

- Never claim `healthy` / `no_current_anomaly` if any **hard** evidence fetch failed or was bypassed as missing.
- Never claim strong `root_cause` from missing hard evidence alone.
