arXiv:2610.31809cs.LGOct 2026

Manuscript Offprint

arXiv:2610.31809

CuraLoc: Repository-Level Fault Localization via Planned Code Inspection

Sangeeta Warrier, Anush Sankaran, Ryen White

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

A bug report describes what went wrong, but rarely where the code should change. Existing repository-level localization methods often let language models iteratively decide what code to inspect next, requiring repeated model calls and substantial token usage. We investigate whether these inspection decisions can instead be planned before source retrieval. In this research, we introduce CuraLoc, which first selects candidate files and represents their symbols using compact behavioral and structural descriptions. In a single planning decision, the model jointly selects starting symbols, chooses code relationships to inspect from each, and forms hypotheses about likely edits. Deterministic retrieval collects the requested source for a final ranking informed by those hypotheses, concentrating model reasoning on choosing and comparing code rather than directing each retrieval step. We demonstrate the efficacy of our proposed approach on the SWE-Bench Lite and Verified datasets. On SWE Bench Verified with GPT-5.2, CuraLoc raises Func@1 from LocAgent's 53.8% to 59.3% while using 90.3% fewer recorded tokens, and also outperforms RepoSearcher (56.2%) and Agentless (39.6%) on Func@1. On SWE-bench Lite, CuraLoc achieves a high 83.8% Func@5 accuracy improving on Agentless by more than 15% in relative accuracy. Additionally, CuraLoc supports different model backbones, with strong localization accuracy demonstrated using both GPT-5.2 and GPT-6 Astra. These results provide evidence that repository-level code inspection can be planned effectively without iterative model-controlled navigation.

1 Introduction

Automated program repair aims to turn bug reports into correct code changes. A central challenge is identifying where those changes belong: a report describes a failure, but the code that needs to change may lie elsewhere in the repository. Fault localization addresses this challenge by identifying the files and symbols—functions, methods, and classes—that should be edited (Wong et al., 2016).

Code involved in a failure is not necessarily the code that should change. Consider a library that rejects a valid input: a public API receives it, a helper transforms it, and a validator checks it. If the validator implements the wrong rule, inspecting its callers can clarify the expected behavior; if the helper produces the wrong value, inspecting the functions it calls can clarify the transformation. Each hypothesis about the edit location suggests a different starting symbol and a different relationship to inspect.

Existing localization methods handle this choice in two main ways. Fixed-rule methods expand selected locations using a predefined procedure, while interactive agents choose what to inspect next after observing earlier retrievals. The latter can adapt the search to each issue, but requires repeated model calls ( §2§2). We ask: can selecting starting symbols and retrieval actions from compact code descriptions support accurate localization without repeated navigation decisions?

We introduce CuraLoc (curated localization). After selecting candidate files from repository structure, CuraLoc gives the primary model compact symbol descriptions: signatures, structural relationships, and behavioral summaries from docstrings or a smaller model. In one decision, the model selects starting symbols, a retrieval action for each—callers, callees, same-class methods, or base and overriding implementations—and hypotheses about likely edits, forming a RouteMap. Deterministic retrieval collects the requested source, and a final decision ranks edit locations using that source and the RouteMap’s explanations. The inspected code varies with the issue; the primary model makes three decisions.

We use SWE Bench Lite for configuration selection and SWE Bench Verified for primary evaluation (Jimenez et al., 2024). We compare CuraLoc with Agentless, RepoSearcher, and LocAgent using GPT-5.2, with three runs per method on each benchmark. An additional GPT-6 Astra comparison uses one run per method on SWE Bench Verified. Func@k requires all reference edit symbols within the first k distinct predictions.

Our contributions are:

  1. Planned code inspection with model-selected retrieval. We introduce CuraLoc, which uses repository structure to select files, compact behavioral and structural descriptions to select symbols and related code, and retrieved source to rank edit locations. The model specifies starting symbols and retrieval actions together; deterministic retrieval collects the source for a final decision informed by the earlier explanations. This design adapts what code is inspected to each issue within three primary-model decisions, without repeated model-controlled navigation.

  2. Accuracy-token gains and tradeoffs. On SWE Bench Verified with GPT-5.2, CuraLoc achieves a Pareto improvement over LocAgent: Func@1 rises from 53.8% to 59.3% while recorded tokens fall by 90.3%, including summary generation. Multiplicity-adjusted joint bootstrap bounds support both advantages, including on SWE Bench Verified tasks absent from SWE Bench Lite. On SWE Bench Lite, comparisons with Agentless and RepoSearcher show higher observed symbol accuracy at greater token consumption. On SWE Bench Verified, CuraLoc also achieves higher Func@1 than RepoSearcher and Agentless, using 1.74×1.74\times RepoSearcher's recorded tokens.

Component and failure analyses explain how code selection, source inspection, and expansion contribute to localization, and identify where complete edit-set recovery still fails.