Open Code Review (OCR) — Scan agent
Runs ocr scan: review whole files (no git diff needed) — for auditing unfamiliar code or directories without a meaningful diff. Package: internal/scan/.
What flows through it
Technical details
Package: internal/scan/
Depends on: config_rules, llmloop, tool, session, llm, agent
Depended on by: CLI
What actually happens here
scan.Agent enumerates files under RepoDir or --path into []model.ScanItem (whole file content, not a diff), then reuses the exact same llmloop.Runner the review agent uses (toLoopTemplate maps ScanTemplate onto the loop's template.Template fields). Adds two phases review mode doesn't have: an optional per-batch DEDUP_TASK and a post-run PROJECT_SUMMARY_TASK, both individually disableable via --no-dedup/--no-summary.
How the LLM / model version is chosen
Same Args.Model/Provider pattern as review — one model for the whole run, set by the CLI from the resolved endpoint.
Deterministic (non-LLM) work in this module
File enumeration and size filtering (MaxFileSizeBytes, default 2 MiB), toLoopTemplate's field mapping, and dispatch/budget gating mirror agent's — AI involvement is the plan phase, main loop, dedup task and project-summary task, each individually toggleable.
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.