Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Closing the Loop: Universal Repository Representation with RPG-Encoder

About

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.

Jane Luo, Chengyu Yin, Xin Zhang, Qingtao Li, Steven Liu, Yiming Huang, Jie Wu, Hao Liu, Yangyu Huang, Yu Kang, Fangkai Yang, Ying Xin, Scarlett Li• 2026

Related benchmarks

TaskDatasetResultRank
File-level Code LocalizationSWE-bench Verified Lite
Accuracy@191.9
25
File-level Code LocalizationSWE-bench Live Lite
Acc@182.1
25
Function-level Code LocalizationSWE-bench Verified Lite
Acc@183.4
25
Function-level Code LocalizationSWE-bench Live Lite
Acc@174.8
25
Repository ReconstructionRepoCraft (test)
Steps6.34
20
Repository UnderstandingSWE-bench Verified (test)
Steps6.34
8
Repository ReconstructionRepoCraft Gold Projects
Coverage98.5
5
Showing 7 of 7 rows

Other info

GitHub

Follow for update