Open Code Review (OCR) is an AI-powered code review CLI tool designed to identify code defects with high precision README.md35-37 Originally developed as an internal tool within Alibaba Group, it has been validated at scale across tens of thousands of developers and millions of code review tasks README.md37-40
OCR differentiates itself from general-purpose AI agents by utilizing a Hybrid Deterministic + Agent architecture. This design combines rigid engineering constraints—for file selection, positioning, and rule matching—with the dynamic reasoning capabilities of Large Language Models (LLMs) README.md75-77
Sources: README.md35-77
ocr scan README.md132-151Sources: README.md41-160 internal/config/rules/system_rules.go89-115
The core philosophy of OCR is "Deterministic Engineering × Agent Hybrid" README.md75-77
Engineering logic handles tasks where correctness is non-negotiable:
The agent layer handles semantic understanding and exploration:
FileRead, CodeSearch, etc.) distilled from large-scale production data README.md93-95Sources: README.md75-95
Title: "OCR High-Level Pipeline"
Sources: pages/src/content/docs/ru/architecture.md14-25 pages/src/content/docs/ja/architecture.md11-22 pages/src/content/docs/zh/architecture.md12-23 pages/src/content/docs/en/architecture.md14-25
Title: "OCR Subsystem Relationship"
Sources: README.md75-95 internal/config/rules/system_rules.go89-115 internal/agent/selection.go1-50 pages/src/content/docs/en/architecture.md27-35
| Subsystem | Responsibility | Key Code Entities |
|---|---|---|
| Review Agent | Orchestrates the end-to-end review pipeline, including task splitting and concurrency README.md84 | internal/agent.Agent, internal/agent.Agent.Run, internal/agent.subTask |
| LLM Layer | Abstracts different providers (OpenAI, Anthropic, etc.) and handles protocol translation README.md122-124 | internal/llm/client.Client, internal/llm/provider.Registry, internal/llm/client.ResolveEndpoint |
| Rule Engine | Matches files to language-specific best practices using glob patterns and brace expansion README.md85 | internal/config/rules.Resolver, internal/config/rules.SystemRule, internal/agent/selection.FileFilter |
| Tool Registry | Provides the Agent with capabilities to "see" the codebase beyond the diff README.md93-95 | internal/tool.Registry, internal/tool.FileRead, internal/tool.CodeSearch, internal/tool.FileReadDiff |
| Session Manager | Persists review results to JSONL for later viewing and resumption README.md147-148 | internal/session.History, internal/session.TaskRecord, internal/session.FileSession |
Sources: README.md84-148
Title: "Data Flow From Git Diff to Review Comment"
Sources: README.md41-42 internal/config/rules/system_rules.go89-115 pages/src/content/docs/en/architecture.md27-35
For detailed technical information, please refer to the following child pages:
review, scan, config, llm, rules, delegate, and viewer README.md132-159 For details, see CLI Command Reference.Sources: README.md108-160
Refresh this wiki
This wiki was recently refreshed. Please wait 6 days to refresh again.