🤖 AI Summary
This work addresses the limited scalability of existing automated program repair methods to repository-level scenarios, primarily due to their insufficient understanding of cross-file dependencies and global context. To overcome this, we propose an end-to-end repair framework grounded in hierarchical code documentation. Our approach first leverages a large language model (e.g., DeepSeek-V3) to generate structured semantic documentation spanning from individual functions to entire files, thereby constructing an abstract representation of the codebase. This documentation then serves as a semantic bridge to guide a more capable model (e.g., Claude-4) in precise fault localization and cross-file patch generation. Evaluated on SWE-bench Lite and Multimodal, our method achieves state-of-the-art repair rates of 45.7% and 37.1%, respectively, at remarkably low costs of $0.44 and $0.56 per instance, demonstrating significantly enhanced repository-level contextual awareness.
📝 Abstract
Automated program repair (APR) struggles to scale from isolated functions to full repositories, as it demands a global, task-aware understanding to locate necessary changes. Current methods, limited by context and reliant on shallow retrieval or costly agent iterations, falter on complex cross-file issues. To this end, we propose RepoRepair, a novel documentation-enhanced approach for repository-level fault localization and program repair. Our core insight is to leverage LLMs to generate hierarchical code documentation (from functions to files) for code repositories, creating structured semantic abstractions that enable LLMs to comprehend repository-level context and dependencies. Specifically, RepoRepair first employs a text-based LLM (e.g., DeepSeek-V3) to generate file/function-level code documentation for repositories, which serves as auxiliary knowledge to guide fault localization. Subsequently, based on the fault localization results and the issue description, a powerful LLM (e.g., Claude-4) attempts to repair the identified suspicious code snippets. Evaluated on SWE-bench Lite, RepoRepair achieves a 45.7% repair rate at a low cost of $0.44 per fix. On SWE-bench Multimodal, it delivers state-of-the-art performance with a 37.1% repair rate despite a higher cost of $0.56 per fix, demonstrating robust and cost-effective performance across diverse problem domains.