Open Code Review (OCR) — Delegate

docs / modules / delegate

← all docs

Open Code Review (OCR) — Delegate

flowchart LR IN["Input\nthe same rule/file-selection engine as review/scan (rules.Resolver, FileFilter)"] --> ACT["Delegate\nPowers ocr delegate: OCR does file selection and rule resolution only; the user's own coding agent (Claude Code, Codex, Cursor) performs the actual review with its own model."] ACT --> OUT["Output\nMarkdown-rendered rule groups + a resolved file list — handed to the caller, not to an LLM"]

Powers ocr delegate: OCR does file selection and rule resolution only; the user's own coding agent (Claude Code, Codex, Cursor) performs the actual review with its own model. Package: internal/delegate/.

What flows through it

flowchart LR IN["the same rule/file-selection engine as review/scan (rules.Resolver, FileFilter)"] --> MOD["Delegate"] MOD --> OUT["Markdown-rendered rule groups + a resolved file list — handed to the caller, not to an LLM"]

Technical details

Package: internal/delegate/ Depends on: config_rules Depended on by: CLI

What actually happens here

rulegroup.go groups files by which rule text applies to them (RuleGroupsMarkdown renders each group's applicable files + rule content as a Markdown section); delegate_cmd.go exposes this as ocr delegate preview (file/rule discovery) and ocr delegate rule <paths> (rule text for specific files). This is the one review-producing code path in OCR that never constructs an llm.LLMClient or calls CompletionsWithCtx.

How the LLM / model version is chosen

No model calls — explicitly, by design. This is the mechanism by which OCR can run with zero OCR-managed API key or LLM config: the review judgment happens inside whatever coding agent the user already has running.

Deterministic (non-LLM) work in this module

100% of this package: rule-group formation and Markdown rendering are plain string/slice logic reusing the same deterministic resolver as review/scan.


Part of the module docs index. Full interactive version, with every module side by side: architecture.html §7. Cross-cutting mechanisms this module participates in (retry, compression, manifest, resume, hashing): LLD.