coverage.validity¶
Report-time validity for manual captures anchored to base_commit (spec §7).
Anchor resolution per capture: one tree-wide diff (AnchorResolver)
answers every file, following renames to their new path; when base_commit
itself is unresolvable (GC’d/shallow), each file falls back to the per-file
blob chain (fast-path blob match → blob 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.register_capture_run(store: CoverageStore, capture: Capture) int¶
Register one capture as a run; returns its run id.
The chip label prefers the host display name, then the board (host id) —
add_runitself falls back to the tier name, which only synthetic runs use.
-
otto.coverage.validity.load_capture_into_store(store: CoverageStore, capture: Capture, repo_root: Path, run_id: int | None =
None) None¶ Fold a base_commit==HEAD (e2e-kind) capture into store verbatim.
The caller has already verified
capture.base_commitequals the tree’s HEAD, so the capture’s coordinates are the current-worktree coordinates and no anchor chain / remap is needed. Unlikeapply_manual_capture()this sets no validity states — an automated capture carries no human session to attribute.
-
otto.coverage.validity.load_dirty_capture_into_store(store: CoverageStore, capture: Capture, repo_root: Path, run_id: int | None =
None) None¶ Fold a base_commit==HEAD e2e capture in, remapping HEAD → dirty working tree.
An e2e capture carries no anchor chain: its coordinates are the exact
base_commit’s line numbers. The caller has verifiedcapture.base_commitequals 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.