geno_lewm.cli.verify¶
verify
¶
geno-lewm-verify CLI — checksum-mode receipt verifier (RFC-0011).
The CLI takes a receipt JSON path and validates the receipt against a local manifest. Three checks compose the v1 protocol:
- Receipt schema —
read_receiptalready raises :class:ReceiptSchemaErroron a malformed receipt. - Manifest hash — recompute
model_idfrom the manifest and compare against the receipt'smodel_id. Mismatch raises :class:ManifestHashMismatchError. - Input commitment — if the caller passes
--input-windowplus the edit / pool / dtype flags, recompute the commitment and compare. Mismatch raises :class:InputCommitmentMismatchError. -
Output commitment — recompute the output commitment from the receipt's
outputblock and compare against the storedoutput_commitment. Mismatch raises :class:OutputCommitmentMismatchError. -
Bit-exact re-inference (
--rerun) — load the deploy runtime from--model-dir, re-score the receipt's input (passed via--input-window+--edit-{chrom,pos,ref,alt}), recompute the output commitment, and require it to match the receipt bit-for-bit. Mismatch raises :class:OutputCommitmentMismatchError. This proves the receipt describes output the model actually produces, not merely that the receipt is internally self-consistent.
Exit codes follow RFC-0012 / docs/spec/04-error-model.md:
- 0 — verification passed.
- 2 —
InputError(bad CLI args). - 3 —
ConfigError(e.g. manifest schema mismatch). - 8 — any
ProvenanceErrorsubclass (the main failure mode). - 1 — uncategorized.
verify
¶
Run the verification protocol; raise on any failure.
Side effect: writes a human-readable progress line per check to
stream (defaults to sys.stdout resolved at call time, not
at import time — so a pytest-captured stdout works without
snapshot churn).