Open Code Review (OCR) — Session viewer

docs / modules / viewer

← all docs

Open Code Review (OCR) — Session viewer

flowchart LR IN["Input\na session's persisted JSONL + manifest"] --> ACT["Session viewer\nA local-only web UI (`ocr viewer`) for browsing a past review session — comments, timeline, token usage — without re-running anything."] ACT --> OUT["Output\nrendered HTML pages served over local HTTP"]

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

flowchart LR IN["a session's persisted JSONL + manifest"] --> MOD["Session viewer"] MOD --> OUT["rendered HTML pages served over local HTTP"]

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.