Make a coding agent prove its fix: self-correcting loop with evidence
Harshit_Ahluwalia · reddit · 2026-12-01
Using a real concurrency bug (the same purchase order approved twice in a Next.js/TypeScript/PostgreSQL app), the author lays out a framework for making a coding agent demonstrate its fix works:
- Agent-friendly architecture: enforce data-access and transaction rules via build checks, not prompt prose.
- Reproduce first: the agent's first job is a failing test firing concurrent requests at the same order.
- Fix at the right layer: idempotency key with unique constraint, row locking (SELECT … FOR UPDATE), or optimistic concurrency with a version column — the agent must justify its choice.
- Self-correcting loop: reproduce → investigate → fix → re-test until the concurrency test and the full suite pass.
- Capture evidence: concurrent test output, migration, root-cause writeup — reviewers get proof, not a summary.
- CI gates + human approval: the agent never merges its own work.
The point isn't more generated code; it's an environment where the agent can prove its changes are reliable.
More from coding & agent
- Spawn 7: WebGPU browser engine makes 7,231 objects/ms, 122x faster than Spawn 6 — majidmanzarpour · 2026-12-01
- Dev claims open-source AI pentesting agent took down 3 staging environments — MicahBerkley · 2026-12-01
- Running your own gateway before Claude Code? 19 releases in 30 days to chase — Serious_Algae_2191 · 2026-12-01
- Claude eng lead Felix Rieseberg shares a 4-step prompt for deeper AI output — CatAstro_Piyush · 2026-12-01
- Managing AI agents with 'High Output Management' sparks AI-circle mockery — Kyrannio · 2026-12-01
- What Blobasaur teaches about engineering judgment in the AI-assisted development era — _jaydeepkarale · 2026-12-01