闭环:通用仓库表示法与RPG-编码器
Closing the Loop: Universal Repository Representation with RPG-Encoder
AI总结:
RPG-Encoder通过统一表示和闭环推理,实现复杂代码库的高精度理解和生成。
摘要:
当前的仓库代理由于碎片化的表示而面临推理断开的问题,现有方法依赖于孤立的API文档或依赖图,这些图缺乏语义深度。我们将仓库理解和生成视为统一循环中的逆过程:生成将意图扩展为实现,而理解将实现压缩回意图。为此,我们提出了RPG-编码器,该框架将仓库规划图(RPG)从静态生成蓝图泛化为统一的、高保真的表示。RPG-编码器通过三种机制关闭推理循环:(1)将原始代码编码到RPG中,结合提升的语义特征与代码依赖;(2)逐步演变拓扑结构,使维护成本与仓库规模脱钩,将开销降低95.7%;(3)作为统一的接口,实现结构感知的导航。在评估中,RPG-编码器在SWE-bench Verified上建立了最先进的定位性能,达到93.7%的Acc@5,并在SWE-bench Live Lite上超越最佳基线超过10%的定位准确率。这些结果突显了我们在复杂代码库中精细精度的优越性。此外,它在RepoCraft上实现了98.5%的重建覆盖率,证实了RPG的高保真能力,能够映射原始代码库,从而在意图和实现之间闭合循环。
英文摘要:
Current repository agents encounter a reasoning disconnect due to fragmented representations, as existing methods rely on isolated API documentation or dependency graphs that lack semantic depth. We consider repository comprehension and generation to be inverse processes within a unified cycle: generation expands intent into implementation, while comprehension compresses implementation back into intent. To address this, we propose RPG-Encoder, a framework that generalizes the Repository Planning Graph (RPG) from a static generative blueprint into a unified, high-fidelity representation. RPG-Encoder closes the reasoning loop through three mechanisms: (1) Encoding raw code into the RPG that combines lifted semantic features with code dependencies; (2) Evolving the topology incrementally to decouple maintenance costs from repository scale, reducing overhead by 95.7%; and (3) Operating as a unified interface for structure-aware navigation. In evaluations, RPG-Encoder establishes state-of-the-art localization performance on SWE-bench Verified with 93.7% Acc@5 and exceeds the best baseline by over 10% in localization accuracy on SWE-bench Live Lite. These results highlight our superior fine-grained precision in complex codebases. Furthermore, it achieves 98.5% reconstruction coverage on RepoCraft, confirming RPG's high-fidelity capacity to mirror the original codebase and closing the loop between intent and implementation.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。