diagnose
Diagnose
Read CONTEXT.md, the glossary, relevant ADRs, issue/spec context, and repository instructions. Reproduce the problem and capture exact inputs, environment, expected behavior, actual behavior, logs, and timing where relevant. Narrow the smallest failing boundary and form competing hypotheses.
Test hypotheses with the smallest useful experiments. Keep a short evidence log separating facts, hypotheses, eliminated causes, and the current root-cause claim. Do not make speculative production changes merely to explore a hypothesis. For performance issues, establish a baseline and identify the dominant operation before optimizing.
Once the cause is confirmed, add a regression test at the highest useful public seam, then implement the smallest fix and verify both the original failure and nearby behavior. Report reproduction, root cause, fix, checks run, and residual risks. If the cause cannot be confirmed, stop at a useful diagnosis and say what evidence is still missing.