Looping Is Not Reliability: State-Bound Evidence and Typed Revision Contracts for Agentic Code Repair

📅 2026-07-27
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the degradation of repair correctness in existing code repair agents, which often lose valid patches during repetitive generate–test–revise cycles. The study introduces a novel decomposition of the repair process into five orthogonal dimensions: admission, retention, certification, capability, and liveness. It proposes an executable specification mechanism grounded in state-bound evidence and typed revision contracts, along with an auditable reference implementation. Through branch-freezing for bias control, execution trajectory tracking, and formal verification, experiments reveal that stale execution trajectories significantly reduce repair success rates. The proposed approach effectively mitigates this degradation; however, it does not enhance overall repair capability, thereby highlighting the critical influence of system component heterogeneity and underlying bottlenecks.
📝 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 $[8.9,37.0]$, exact Holm $p=0.0337$). 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.
Problem

Research questions and friction points this paper is trying to address.

code repair
reliability
revision loops
correctness preservation
agent-based programming
Innovation

Methods, ideas, or system contributions that make the work stand out.

typed revision contracts
state-bound evidence
agentic code repair
verifier dependence
executable specification