G-01The Test / Diagnose Loop

/coding-agents/test-loop

Understand, explore, plan, edit — then let the test suite verify, and diagnose real failures instead of guessing.

Step-by-step walkthrough8 steps
  1. Before touching anything: read the code that’s actually there.
  2. Plan the smallest change that could work.
  3. Edit.
  4. The test suite is the verifier — objective and free.
  5. Fail. The traceback names the exact line.
  6. Diagnose against the real error, not a guess.
  7. Edit again — narrowly.
  8. Green. Commit. The loop, not the model, produced the reliability.
Key insight

The traceback is the highest-signal context a coding agent ever receives. Architectures that route it back into the edit step outperform ones that just retry.

Failure mode

Skipping exploration: an agent that edits before reading the codebase produces plausible patches against an imagined repo.

Elsewhere in the atlas