TL;DR
When reviewing code, we usually just look at the final "diff"—the clean end product. When AI coding agents write code, however, they leave behind a rich lab notebook of false starts, assumptions, and failed tests called a trajectory. This paper shows that giving independent AI reviewers structured access to these development trajectories significantly boosts their ability to catch bugs—though how you package that messy history matters just as much as having it.
What Problem Does This Paper Address?
Imagine grading a complex math proof where you only see the final equation, with all the scratch paper burned. That’s standard code review: you inspect the final patch (diff) and surrounding repository, missing the messy reality of discarded ideas, silent assumptions, and edge cases patched in haste.
Unlike human developers whose thought processes stay mostly in their heads, AI coding agents think out loud. Their development trajectories record every prompt, internal plan, search, edit, and test failure. In theory, if an agent says, "I assume this new shortcut still triggers custom user hooks," a reviewer has a golden lead to verify. In practice, trajectories are bloated with thousands of lines of noisy terminal outputs and dead-end code. Does handing this raw log to an independent AI reviewer actually help catch bugs, or just drown it in noise?
Methods
To test trajectory-informed code review, the authors separated code generation from review—having independent AI review harnesses (Codex CLI and GitHub Copilot CLI, powered by GPT-5.6 Sol) inspect patches created by separate coding agents.
Beyond comparing standard Diff-only review against raw Full-trajectory access, the team designed four structured ways to present and use trajectory data:
- Messages: Strips out noisy tool calls and terminal logs, keeping only the chronological text of the user request and agent thoughts/claims.
- Self-selected signals: Before looking at the code, the reviewer reads the trajectory and freely takes notes on what seems worth checking.
- Evidence-linked map: A coordinator builds a strict, structured map of facts and prioritized test questions citing specific trajectory events before code inspection, capping investigation at ten focused probes.
- Code-first adversarial scrutiny: The reviewer inspects the code first to form an unbiased opinion, then reads the trajectory specifically to challenge the coding agent's safety claims and test coverage.
Because public agent trajectories rarely have thorough human code reviews attached, the authors also invented a clever synthetic benchmark generator: an LLM compares an initial flawed patch against a ground-truth final patch to reverse-engineer the exact review comments needed to bridge the gap.
Datasets
- Human-PR Validation Corpus: 100 human-authored GitHub pull requests (from 49 popular MIT-licensed repositories) containing 126 real human review comments. Used to validate their synthetic comment generator.
- Trajectory-Linked Review Dataset (New): Built on 113 DeepSWE tasks across 91 repositories (spanning Go, Python, TypeScript, JavaScript, and Rust). Running three coding agents (GPT-5.5, GPT-5.6 Sol, and Gemini 3.8 Flash) yielded 339 implementations paired with full trajectories and 882 synthetic reference review comments.
Key Insights and Ideas
- Raw logs go unread: Simply giving an agent tool access to the full trajectory isn't a silver bullet. Reviewers queried only about 10% of the raw trajectory text, and performance actually dropped in two configurations.
- Just reading the "diary" is wildly effective: The Messages view—which throws away all tool executions and test logs, keeping only the agent’s narrative—came in a close second overall while using fewer tokens across every single configuration. Knowing what the coder assumed gives the reviewer tremendous leverage.
- Trajectories change what you find, not just how much: Trajectory-informed review and diff-only review catch different bugs. Even the best trajectory method missed bugs that a plain diff-only pass caught, suggesting process history and pure code inspection are complementary lenses.
Key Results
- Validating synthetic references: On the 100 human PRs, the authors' comment-generation method recovered 81.22% of withheld human review concerns (with 100.00% micro precision and 89.62% F1).
- Full-trajectory vs. Diff-only: Raw trajectory access bumped mean reference recall (the percentage of known issues caught) from 23.03% to 25.87% (+2.83 percentage points), improving 4 of 6 configurations.
- Structured trajectory methods win: All four structured approaches beat both diff-only and raw trajectories across the board (+4.05 to +7.32 pp over diff-only). Evidence-linked map led at 30.35% mean recall, followed closely by Messages at 29.03%, Self-selected signals (27.83%), and Adversarial scrutiny (27.08%).
- Critical failures & cost: All four structured methods improved recall on critical review comments explaining task-verifier failures, though higher recall can demand more tokens and longer review times.
Limitations and Future Work
While the provided text cuts off before the formal Discussion section, several boundaries are clear from the study design and abstract:
- Synthetic ground truth: Because real-world agent PRs lacked dense human feedback, main evaluations rely on synthetic comments derived from held-out reference solutions rather than live human reviewers.
- Recall over precision: The primary metric (micro recall) measures how many reference bugs the reviewer caught, rather than grading the accuracy or false-positive rate of every extra comment the reviewer generated.
- Cost-coverage trade-offs: Structured methods like the evidence-linked map boost defect discovery but consume extra tokens and time, pointing toward future work in lightweight, high-signal trajectory views (like Messages) or hybrid diff-plus-trajectory workflows.
Summary updated