Looping Is Not Reliability: State-Bound Evidence and Typed Revision Contracts for Agentic Code Repair
Abstract
Generate--test--revise loops are common in coding agents, but repetition alone provides no reliability guarantee. We study the gap between finding a correct patch and retaining, verifying, and submitting it. A sealed five-seed study over 30 HumanEval repairs produces 900 three-revision trajectories. Under forced revision, current correctness with current traces falls from 0.820 after one revision to 0.673 after two, although ever-correct rises to 0.847. Two common-state studies use 2,430 branches from identical frozen programs to remove post-treatment risk-set bias. In a prespecified 14B replication, stale traces harm 34/135 correct starts versus 4/135 with current traces, a 22.2-point increase (task-cluster 95\% CI , exact Holm ). A prospective 540-rollout policy eliminates observed correct-start harm but reduces wrong-start repair and fails its joint criterion. Repository experiments over 24 bugs and four coder stacks expose floor effects and component heterogeneity without Holm-significant effects. We therefore separate admission, preservation, grounded certification, competence, and liveness. We derive an evidence-bound typed loop contract and instantiate its mechanically enforceable subset in a reference implementation that binds verifier evidence to exact code states, preserves verified checkpoints, and emits auditable admission receipts. The implementation is an executable specification and conformance artifact, not evidence of improved repair competence or calibrated verifier dependence.
Create a lesson
Metadata
- Categories
- cs.CL, cs.AI
- Comments
- 11 pages, 5 figures, 8 tables. Accepted at AgenticDev 2026
Related papers
StateRAG: Typed State Contracts for Complex Retrieval-Augmented Generation
Shared title terminologycs.CLMiaohe Niu, Xinyu Liu, Runsong Zhao et al.
Collect for Coverage, Replay with Evidence: Adaptive and Efficient On-Policy Distillation for Long-Horizon Agents
Shared title terminologycs.CLHaowen Hou, Gen Li, Ruilin Li et al.
IRTIQA: Evolving in English, Evaluated in Urdu -- Does Agent Self-Evolution Transfer from English to Urdu and Code-Switched Input?
Shared title terminologycs.CLAbdullah Hashmat, Danish Javed, Usman Naseem et al.
SecondChance: Benchmarking Reliable Error Recovery in AI Agents
Shared title terminologycs.CLAtahan Dokme, Adar Avsian, Larry Heck
Same Evidence, Different Target: Decoding How Diagnostic Evidence Bears on Causal Questions from Language-Model States
Shared title terminologycs.CLWeiyi Kong, Zhuoran Li
(Im)Paired Programming: Coding Agents Improve Productivity but Harm Understanding
Shared title terminologycs.CLNishant Balepur, Connor Baumler, Valerie Chen et al.