GitHub Weekly: alibaba open-code-review, a 56k-star review agent that turns no-missed-files into a hard constraint

56,261 stars, plus 2,638 this week, a Go CLI under Apache 2.0. On the November 25, 2026 GitHub weekly chart, alibaba/open-code-review, OCR for short, sits around fifth place. It is not trying to make a model read a diff. General agents already do that. It is chasing three uglier problems: missing files on large changesets, review comments anchored to the wrong line, and the same PR producing different results twice.

The README states the internal history plainly: Alibaba Groups official AI code review assistant, used by tens of thousands of developers over two years and credited with millions of defects found, then incubated as an open source project. Those numbers are self reported and were not independently verified here. Repository state and code structure can be checked.

Where a language driven reviewer breaks

The project lists three failure modes for a general agent plus a review skill, from the README dated 2026-11-25:

  • Incomplete coverage. On large changesets the agent cuts corners, reviews a few files and skips the rest.
  • Position drift. The finding is real, but the line number or file reference no longer points at the code.
  • Unstable quality. Natural language skills are hard to debug, and small prompt edits move the results.

It attributes all three to one cause: a purely language driven architecture has no hard constraints on the process. The design is therefore split in two. Deterministic engineering owns the parts that must not fail: precise file selection, bundling related files such as message_en.properties and message_zh.properties into one isolated subtask, rule matching per file, and separate modules for comment positioning and reflection. The agent owns dynamic judgment: review tuned prompts and a toolset distilled from production tool call traces.

That split is the point of this article. Most AI review products hand a diff to a model and ask for three sentences. OCR bets that the model judges while engineering owns the workflow.

Six gates decide what gets reviewed

Every file in a diff passes six gates in order: binary, secret_exclude, user_exclude, user_include, unsupported_ext, default_path. Sensitive paths such as .ssh/, id_rsa, .env variants and .npmrc are excluded and include cannot override that. A user exclude outranks include. A path matching include skips the extension allowlist and the default path exclusions, but a path that does not match include still goes through both later gates. The doc says it directly: include is not a whitelist.

Rule resolution is a second chain: a --rule flag, the project file .opencodereview/rule.json, the global file ~/.opencodereview/rule.json, then the embedded system_rules.json. The first matching path wins. A common trap is that rules[].path only selects which rule text applies, not whether the file is reviewed. To keep the built in language rules alongside a custom rule, set merge_system_rule to true, otherwise the user rule replaces the system rule. Matching is case insensitive; ocr rules check path shows the final resolution.

This standard library teaching model reproduces the gate order. It is not OCR source code, but the sequence and priorities follow the official docs:

from fnmatch import fnmatch

SECRET = (".ssh*", "id_rsa", ".env", ".env.*", ".npmrc", ".pypirc")
DEFAULT_EXCLUDE = ("*_test.go", "*.test.js", "testdata*", "fixtures*", "node_modules*", "vendor*", "dist*", "*.pb.go", "*.snap")
ALLOWED_EXT = (".go", ".java", ".py", ".ts", ".tsx", ".js", ".json", ".yaml", ".yml", ".sql", ".xml", ".md")


def selected(path, include=(), exclude=(), binary=False):
    low = path.lower()
    if binary:
        return "binary"
    if any(fnmatch(low, p) for p in SECRET) and not low.endswith((".example", ".sample", ".template")):
        return "secret_exclude"
    if any(fnmatch(low, p) for p in exclude):
        return "user_exclude"
    if any(fnmatch(low, p) for p in include):
        return "keep(include)"
    name = low.rsplit("/", 1)[-1]
    ext = "." + name.rsplit(".", 1)[-1] if "." in name else ""
    if ext not in ALLOWED_EXT:
        return "unsupported_ext"
    if any(fnmatch(low, p) for p in DEFAULT_EXCLUDE):
        return "default_path"
    return "review"


CASES = [
    ("internal/agent/selection.go", {}, "review"),
    ("internal/agent/selection_test.go", {}, "default_path"),
    (".ssh/config", {}, "secret_exclude"),
    ("vendor/github.com/x/y.go", {}, "default_path"),
    ("assets/logo.png", {}, "unsupported_ext"),
    ("docs/notes.md", {"include": ["docs*.md"]}, "keep(include)"),
    ("src/main.py", {"exclude": ["src/main.py"]}, "user_exclude"),
    ("pkg/blob.dat", {"binary": True}, "binary"),
]

