Evidence-First Debugging
Goal
Find and fix the real cause of a failure with the smallest durable change and
evidence that explains the symptom, cause, fix, and verification.
Success Criteria
- The symptom and expected behavior are explicit.
- Reproduction evidence exists, or an exact blocker explains why it cannot.
- Competing hypotheses are tested and disconfirming evidence is retained.
- Root cause is supported by code, config, or runtime evidence.
- Verification covers the original failure path and a relevant regression check.
Constraints
- Use local, company-safe diagnostics by default; redact secrets and private data.
- Ask before destructive, production-affecting, network, migration, or sensitive-data diagnostics.
- Do not patch from a guess or claim root cause when evidence supports only mitigation.
- Ask for missing context only when it materially blocks safe reproduction or isolation.
Progressive Contract Loading
Canonical tier files are contracts/input.yaml, contracts/output.yaml,
contracts/phase-gates.yaml, and contracts/handoffs.yaml.
Read contracts/index.yaml first. Canonical contracts remain authoritative, but
load only the boundary currently being enforced:
entry for symptom, scope, reproduction target, safety, and edit permission;
current_phase for SCOPE, REPRODUCE, HYPOTHESIZE, ISOLATE, FIX, or VERIFY;
selected_handoff only when investigation or fix delegation is selected; and
completion only for the artifact being returned.
If a selector is missing or invalid, load the full named canonical contract.
Do not load every contract at entry.
Ownership
assistant-debugging owns diagnosis until the failure mechanism is reproducible
or bounded strongly enough for a fix. Generic workflow may coordinate planning,
delegation, and review, but specialist gates are authoritative.
Method
- SCOPE — capture symptom, expected behavior, affected path, recent changes,
constraints, and severity.
- REPRODUCE — run the smallest safe failing test/command or record the exact
blocker with available log/code/config evidence.
- HYPOTHESIZE — keep at least three plausible causes unless evidence
justifies fewer. Rank by likelihood, diagnostic cost, and blast radius.
- ISOLATE — run the cheapest high-signal check first. Track supporting and
disconfirming evidence until one cause predicts the symptom and fix.
- FIX — add a regression test when feasible, then make the smallest change
that addresses the cause. Label uncertain emergency changes as mitigations.
- VERIFY — rerun the reproduction, focused test, relevant regressions, and
normal project checks. Skipped checks remain residual risk.
Use assistant-debugging before assistant-tdd when a meaningful RED test
cannot yet be written. Once the mechanism is understood, hand the regression
test and evidence into the TDD cycle. Use assistant-review after non-trivial or
risky fixes.
Output
Return status, symptom, reproduction or blocker, ranked hypotheses, root cause
and confidence, fix summary, verification results, and residual risks.
Stop Rules
- Stop before speculative edits when the failure is neither reproduced nor bounded.
- Stop and ask before unsafe diagnostics.
- If every hypothesis is refuted, gather new evidence instead of cycling guesses.
- Use
mitigated or inconclusive when proof is insufficient for root cause.
1---2name: assistant-debugging3description: Diagnose an unknown failure by reproducing and isolating before fixing. Use for debugging, root causes, flaky tests, or unexplained breakage.4---56# Evidence-First Debugging78## Goal910Find and fix the real cause of a failure with the smallest durable change and11evidence that explains the symptom, cause, fix, and verification.1213## Success Criteria1415- The symptom and expected behavior are explicit.16- Reproduction evidence exists, or an exact blocker explains why it cannot.17- Competing hypotheses are tested and disconfirming evidence is retained.18- Root cause is supported by code, config, or runtime evidence.19- Verification covers the original failure path and a relevant regression check.2021## Constraints2223- Use local, company-safe diagnostics by default; redact secrets and private data.24- Ask before destructive, production-affecting, network, migration, or sensitive-data diagnostics.25- Do not patch from a guess or claim root cause when evidence supports only mitigation.26- Ask for missing context only when it materially blocks safe reproduction or isolation.2728## Progressive Contract Loading2930Canonical tier files are `contracts/input.yaml`, `contracts/output.yaml`,31`contracts/phase-gates.yaml`, and `contracts/handoffs.yaml`.3233Read `contracts/index.yaml` first. Canonical contracts remain authoritative, but34load only the boundary currently being enforced:3536- `entry` for symptom, scope, reproduction target, safety, and edit permission;37- `current_phase` for SCOPE, REPRODUCE, HYPOTHESIZE, ISOLATE, FIX, or VERIFY;38- `selected_handoff` only when investigation or fix delegation is selected; and39- `completion` only for the artifact being returned.4041If a selector is missing or invalid, load the full named canonical contract.42Do not load every contract at entry.4344## Ownership4546assistant-debugging owns diagnosis until the failure mechanism is reproducible47or bounded strongly enough for a fix. Generic workflow may coordinate planning,48delegation, and review, but specialist gates are authoritative.4950## Method51521. **SCOPE** — capture symptom, expected behavior, affected path, recent changes,53 constraints, and severity.542. **REPRODUCE** — run the smallest safe failing test/command or record the exact55 blocker with available log/code/config evidence.563. **HYPOTHESIZE** — keep at least three plausible causes unless evidence57 justifies fewer. Rank by likelihood, diagnostic cost, and blast radius.584. **ISOLATE** — run the cheapest high-signal check first. Track supporting and59 disconfirming evidence until one cause predicts the symptom and fix.605. **FIX** — add a regression test when feasible, then make the smallest change61 that addresses the cause. Label uncertain emergency changes as mitigations.626. **VERIFY** — rerun the reproduction, focused test, relevant regressions, and63 normal project checks. Skipped checks remain residual risk.6465Use `assistant-debugging` before `assistant-tdd` when a meaningful RED test66cannot yet be written. Once the mechanism is understood, hand the regression67test and evidence into the TDD cycle. Use `assistant-review` after non-trivial or68risky fixes.6970## Output7172Return status, symptom, reproduction or blocker, ranked hypotheses, root cause73and confidence, fix summary, verification results, and residual risks.7475## Stop Rules7677- Stop before speculative edits when the failure is neither reproduced nor bounded.78- Stop and ask before unsafe diagnostics.79- If every hypothesis is refuted, gather new evidence instead of cycling guesses.80- Use `mitigated` or `inconclusive` when proof is insufficient for root cause.