循环不等于可靠性:面向智能体代码修复的状态绑定证据与类型化修订契约 Looping Is Not Reliability: State-Bound Evidence and Typed Revision Contracts for Agentic Code Repair 预印本

⚠️ 本文为 预印本(arXiv 公开版本),尚未经过正式同行评审。作者自发公开,结论未经期刊审稿验证,阅读时请知悉。
发布时间:2026-07-27
👁️ 预览文献
💡 AI 中文简介
编程智能体常用“生成—测试—修订”循环,但反复迭代并不保证可靠。研究发现在强制修订下,当前正确率会从一次修订后的0.820降到两次后的0.673,即使曾经正确率升到0.847。作者用冻结程序分支实验证明,陈旧证据会显著损害正确起点。为此提出一套“证据绑定+类型化修订契约”,把验证证据绑定到确切代码状态、保留已验证检查点并生成可审计的准入凭证,为智能体代码修复提供可执行的可靠性规范。
领域软件工程 / 人工智能 / 代码智能体与程序修复
适合谁读需要一定专业背景(软件工程、程序修复或LLM智能体方向的研究者与工程师)
核心贡献1) 提出轨迹级可靠性分解,联合报告正确性发现与保留、错误到正确/正确到错误转移、验证器风险-覆盖率、条件假接受依赖与可靠完成;2) 通过受控证据实验(强制修订与共同状态干预)量化状态对齐对修复与延续的危害;3) 推导可执行契约与参考实现,将状态绑定证据、类型化动作、检查点保留、新鲜完成认证与风险感知停止机制落地为现有智能体与验证器之上的准入层。
关键数据30个HumanEval修复、5个随机种子、900条三修订轨迹;强制修订下当前正确率从0.820(一次修订)降至0.673(两次修订),曾经正确率升至0.847;共同状态研究使用2430个分支;14B复现中陈旧证据损害34/135正确起点,而当前证据仅4/135,增加22.2个百分点(任务聚类95% CI [8.9, 37.0],精确Holm p=0.0337);前瞻性540次rollout策略消除正确起点损害但降低错误起点修复并未通过联合标准;仓库实验覆盖24个bug与4种编码器栈,未发现Holm显著效应。
推荐理由如果你关心编程智能体为什么越改越错,这篇论文用扎实实验揭示了“循环不等于可靠”,并给出了可落地的契约与参考实现,值得一读。
关键词["编程智能体", "智能体可靠性", "代码修复", "验证", "停止策略", "大语言模型评估"]

原文摘要

查看英文原文摘要

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.