用可执行规范修复程序漏洞,精准还原开发者意图。
Project Prometheus: Bridging the Intent Gap in Agentic Program Repair via Reverse-Engineered Executable Specifications

- 通过反向工程失败报告生成Gherkin格式的可执行规范
- 在Defects4J上实现93.97%修复率,74.4%复杂漏洞救援率
- 适合需要高精度、可验证修复方案的研发团队
从神经机器翻译转向智能体工作流,已彻底改变自动化程序修复(APR)。然而,现有智能体尽管具备先进推理能力,仍常面临“意图鸿沟”——生成补丁与开发者原始意图不一致。依赖自然语言摘要或对抗采样的现有方案难以提供手术级修复所需的确定性约束。本文提出 extsc{Prometheus},一种优先考虑“规范推断”而非代码生成的新框架。采用行为驱动开发(BDD)作为可执行契约,通过多智能体架构从运行时失败报告中反向推导Gherkin规范。为解决“意图幻觉”,提出 extbf{需求质量保障(RQA)循环},利用真实代码作为代理真值来验证推断的规范。在Defects4J基准上的680个缺陷上评估显示:该框架总修复率达 extbf{93.97\%}(639/680),更关键的是,对119个强基线智能体无法修复的复杂漏洞实现了 extbf{74.4\ extbackslash%} 的成功救援率。定性分析表明,明确意图引导智能体避免结构侵入式过度设计,趋向精准、最小化修正。研究结果表明,未来APR的关键不在于更大模型,而在于将代码与经验证的 extbf{可执行规范} 对齐——无论其是否预先存在或反向推导。
原文摘要 · Abstract (English)
The transition from neural machine translation to agentic workflows has revolutionized Automated Program Repair (APR). However, existing agents, despite their advanced reasoning capabilities, frequently suffer from the ``Intent Gap'' -- the misalignment between the generated patch and the developer's original intent. Current solutions relying on natural language summaries or adversarial sampling often fail to provide the deterministic constraints required for surgical repairs. In this paper, we introduce \textsc{Prometheus}, a novel framework that bridges this gap by prioritizing \textit{Specification Inference} over code generation. We employ Behavior-Driven Development (BDD) as an executable contract, utilizing a multi-agent architecture to reverse-engineer Gherkin specifications from runtime failure reports. To resolve the ``Hallucination of Intent,'' we propose a \textbf{Requirement Quality Assurance (RQA) Loop}, a mechanism that leverages ground-truth code as a proxy oracle to validate inferred specifications. We evaluated \textsc{Prometheus} on 680 defects from the Defects4J benchmark. The results are transformative: our framework achieved a total correct patch rate of \textbf{93.97\%} (639/680). More significantly, it demonstrated a \textbf{Rescue Rate of 74.4\%}, successfully repairing 119 complex bugs that a strong blind agent failed to resolve. Qualitative analysis reveals that explicit intent guides agents away from structurally invasive over-engineering toward precise, minimal corrections. Our findings suggest that the future of APR lies not in larger models, but in the capability to align code with verified, \textbf{Executable Specifications} -- whether pre-existing or reverse-engineered.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。