Bug localization for real repositories

Find the file before reading the codebase.

RepoTrace turns a bug report into a ranked list of source files. It combines repository-aware data engineering, lexical retrieval, and a fine-tuned CodeBERT experiment.

Trace / apache/airflow #36219Saved evaluation case

$ repotrace analyze apache/airflow --issue 36219

Issue
"Mark state as success" button options are grayed out in Airflow 2.7.3.
Ranked files
  1. 01airflow/www/static/js/dag/details/taskInstance/taskActions/MarkInstanceAs.tsx0.941changed
  2. 02airflow/models/skipmixin.py0.641
  3. 03airflow/serialization/pydantic/taskinstance.py0.615

First changed file at rank 1. The first result matches the file changed by the fixing commit.

13,855issue-code pairs
13public repositories
5languages
104automated tests
01

Inspect a saved trace

These examples come from repository-separated evaluation data. Choose a case to see what the system ranked and what the eventual fix changed.

Trace / apache/airflow #36219Saved evaluation case

$ repotrace analyze apache/airflow --issue 36219

Issue
"Mark state as success" button options are grayed out in Airflow 2.7.3.
Ranked files
  1. 01airflow/www/static/js/dag/details/taskInstance/taskActions/MarkInstanceAs.tsx0.941changed
  2. 02airflow/models/skipmixin.py0.641
  3. 03airflow/serialization/pydantic/taskinstance.py0.615

First changed file at rank 1. The first result matches the file changed by the fixing commit.

02

One issue, four steps

Training and evaluation use the exact source snapshot that existed before each bug was fixed. Repositories never cross data splits.

01

Snapshot

Check out the repository before the fixing commit.

02

Index

Filter and split source files into searchable chunks.

03

Retrieve

Use BM25 to select 50 distinct candidate files.

04

Rerank

Score candidates with the fine-tuned CodeBERT experiment.

03

The simpler system won

CodeBERT improved validation results, then failed to generalize to the held-out repositories. RepoTrace reports that result instead of hiding it.

SystemHit@5MRRMAP
BM250.4100.2990.250
BM25 + CodeBERT0.3330.2630.210
04

Built as a complete system

The model experiment sits inside a tested application, not a notebook-only prototype.

Data pipeline

Git history reconstruction, source filtering, hard-negative mining, and repository-disjoint splits.

ML evaluation

CodeBERT fine-tuning, weight selection on validation, held-out ranking metrics, and error analysis.

Application

FastAPI inference, Next.js interface, Docker packaging, request limits, and CI checks.