Alibaba's Code Reviewer Runs Deterministic Rules First and Asks the Model Second

A general-purpose coding agent asked to review a large changeset behaves like a person asked to proofread a book by Friday. It starts diligently, finds a rhythm, and somewhere in chapter four begins skimming. The result is a review that covers the first third of the diff thoroughly, mentions two things in the middle, and declares the rest clean.
Alibaba's Open Code Review, open sourced this month after two years as an internal tool and sitting near 51,000 stars on GitHub, is built around the observation that this failure is architectural rather than a prompt problem.
Three failures the team names
The README is unusually direct about what went wrong with the general-agent approach.
Incomplete coverage comes first. On larger changesets, agents selectively review some files and miss others, and there is no mechanism in a language-driven loop that guarantees every file gets looked at.
Position drift comes second. Reported issues frequently do not match the actual code location, with line numbers and file references sliding off target. Anyone who has tried to apply an agent's review comments has met this: the comment is right about the bug and wrong about where it lives.
Unstable quality comes third. Natural-language skills are hard to debug, and review quality moves significantly with small prompt variations. That makes the tool impossible to certify and hard to trust in a gate.
The diagnosis in one sentence: a purely language-driven architecture has no hard constraints on the process.
What it moved out of the model
The design splits the work. Anything that must not go wrong is handled by ordinary code. Anything that requires judgement goes to the agent.
File selection is deterministic. Code decides which files are in scope and which are filtered out, so nothing important is skipped for reasons the model cannot explain.
Bundling is deterministic. Related files are grouped into a single review unit, and the README's example is the useful one: message_en.properties and message_zh.properties belong together, because a key added to one and forgotten in the other is exactly the bug a per-file reviewer misses. Each bundle runs as a sub-agent with isolated context, which is how the tool stays stable on giant changesets and why it parallelises without coordination.
Rule matching is deterministic. Rules are matched to each file's characteristics through a template engine rather than described in prose and hoped for. The stated benefit is that the model's attention stays on the rules that apply instead of scanning a rulebook.
Two modules sit outside the agent entirely: one positions comments, one reflects on them. Both exist because a model that writes a comment is not reliable about where the comment goes, and asking it to check its own placement works better as a separate pass than as an instruction inside the main prompt.
The agent keeps the parts that need a decision: which context to fetch, which tools to call, how to phrase a finding. Its toolset was distilled from production call traces at Alibaba, including call frequency distributions and how often each tool got repeated, which is a more empirical basis than the usual guess at what a reviewer might need.
The numbers, and the tradeoff buried in them
The benchmark is called AACR-Bench: 50 popular open source repositories, 200 real pull requests, 10 programming languages, 80-plus senior engineers, and 1,505 annotated ground-truth issues.
Against a general-purpose agent using the same underlying model, Alibaba reports significantly higher precision and F1, about one ninth of the tokens, and faster completion. Recall is lower.
That last clause is the most honest sentence in the README, and it changes who should use this.
Precision means the proportion of reported issues that are real. Recall means the proportion of real defects that get found. A reviewer tuned for precision is quiet and usually right. A reviewer tuned for recall is noisy and usually finds more.
For a CI gate on a busy repository, precision is the correct target. A bot that comments forty times on a pull request with eleven real problems gets muted within a week, and a muted bot has zero recall regardless of its benchmark score. The team made the trade that keeps the tool switched on.
For a security audit of unfamiliar code, the trade is wrong. You want the noisy reviewer. Which is why ocr scan exists as a separate mode that reviews whole files rather than a diff, and why the precision-first default should be read as a statement about pull requests rather than about code review in general.
Installing it
The tool is a CLI called ocr.
npm install -g @alibaba-group/open-code-review
ocr config provider
ocr config model
Configuration walks through provider selection, key entry, and a connectivity test. Then, from a repository:
ocr review # staged, unstaged, untracked
ocr review --from main --to feature-branch # merge-base range
ocr review --commit abc123
ocr scan --path internal/agent # whole files, no git history needed
ocr review --format json --output result.json
Long reviews can be interrupted and resumed with ocr session list and --resume, which matters once you point this at a monorepo. There is a browser session viewer for replaying a review, marking comments fixed or ignored.
The design decision I find most interesting is delegation mode. In the default mode, OCR calls the model itself using its own provider configuration, which is separate from your Claude Code subscription. In delegation mode, OCR still does file selection and rule resolution, and hands the actual review to your coding agent's own model and authentication. No separate API key.
That is a sharp reading of where the value sits. The scaffolding is the product. The model is a commodity you may already be paying for.
Why this matters beyond code review
Strip the specifics and the architecture is a general answer to a general problem: language models are unreliable at exhaustive, order-preserving, position-accurate work over large inputs, and reliable at judgement within a bounded context.
Every content pipeline I have seen fail has failed the same way. An agent asked to check twenty product images for brand compliance checks eleven of them and writes a confident summary. An agent asked to localize forty strings skips four and reports success. The failure is not quality, it is coverage, and coverage is exactly what a deterministic layer provides.
The pattern to steal is the split: enumerate in code, judge in the model, then verify the output position in code again. Alibaba applied it to diffs. The same three steps apply to a folder of generated assets, a batch of translated pages, or a spreadsheet of claims.
There is a cost, and it is the reason most teams do not do this. Deterministic scaffolding has to be written per domain. File bundling rules for Java properties files are worthless for a folder of product images, and the reflection module that fixes comment placement has no analogue in a translation pipeline. The engineering does not transfer. The pattern does.
What I would watch
Two things over the next quarter.
Whether the rule set stays current. A template-matched rule engine is stable precisely because it is explicit, and explicit rules rot. The rule that catches an NPE pattern in Java 17 code may be noise in Java 25 code. Stability bought with hardcoding has a maintenance bill attached.
And whether precision-first holds up outside Alibaba's codebase. A reviewer tuned on a decade of internal conventions will look sharp on those conventions. The open question, and the one the community will answer quickly, is how it behaves on code written by people who have never read the same style guide.
Related articles
The Jensen Discount: What Nvidia Loses When Its Founder Walks Out
Nvidia lost roughly $600 billion in market value when its founder stepped down. The earnings did not change. The multiple did, and that says where the value really lived.
Chinese text in video always turns to mush. Dreamina handed the typesetting to code
Dreamina launched Motion Studio on November 10. It no longer generates frames; the model writes code that lays out text, shapes and pacing. Chinese titles stop blurring, but whether the content is right is still on you.
A community spreadsheet of taps that turns off the ads inside Chinese Android builds
A no-root tool that switches off the ads Chinese phone makers ship inside the system UI. Its method is a hand-written tap script per phone model, maintained by volunteers every time a ROM moves. It works, and the maintenance is the point.
GPT Image 2.6 held the token price and raised the bill
GPT Image 2.6 kept every token rate from 2.5 and still costs more per image, because more of the work now happens in output tokens. Eleven days into the ramp, the pricing structure says more than the leaderboard does.