for path, options, expect in CASES:
    got = selected(path, **options)
    print(path, " -> ", got, "  expect=", expect)
internal/agent/selection.go  ->  review   expect= review
internal/agent/selection_test.go  ->  default_path   expect= default_path
.ssh/config  ->  secret_exclude   expect= secret_exclude
vendor/github.com/x/y.go  ->  default_path   expect= default_path
assets/logo.png  ->  unsupported_ext   expect= unsupported_ext
docs/notes.md  ->  keep(include)   expect= keep(include)
src/main.py  ->  user_exclude   expect= user_exclude
pkg/blob.dat  ->  binary   expect= binary

Note docs/notes.md. Markdown is not in the extension allowlist, but an explicit include rescues it. Meanwhile .ssh/config never escapes. Those two cases are why putting rules in a prompt and putting rules in code are different engineering choices.

Splitting a large diff: bundles, coverage and token budget

The README describes smart file bundling: related files become one subtask with isolated context, so reviews stay stable on very large changesets and can run concurrently. The GitHub Action shows the engineered edges. max_tokens_budget is checked before every LLM round; a group already over budget gets one final round to submit findings and no new groups are dispatched. review_concurrency controls parallelism. effort maps low, medium and high to one, two and three rounds. checkpoint_range reviews only commits after the last recorded head and falls back to a full review when the base changed, configuration changed, or git cannot prove ancestry.

The security assurance case adds harder constraints. External process execution is limited to git with hardcoded subcommands and --end-of-options to prevent flag injection. Every model supplied path is validated with pathutil.WithinBase() before and after symlink resolution. Responses pass JSON schema validation and line numbers are bounded against real diff ranges. TLS 1.2 or higher is enforced with full certificate verification. This is a different class of guarantee from asking a prompt to please cite the right line.

The second example abstracts bundling and coverage, then prices a medium run with two rounds:

FILES = [
    ("internal/agent/selection.go", 42000),
    ("internal/agent/rules.go", 38000),
    ("internal/llm/providers.go", 91000),
    ("src/api/user.ts", 26000),
    ("docs/config.md", 12000),
]

MAX_TOKENS = 100000
EFFORT_ROUNDS = {"low": 1, "medium": 2, "high": 3}

groups = []
current = []
used = 0
for path, tokens in FILES:
    if current and used + tokens > MAX_TOKENS:
        groups.append((current, used))
        current = []
        used = 0
    current.append(path)
    used += tokens
if current:
    groups.append((current, used))

covered = sum(len(paths) for paths, _ in groups)
print("files:", len(FILES), "groups:", len(groups), "covered:", covered)
for i, (paths, tokens) in enumerate(groups, 1):
    print("group", i, "files=", len(paths), "tokens=", tokens, paths[0])

rounds = EFFORT_ROUNDS["medium"]
budget = sum(tokens for _, tokens in groups)
print("rounds(medium):", rounds, "estimated tokens:", budget * rounds)
print("coverage gate:", "PASS" if covered == len(FILES) else "FAIL")
files: 5 groups: 3 covered: 5
group 1 files= 2 tokens= 80000 internal/agent/selection.go
group 2 files= 1 tokens= 91000 internal/llm/providers.go
group 3 files= 2 tokens= 38000 src/api/user.ts
rounds(medium): 2 estimated tokens: 418000
coverage gate: PASS

A teaching model again, not the real bundling algorithm. The point is that coverage can be a hard gate and cost can be estimated before dispatch. Five files in three groups cost 418,000 tokens over two rounds. If the budget is 100,000, cut groups or files instead of quietly lowering effort and claiming a complete review.

How to use it: two paths, and a subscription is not an API key

