Get a model to reproduce a bug before it tries to fix it
Turn a vague bug report into a failing test, and refuse to let the model touch the source until that test exists.
by ALPHA WOLVES FC · published Sep 23, 2026
Models are eager to fix. Given a bug report they will edit the file that looks most related, and about a third of the time they fix something that was never broken while the real bug survives. This forces reproduction first: a failing test that isolates the behaviour, confirmed failing, before a single line of source changes. The fix then has a definition of done that is not someone's judgement.
Tools / stack
Inputs required
The bug report as written, the relevant module, and the ability to run the test suite
Steps
- 1.Restate the bug as an observable condition: what input produces what wrong output. If the report does not support that, ask before proceeding.
- 2.Write a test that asserts the correct behaviour and nothing else. No snapshots, no incidental assertions.
- 3.Run it and confirm it fails, for the reason you expect. A test that fails on a setup error proves nothing.
- 4.Only now read the source, and only the path the test exercises.
- 5.Make the smallest change that turns the test green, and run the full suite to check nothing else moved.
- 6.Report what the root cause was, and whether the original bug report described it accurately
Expected output
A failing test confirmed before any fix, the minimal change that greens it, a full suite run, and a root cause statement
Golden Example
Bug report reading "dates are wrong on the export sometimes", plus the export module
Test written asserting that a date on the last day of a month exports unchanged. Confirmed failing. Root cause was a timezone conversion applied twice, four files away from where the reporter assumed. Two line fix, suite green, report noted the original description pointed at the wrong module.