coverage.validity¶
Report-time validity for pinned manual captures (spec §7).
Anchor chain per file: blob fast-path → blob diff → pin diff → unverifiable (whole file stale, loud warning). Valid lines are loaded into the store under the capture’s tier; stale lines are marked but carry no hits; aging marks valid-but-old manual evidence.
- otto.coverage.validity.load_capture_into_store(store: CoverageStore, capture: Capture, repo_root: Path) None¶
Fold a pin==HEAD (e2e-kind) capture into store verbatim.
The caller has already verified
capture.pinequals the tree’s HEAD, so the capture’s pin coordinates are the current-worktree coordinates and no anchor chain / remap is needed. Unlikeapply_manual_capture()this sets no validity states and appends no provenance — an automated capture carries no human session to attribute.
- otto.coverage.validity.load_dirty_capture_into_store(store: CoverageStore, capture: Capture, repo_root: Path) None¶
Fold a pin==HEAD e2e capture in, remapping HEAD → dirty working tree.
An e2e capture carries no anchor chain: its coordinates are the exact
pincommit’s line numbers. The caller has verifiedcapture.pinequals HEAD, but when the working tree is dirty the renderer reads the edited on-disk source, so a verbatim insert (load_capture_into_store()) would misalign every hit past a local edit. Remap each file’s line/branch numbers from HEAD (OLD) to the working tree (NEW) using the same-U0worktree diff +LineRemapperthe manual anchor chain uses; hits on locally-modified lines have no NEW counterpart and are dropped.