test: check pinned source manifests against their own commits

Historical-evidence pins (dfg_re100 / jet_circle_cv / refined_dfg manifests)
now compare each recorded digest with the file at the recorded commit, read
with git, instead of with today's working tree. Missing history (no git,
shallow clone, installed copy) raises HistoryUnavailable and the test is
reported as skipped with that reason, never passed. Receipt/plan logic tests
take the selected manifest directly, so their assertions run again; the
pinned modes' mismatch rejections stay as negative controls.

V1 (run_jet_circle_cv) keeps its pinned mode and gains --current-checkout:
it records HEAD, the src tree and per-file hashes labelled as current
checkout, never as the frozen qualification, and requires a clean tree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-10-20 18:15:50 +00:00
1 parent 750e8a483e
commit 941eb28b79
6 files changed
+161 -26

No files matched your search

+6 -2
View File
@@ -67,8 +67,12 @@ def test_production_unmodified():
(ROOT / "tests/validation/data/dfg_re100/source_manifest.json").read_text()
)
assert m["commit"] == h.PIN
for name, digest in m["production_sha256"].items():
assert hashlib.sha256((ROOT / name).read_bytes()).hexdigest() == digest, name
from source_provenance import HistoryUnavailable, historical_sha256
try: # the manifest certifies its own commit, not today's working tree
actual = historical_sha256(ROOT, m["commit"], m["production_sha256"])
except HistoryUnavailable as error:
pytest.skip(f"historical integrity NOT checked: {error}")
assert actual == m["production_sha256"]
def test_reference():