-
-
Bug Origin: file a bug, get its origin, with the evidence.
-
The search, replayed from a recorded run: pass before, fail from commit b82ab99 on.
-
The agent's JUnit test, checked on the revision the bug was reported against.
-
Ask the Bug Origin Rovo agent on any Jira bug: it reads the report and starts the job.
-
Checking the answer key: three published labels could not be right; one of our misses was confirmed.
-
Measured before believed: pre-registered results on two codebases, the weak one included.
-
The answer on the issue: commit, confidence and the commit before it as evidence.
-
Try it: four real bug reports in one click, expected answers beside them.
Inspiration
In February 2012 a developer filed LANG-788 against Apache Commons Lang: cloning an object that holds int.class crashed. The report even included the failing test. Fixing it was easy. Knowing which change broke it, and when, was not. The project had over 3,000 commits, and finding the culprit means building old versions one by one. So usually nobody does it, and the same kind of mistake comes back. The answer, it turns out, is a patch from August 2011 that was itself a fix for another user's class-loading problem: one fix quietly caused the next bug.
We wanted that answer, with its evidence, on the Jira issue, for every bug, without anyone touching anything.
What it does
- Reads the report. You ask the Bug Origin Rovo agent "Find where this bug came from" on a Jira bug, or let an Automation rule start it on every new bug. The agent reads the whole report, including who said what, and decides whether it is a bug at all. A maintainer saying "this is expected" is a reason to decline.
- Writes and checks a test. It writes one small JUnit test that reproduces the reported behaviour and runs it on the revision the bug was reported against.
- If the test does not compile, it sees the error and the real API of that revision, and fixes it.
- It gets three tries, enforced in code. Only a test that failed there can be used.
- Searches the history. A runner on Google Cloud Run builds old revisions and runs the test on them: a k-ary search over first-parent history, four builds in parallel, in a container without network access.
- It walks back over commits that do not build, and over islands where the test cannot compile.
- It probes for histories where the bug broke, was fixed and broke again.
- Answers with a confidence it has to earn. The answer is posted on the issue and shown in the Bug Origin issue panel, next to the test and the evidence.
- High: the test passes on the commit before and fails from this one on.
- Medium: the code under test was born in this commit.
- Low: a lower bound only.
- Abstain: no answer.
- The language model never sets the confidence: a published rule in code does.
- Lets anyone try it in minutes. The Bug Origin project page adds four real bug reports (Apache Commons Lang and Google Closure Compiler) in one click, with the expected answers beside them. On a site without Rovo, the panel can replay the search with the test the agent wrote in a published run.
How we built it
- Forge app:
- A
rovo:agentwith threerovo:actions: get-bug-report, check-test, find-bug-origin. - An event queue consumer that drives the long search.
- A Forge remote to Cloud Run, authenticated with the Forge Invocation Token; there is no shared secret.
- UI Kit views: the issue panel and the project page.
- App storage for every checked test and result.
- A
- Runner (Python, Docker, Cloud Run):
- Exports any revision with
git archiveand builds it with JDK 8. - Commons Lang is built with javac; Closure Compiler with javac or its own Ant build, since Rhino is repackaged with jarjar from 2011.
- Runs one test and reports PASS, FAIL, NOCOMPILE or ERROR.
- Exports any revision with
- Benchmark, pre-registered before any run:
- Real bugs with published bug-inducing commits: Fonte (ICSE 2023) and Defects4J.
- A seeded dev/held-out split; controls that are not bugs; planted wrong fixes that must be blocked.
- Every held-out run frozen with a git tag, run with zero human touches, and published with its misses.
How well it works (pre-registered; misses published)
- Apache Commons Lang, held-out run 1: the exact commit for 6 of 18 bugs, and right every time it was confident (6/6).
- Commons Lang, run 2: after fixing the published misses, a re-run of the same 18 bugs (so not a fresh held-out result): 12/18, right when confident 12/13.
- Google Closure Compiler (second, unrelated codebase, 24 bugs): against the published labels, 3/24 exact and only 3/7 right when confident.
- Label audit: we then tested every confident disagreement the same way. In three of four, the published label cannot be right: at the labelled commit the bug is not there yet, or it is already there before it. One Commons Lang label we disputed turned out right.
- We kept the pre-registered score as the headline.
- The audited score (6/7) is published beside it, marked post hoc and one-sided.
- Controls: 8 of 9 planted wrong fixes were blocked (the ninth was built from a wrong label); 14 of 18 "not a bug" reports were declined.
Every number has a link in CLAIMS.md. Try it yourself: JUDGES.md.
Challenges we ran into
- Rovo redacts URL-like text in action inputs: a regex
\sarrived ashttps://s, and*/was replaced. The agent now writes[[SLASH]]and[[BACKSLASH]], which the app restores before compiling. - Silent platform failures: sometimes the agent never started. We detect it and retry once, under a rule we pre-registered before the next held-out run.
- Twelve years of builds:
- JUnit 3 on 2009 commits.
- Rhino repackaged with jarjar.
- Resources the Ant build would have packaged.
- Commits where the test cannot compile in the middle of history. A naive bisection reads these as "bug absent" and confidently answers wrong: a property test on simulated histories gave 14 wrong answers in 500 before we fixed it, and 0 in 1000 after.
- Our own wrong explanation: we first explained the Closure misses as tests that cannot see the bug in old code, without re-running anything. When we checked, three of the four were label errors. We withdrew the explanation in public and now re-run before explaining any miss.
Accomplishments that we're proud of
- A confidence rule that held on 6/6 and 12/13 confident answers on Commons Lang.
- A benchmark we could not quietly tune: misses published, labels audited in both directions.
- The whole judge path works on a fresh site: install, four real bugs in one click, the answer in about two minutes.
What we learned
- A failing test at the reported revision is not enough evidence; the test has to separate the buggy revision from the fixed one, and the search has to distrust "does not compile".
- Benchmark labels made by blaming the fix's lines are not ground truth.
- On a compiler, writing the right test is the hard part: the agent produced a valid test for only 9 of 24 Closure bugs, against 16 of 18 on Commons Lang.
What's next
- Better test writing for compiler-style codebases: semantic checks instead of output text.
- Connecting a team's own repository: today each codebase needs a build recipe in the runner.
- Learning per codebase which kinds of commits break things, from the answers already posted.