Generated code changes the speed, not the ownership
AI can produce a convincing patch before an engineer has finished building a model of the code around it. That speed is useful, but it also compresses the moment when assumptions usually become visible.
Treat the proposal as a candidate change. The engineer still has to explain what behavior should change, what must remain invariant, and what evidence would make the change safe to ship.
Climb a verification ladder from intent to operation
- 01Intent→
- 02Diff→
- 03Narrow check→
- 04System behavior→
- 05Operational signal
- Intent: restate the required behavior and the invariants before reviewing the patch.
- Diff: inspect the actual changed paths, including error handling and state transitions.
- Narrow check: run the smallest deterministic test that can falsify the proposed behavior.
- System behavior: exercise the change across the boundary it affects, including a relevant failure case.
- Operational signal: confirm that logs, metrics, or traces distinguish success from a silent regression.
Give the agent a verification contract
A prompt such as “fix this test” optimizes for a green test. A better instruction names the observed failure, the protected behavior, the files or boundaries worth inspecting, and the evidence required before the work is complete.
- State what is known and what remains uncertain.
- Name constraints that must not be traded away.
- Ask for alternatives when the first proposal changes a public contract.
- Require the agent to show which checks it ran and which it could not run.
- Review the diff and evidence yourself before accepting the result.
This is not about writing a longer prompt. It is about making the assignment hard to satisfy through superficial code production.
Know when the evidence is not enough
| Question | False finish | Defensible finish |
|---|---|---|
| Tests | The existing suite is green | A check tied to the changed risk is green |
| Review | The patch looks conventional | The control flow and state effects are understood |
| Scope | Only a few lines changed | The affected boundary and callers were inspected |
| Operations | No error appeared locally | The expected signal appears under a relevant condition |
Stop and widen the investigation when the generated change alters data ownership, concurrency, authorization, billing, or an irreversible operation. Speed has less value when the cost of a wrong assumption is high.