Requirements are firm: Git 2.41 or newer, on Windows, macOS or Linux. The official commands are straightforward:

  • CLI: npm install -g @alibaba-group/open-code-review puts ocr on PATH. Install scripts, release binaries and source builds are also documented.
  • Native mode: run ocr config provider, ocr config model, verify with ocr llm test, then ocr review. ocr review --preview shows the selected scope before spending tokens.
  • Delegation mode: npx skills add alibaba/open-code-review installs the open-code-review-delegate skill so the host agent, such as Claude Code, Codex, Cursor or Kimi Code, performs the review. No separate OCR API key is needed, but the host subscription, limits and costs still apply.
  • Whole repository: ocr scan reviews whole files without a meaningful diff. Use ocr rules check path to debug rule resolution.
  • CI: the root action.yml requires llm_url, llm_auth_token, llm_model and llm_use_anthropic. Outputs include inline comment counts, skipped comments, routed comments and checkpoint ranges.

Two configuration details bite people. First, the chatgpt provider has no API key environment variable and uses ocr auth login. Custom providers must declare url and protocol explicitly and the model must support native tool calls; local Ollama is no exception. Second, a static api_key outranks api_key_cmd and silently disables it. The file ~/.opencodereview/config.json is treated as trusted input because it can execute a command, and OCR writes it with mode 0600. Do not commit it.

Among similar tools

ApproachWho picks filesPosition and coverageCost and entry point
General agent plus skillThe model chooses after reading the diffPrompt constrained; the README reports drift and missesFastest to adopt, results track model and prompt changes
reviewdog plus lintersExternal linters report, reviewdog filters by diffOnly changed lines, stable line anchoringMIT licensed, linters required, no semantic reasoning
OCRGo code with six gates and a four level rule chainSeparate positioning and reflection modules, line bounds checked against the diffCLI plus Git 2.41 plus a model endpoint, or delegation mode without a key

The benchmark deserves its own paragraph. The README describes 50 popular open source repositories, 200 real pull requests, ten languages, more than 80 senior engineers cross validating, and 1505 annotated defects in AACR-Bench. With the same underlying model, OCR claims clearly higher precision and F1 than a general agent, roughly one ninth of the tokens and a faster run, while recall is lower by design to reduce noise. Those figures are self reported and were not reproduced here. Quote the limitation with the claim or the comparison reads as a total win.

One boundary belongs in any evaluation sheet. The roadmap explicitly rules out automatic fixing without human approval, a general coding assistant and bundled model hosting. This is a review tool, not a pair programmer that merges its own patches.

Recent changes and where to contribute

Releases arrive quickly: v1.14.3 on November 24, v1.14.2 on the 23rd, v1.14.1 on the 22nd, v1.14.0 on the 21st and v1.13.13 on the 19th. Commits visible on November 25 include a fix preserving binary matches in code_search, an allowlist change excluding C and C plus test and benchmark paths, documentation for the secret path gate, Vietnamese i18n, review of GitHub pull requests from pinned snapshots, and retry reports persisted at session end. The repository has 4641 forks, 342 open issues and 162 watchers, with discussion in GitHub Discussions.

The roadmap lists an experimental ACP v1 stdio adapter, a JetBrains plugin, Delegate Mode and a higher recall Ultra Mode for H2 2026, plus domain specific long term memory in H1 2027. There is a docs mismatch worth knowing: the roadmap still lists Delegate Mode as planned while the README describes it as available. Trust the README and releases.

For contributions, start with Issues and Discussions. Issue 470, expand supported file types, carries good first issue and help wanted labels and 34 comments, which makes it a reasonable entry point for rule and language work. AGENTS.md is strict: disclose AI and the exact tools or models used in the issue or pull request, use English commit messages and LF line endings, keep source files ASCII, and sync README changes to seven translated versions. Before committing, run ocr review with the audience agent flag and a short background note. make check and make test are the usual gates, with a 90 percent coverage threshold.

The takeaway is not that AI reviews code well. It is that the review pipeline has been decomposed into verifiable parts: which files entered, which rule applied, how many groups ran, where line numbers came from and what happens on budget exhaustion. If the review process in your team is still one prompt, steal the six gates and the coverage check first, even if you never use this model.

Sources

Further reading

フィードバック

このサイトはフロントエンドのみでバックエンドやアカウントはなく、フィードバックはGitHub Issues・ディスカッション・メールで受け付けています。

issueやメールに貼り付けていただくと問題特定が早まります。入力内容は含まれません

その他:既存の報告を見る · メールでのフィードバック(GitHubアカウント不要):278975598@qq.com