普罗米修斯计划:通过反向工程可执行规范弥合代理程序修复中的意图差距
Project Prometheus: Bridging the Intent Gap in Agentic Program Repair via Reverse-Engineered Executable Specifications
AI总结:
本文提出普罗米修斯框架,通过规范推断而非代码生成解决代理程序修复中的意图差距问题,实现了93.97%的正确补丁率和74.4%的救援率。
摘要:
从神经机器翻译到代理工作流的转变革新了自动程序修复(APR)。然而,现有代理常面临意图差距问题,即生成的补丁与开发者原意不一致。本文引入普罗米修斯框架,优先进行规范推断而非代码生成,利用行为驱动开发(BDD)作为可执行合同,通过多代理架构从运行时故障报告中反向工程Gherkin规范。我们提出要求质量保证(RQA)循环,利用真实代码作为代理来验证推断的规范。在Defects4J基准测试中,普罗米修斯在680个缺陷上实现了93.97%的正确补丁率,其中74.4%的复杂问题被成功修复。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。