test: gate V1 side files and V3 legacy receipts; early output rejection
- analyze_jet_cv_continuation: samples are analyzed only if the sibling re*_s*.json receipt is the same case with run_status COMPLETE and source_recheck UNCHANGED; receipts without run_status (pre-recheck runners) are refused unless --legacy-receipts, and labelled LEGACY_NO_FINAL_SOURCE_RECHECK. Results carry receipt_gate. - V3: receipts are schema 2 and need source_recheck UNCHANGED; a missing recheck is accepted only for frozen-mode schema 1 receipts whose run_case.py hash is one of the pre-recheck runners (9805383,2cf9853, db3d098; hashes checked against git history in a test). - V1/V3 refuse --output inside the checkout before source checks or CUDA (shared source_provenance.reject_output_inside). - A failing recheck is recorded as RECHECK_FAILED (still invalid); the in-run V1 receipt write is tmp+replace. Negative host tests for each gate. No threshold, solver or evidence edits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
df0f586331
commit
36ffc8b1b2
9 files changed
+185
-33
No files matched your search
@@ -126,5 +126,14 @@ def test_final_source_check_unchanged_changed_and_failed_recheck():
|
||||
raise RuntimeError("Source hash mismatch: src/x.py")
|
||||
|
||||
failed = final_source_check(recorded, fails)
|
||||
assert (failed["source_recheck"], failed["source_after"]) == ("CHANGED", None)
|
||||
assert (failed["source_recheck"], failed["source_after"]) == ("RECHECK_FAILED", None)
|
||||
assert "Source hash mismatch" in failed["source_recheck_error"]
|
||||
|
||||
|
||||
def test_reject_output_inside_checkout(tmp_path):
|
||||
from source_provenance import reject_output_inside
|
||||
|
||||
for output in (ROOT, ROOT / "out", ROOT / "src" / "x.json"):
|
||||
with pytest.raises(SystemExit, match="outside the source checkout"):
|
||||
reject_output_inside(output, ROOT)
|
||||
reject_output_inside(tmp_path / "out", ROOT)
|
||||
Reference in new issue
Block a user