Open Code Review (OCR) — Session & manifest

docs / modules / session

← all docs

Open Code Review (OCR) — Session & manifest

flowchart LR IN["Input\nper-task LLM request/response records, per-item completion/failure events"] --> ACT["Session & manifest\nThe audit trail: what was reviewed, what was skipped, why, and what a --resume run can safely reuse."] ACT --> OUT["Output\na resumable JSONL history + an immutable RunManifest (coverage snapshot)"]

The audit trail: what was reviewed, what was skipped, why, and what a --resume run can safely reuse. Package: internal/session/.

What flows through it

flowchart LR IN["per-task LLM request/response records, per-item completion/failure events"] --> MOD["Session & manifest"] MOD --> OUT["a resumable JSONL history + an immutable RunManifest (coverage snapshot)"]

Technical details

Package: internal/session/ Depends on: llm Depended on by: CLI, LLM loop (Runner), Review agent, Scan agent, Session viewer

What actually happens here

history.go opens one JSONL file per run and appends TaskRecords (prompt, response, tool results) as the review progresses. manifest.go's ManifestBuilder is a strict state machine — RegisterSelected/SealSelected freezes the coverage denominator before any dispatch, then every item must transition through exactly one of MarkCompleted/MarkReused/MarkFailed before Finalize, or Finalize's validation catches the gap. resume.go matches a prior run's completed items to the current run by a content fingerprint (mode + paths + diff text, SHA-256), never by file path alone.

How the LLM / model version is chosen

No model calls — this package only records what other packages' model calls produced.

Deterministic (non-LLM) work in this module

All of it — this is the deterministic bookkeeping layer the architecture explicitly separates from the AI-driven review packages above it.


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.