Open Code Review (OCR) — Session viewer
A local-only web UI (ocr viewer) for browsing a past review session — comments, timeline, token usage — without re-running anything. Package: internal/viewer/.
What flows through it
Technical details
Package: internal/viewer/
Depends on: session
Depended on by: CLI
What actually happens here
server.go starts an http.Server bound to localhost by default; hostguard.go enforces a Host-header allowlist (OCR_VIEWER_ALLOWED_HOSTS to widen it) specifically to block DNS-rebinding attacks against the local server, and securityheaders.go adds a strict CSP plus the standard clickjacking/sniffing headers to every response. handler.go / store.go load a session's JSONL and render it through html/template (auto-escaping, so no session content — including anything an LLM wrote — can inject markup).
How the LLM / model version is chosen
No model calls — purely a read/render layer over already-persisted session data.
Deterministic (non-LLM) work in this module
The entire viewer is deterministic: host allowlist checks, header injection, and template rendering. This is also where the ASSURANCE_CASE.md's XSS mitigation (html/template auto-escaping + CSP) actually lives.
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.