XNews

Alibaba Open Sources AI Code Review Skills OpenCodeReview

Alibaba Open Sources AI Code Review Skills OpenCodeReview

Alibaba open-sourced OpenCodeReview, a code review system using a deterministic pipeline and AI agent. It features precise file selection, intelligent bundling, 54 rule documents, and a delegation mode. On its AACR-Bench benchmark, it achieved higher precision and F1 than Claude Code with 1/9 the token cost.

Key insights

Hybrid Architecture Combines Deterministic Pipeline and AI Agent

OpenCodeReview uses a two-part architecture. The deterministic pipeline handles hard constraints: precise file selection based on code, intelligent file bundling (e.g., pairing message properties files), and fine-grained rule matching using 54 rule documents per language/file type. The AI agent handles dynamic decisions with optimized scenario prompts and a distilled tool set from production tool-call traces. This separation ensures stability and precision.

Deterministic Components Ensure Reliability

The deterministic pipeline includes external re-location and reflection modules to correct comment placement and content, addressing the common problem of location drift. File selection is code-driven, not model-dependent. Intelligent bundling groups related files into a review unit, allowing sub-agents to run in parallel (default 8 workers). Rule matching uses template engines instead of natural language to eliminate noise.

Agent Components Optimized for Code Review

The agent uses deeply optimized scenario prompts divided into multiple task templates (plan, grouping, main, memory compression, re-location, review filter). Its tool set was distilled from production tool-call trajectories, including full file reading, code search, and cross-file lookup. This smaller, more stable tool set reduces errors compared to general-purpose agents.

Comprehensive Feature Set and Ecosystem Integration

OpenCodeReview supports workspace, branch, and single commit review, session recovery, full file scan for unfamiliar codebases, local Session Viewer, SARIF/JSON output, OpenTelemetry observability, and MCP Server extension. It is available as an npm CLI, an Agent Skill with standard frontmatter, and plugins for Claude Code, Codex, Cursor, Kimi Code, and OpenCode. It is compatible with OpenAI, Anthropic, and AWS Bedrock APIs.

Delegation Mode Decouples Harness from Model

A notable design is the delegation mode (ocr delegate preview/rule). In this mode, OpenCodeReview performs only the deterministic parts (file selection and rule parsing), while the actual review is done by the host coding agent's LLM. This means users do not need to provide an API key for OCR, effectively decoupling the harness capability from the model capability.

High Engineering Standards and Security Assurance

The project includes a formal Assurance Case (ASSURANCE_CASE.md) with a threat model, four trust boundaries, and mitigation for T1-T7 threats, mapped to Saltzer & Schroeder principles and OWASP Top 10. External process calls are limited to git with hardcoded subcommands and --end-of-options to prevent injection. File paths are double-validated after symlink resolution. Contribution guidelines (AGENTS.md) require disclosure of AI use, human understanding of AI-generated code, and ban AI attribution in commits. Code must be English-only with 90% test coverage and race detection.

Benchmark Shows Higher Precision but Lower Recall

The official benchmark AACR-Bench includes 50 popular open-source repos, 200 real PRs, 10 languages, and 1505 issues annotated by 80+ senior engineers. Compared to Claude Code, OpenCodeReview achieved significantly higher precision and F1, with token consumption about 1/9 and faster speed. However, recall is lower, which is a deliberate trade-off to reduce noise. The benchmark is self-built but the dataset is open for community verification.

Source posts