LegoReview: Scaling Code Review Data with Verification from Pull Request Histories
As coding agents write a growing share of software, automated code review becomes increasingly necessary. Training capable reviewers calls for scaling verifiable tasks and verified trajectories. However, code review produces open-ended, natural-language findings whose correctness cannot be verified simply by running tests. We observe that pull request (PR) histories provide an implicit verification signal: discussions, code revisions, and other actions reveal which findings were accepted or fixed and which were withdrawn or rejected. Therefore, we introduce LegoReview, a pipeline that reconstructs reviewed code snapshots from merged GitHub PRs and uses their discussions and revisions to construct verifiable review tasks and verify training trajectories. From 556k merged PRs, we build 168k review tasks and 60k verified trajectories, spanning eight programming languages and eight finding categories such as correctness, maintainability, and design. Fine-tuning Qwen3.5-35B-A3B-Base on just 1k verified trajectories raises F1 score from 5.7 to 43.1 on our proposed LegoReview-Bench, and scaling to 60k raises it further to 56.1. Further, the benefits of review training extend to coding…
- arXiv
- 2612.00862
- Authors
- Ruoyu Wang, Jierun Chen, Yuxin Jiang, Chaofan Tao, Shaowei Wang and 8 more
- Categories
- cs.SE