From ae065236952b231fb315d137292b1cc95b153b96 Mon Sep 17 00:00:00 2001 From: "marcin p. joachimiak" <4625870+realmarcin@users.noreply.github.com> Date: Thu, 19 Nov 2026 22:19:01 -0800 Subject: [PATCH] Preserve native review variants during restart baseline inventory --- .../restart-native-inventory-20261120.md | 50 ++++ .../audit_restart_native_reviews_20261120.py | 227 ++++++++++++++++++ .../summary.json | 33 +++ .../apply-summary.json | 27 +++ ...t_audit_restart_native_reviews_20261120.py | 145 +++++++++++ 5 files changed, 482 insertions(+) create mode 100644 docs/validation/restart-native-inventory-20261120.md create mode 100644 scripts/adhoc/audit_restart_native_reviews_20261120.py create mode 100644 scripts/adhoc/provenance/restart-native-inventory-20261120/summary.json create mode 100644 scripts/adhoc/provenance/restart-source-20261120/apply-summary.json create mode 100644 tests/test_audit_restart_native_reviews_20261120.py diff --git a/docs/validation/restart-native-inventory-20261120.md b/docs/validation/restart-native-inventory-20261120.md new file mode 100644 index 0000000..43c0dea --- /dev/null +++ b/docs/validation/restart-native-inventory-20261120.md @@ -0,0 +1,50 @@ +# Retained native-review inventory, 2026-11-20 + +The earlier filename shortlist omitted retained synthetic artifacts. The bounded +audit helper now records every supplied native-review path, preserves copied and +changed bytes separately, and reports direct assessment-to-target bindings using +the pinned CLAW document loader. It does not assign baseline membership or validate +scientific judgments. Issues #224 and #228 govern accounting and provenance. + +An ignored-inclusive two-root search retained 413,624 file locators, including +7,073 archive candidates and 871 `review.yaml` locators. Git internals, explicitly +named environment/cache directories and node_modules were excluded; symbolic +links were not followed. Retained test outputs were included. This filename +inventory does not establish complete archive coverage. Archive containers, +additional artifact formats, source/version bindings and baseline dispositions +remain to be reconciled. + +The actual bounded audit read and parsed all 871 supplied locators into 619 byte +variants with 120 declared review IDs. It flags 222 variants with explicit fixture +content, without automatically excluding them. A further 280 variants use two +historical readiness-review IDs and need test-provenance disposition; one minimal +document lacks declared timing. Counts describe retained files, not assessed +occurrences. A/B counts remain null, and new scientific coverage remains zero. + +Public [summary](../../scripts/adhoc/provenance/restart-native-inventory-20261120/summary.json) +binds the executed helper, private input list, per-locator readbacks and document +observations by SHA-256. Actual source bodies, source-input paths and invocation +bindings remain private. The helper stores only structural review observations; +literal evidence, article bodies and assessment prose are not copied to its report. +Missing, nonregular, malformed and changed inputs are never silently converted +into membership. The input-list pin does not attest prior review-byte versions; +fresh document hashes must still be compared with retained earlier inventories. + +The separate [source apply summary](../../scripts/adhoc/provenance/restart-source-20261120/apply-summary.json) +records one successful exclusive invocation of the exact independently reviewed +PR #232 helper. Its original private receipt is unchanged. The maintained census +replay is a separate operation; restoration does not verify census classifications +or establish science. No launcher or source mutation was rerun for this inventory. + +Validation on the final candidate: 1,504 full-suite tests passed in 198.82 seconds, +15 focused tests passed in 1.77 seconds, all 16 pinned contracts and CI-scope Ruff +passed, and offline source/wheel builds succeeded. Tests cover retained byte variants, partial engineering +judgments, prose-only mentions, orphan target bindings, fixture markers, cutoff +ambiguity, missing and malformed files, symlinks, input pins, failure readback and +refusal to overwrite results. Full-suite log SHA-256 is +`cf855a157f8d301580909d1424df3be2b741044066f7d25672340b036f109cd7`. +Two unsuccessful test invocations remain private: one used the wrong fulltext +fixture prefix, and the next omitted its parent directory. The corrected run used +a fresh durable fixture root; no code or live mutation changed for those repairs. +Independent engineering/publication review remains pending. This record grants +no scientific dispatch gate. diff --git a/scripts/adhoc/audit_restart_native_reviews_20261120.py b/scripts/adhoc/audit_restart_native_reviews_20261120.py new file mode 100644 index 0000000..2895ad5 --- /dev/null +++ b/scripts/adhoc/audit_restart_native_reviews_20261120.py @@ -0,0 +1,227 @@ +"""Inventory retained native review bytes without qualifying baseline membership. + +Date: 2026-11-20 UTC. Issues: #228 (helper/result provenance), #224 (full baseline). +Purpose: inspect every explicit native-review locator, retaining copies, byte +variants, malformed inputs, partial assessments and synthetic-content markers. +Inputs: private newline-delimited absolute paths with a SHA256 pin, proposed UTC +cutoff. Hidden/ignored search scope is supplied separately, never inferred here. +Outputs: exclusive private result directory with per-locator readbacks, per-byte +document observations and aggregate summary. No review bodies/quotes are copied. +Provenance: uses pinned CLAW load_document and maintained census._read_handle. +This is read-only preparation, not canonical validation, source-input replay, +exhaustive archive search, scientific approval or a frozen A/B population. +""" + +from __future__ import annotations + +import argparse +import hashlib +import json +import os +import re +from collections import Counter +from datetime import datetime, timezone +from pathlib import Path + +from kg_microbe_reviews import load_document + +from edgemech.census import _read_handle +from edgemech.pins import check_contracts + +MAX_BYTES = 16 * 1024 * 1024 +MAX_LOCATORS = 10_000 +OCCURRENCE = re.compile(r"urn:kg-microbe:occurrence:v1:[0-9a-f]{64}") + + +def digest(data): + return hashlib.sha256(data).hexdigest() + + +def read_bounded(path): + with _read_handle(path) as handle: + data = handle.read(MAX_BYTES + 1) + if len(data) > MAX_BYTES: + raise ValueError("input exceeds 16 MiB; retained as unresolved") + return data + + +def instant(value): + if not isinstance(value, str) or not re.fullmatch( + r"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|\+00:00)", value + ): + raise ValueError("expected an explicit UTC timestamp") + return datetime.fromisoformat(value.replace("Z", "+00:00")) + + +def timing(review, cutoff): + try: + start, finish = instant(review.get("started_at")), instant(review.get("finished_at")) + except (ValueError, TypeError): + return "unknown_or_incomplete_declared_timing" + if finish < start: + return "invalid_declared_time_order" + if start > cutoff: + return "declared_after_cutoff" + if finish > cutoff: + return "declared_straddles_cutoff" + return "declared_at_or_before_cutoff" + + +def mappings(value, label): + if not isinstance(value, list) or any(not isinstance(item, dict) for item in value): + raise ValueError(f"{label} must be a list of mappings; no silent omission") + return value + + +def observations(review, cutoff): + targets = mappings(review.get("targets", []), "targets") + assessments = mappings(review.get("assessments", []), "assessments") + target_ids = {row.get("target_id") for row in targets if isinstance(row.get("target_id"), str)} + occurrence_targets = {value for value in target_ids if OCCURRENCE.fullmatch(value)} + assessment_rows, assessed_ids, orphan_ids = [], set(), set() + for position, row in enumerate(assessments): + ids = row.get("target_ids", []) + if not isinstance(ids, list) or any(not isinstance(value, str) for value in ids): + raise ValueError("assessment target_ids must be strings; no silent omission") + exact_ids = {value for value in ids if OCCURRENCE.fullmatch(value)} + assessed_ids |= exact_ids & occurrence_targets + orphan_ids |= exact_ids - occurrence_targets + dimensions = mappings(row.get("dimensions", []), "assessment dimensions") + assessment_rows.append({ + "position": position, "assessment_id": row.get("assessment_id"), + "area": row.get("area"), "outcome": row.get("outcome"), "target_ids": ids, + "axis_and_category": [ + {"name": item.get("name"), "value": item.get("value")} + for item in dimensions if item.get("name") in {"axis", "category"} + ], + }) + source = review.get("source", {}) + reviewer = review.get("reviewer", {}) + if not isinstance(source, dict) or not isinstance(reviewer, dict): + raise ValueError("source and reviewer must be mappings") + inputs = mappings(source.get("inputs", []), "source inputs") + markers = [] + if reviewer.get("identity") == "Fixture": + markers.append("reviewer.identity equals Fixture") + if review.get("review_id") == "20000101T000000Z-fixture": + markers.append("known synthetic review_id declared in document") + if inputs and all(row.get("role") == "fixture input" for row in inputs): + markers.append("all source inputs explicitly declare fixture input role") + return { + "review_id": review.get("review_id"), "kind": review.get("kind"), + "repository": review.get("repository"), "skill": review.get("skill"), + "completion": review.get("completion"), "verdict": review.get("verdict"), + "scientific_review_declared": review.get("scientific_review"), + "started_at_declared": review.get("started_at"), + "finished_at_declared": review.get("finished_at"), + "timing": timing(review, cutoff), "synthetic_content_markers": markers, + "source_git_revision_declared": source.get("git_revision"), + "source_inputs_unverified": [ + {key: item.get(key) for key in ("path", "sha256", "role")} for item in inputs + ], + "declared_targets": [ + {key: item.get(key) for key in ("target_id", "kind", "path", "selector")} + for item in targets + ], + "assessment_rows": assessment_rows, + "declared_assessed_occurrence_ids": sorted(assessed_ids), + "orphan_assessment_occurrence_ids": sorted(orphan_ids), + "declared_occurrence_targets_without_assessments": sorted(occurrence_targets - assessed_ids), + "membership_disposition": "UNRESOLVED_NOT_QUALIFIED_BY_THIS_INVENTORY", + } + + +def audit(paths, cutoff): + locators, documents = [], {} + for position, path in enumerate(paths): + entry = {"position": position, "path": str(path)} + locators.append(entry) + try: + raw = read_bounded(path) + sha = digest(raw) + entry.update(sha256=sha, bytes=len(raw)) + if sha not in documents: + document = {"sha256": sha} + documents[sha] = document + try: + document.update(observations(load_document(raw), cutoff)) + document["status"] = "parsed_observations_only" + except Exception as error: + document.update(status="unresolved_parse_or_shape", error_type=type(error).__name__) + entry["status"] = documents[sha]["status"] + except Exception as error: + entry.update(status="unresolved_read", error_type=type(error).__name__) + status_counts = Counter(row["status"] for row in locators) + parsed = [row for row in documents.values() if row["status"] == "parsed_observations_only"] + return locators, sorted(documents.values(), key=lambda row: row["sha256"]), { + "locator_count": len(locators), "byte_variant_count": len(documents), + "locator_status_counts": dict(status_counts), + "distinct_declared_review_ids": len({row.get("review_id") for row in parsed + if isinstance(row.get("review_id"), str)}), + "variant_timing_counts": dict(Counter(row["timing"] for row in parsed)), + "variants_with_synthetic_content_markers": sum(bool(row["synthetic_content_markers"]) + for row in parsed), + "variants_with_orphan_assessment_ids": sum(bool(row["orphan_assessment_occurrence_ids"]) + for row in parsed), + "all_locators_read_and_parsed": all(row["status"] == "parsed_observations_only" + for row in locators), + "scientific_review_coverage": 0, "full_target_frozen": False, + "queue_A_count": None, "queue_B_count": None, + } + + +def write_json(path, value): + data = (json.dumps(value, indent=2, sort_keys=True, allow_nan=False) + "\n").encode() + with path.open("xb") as handle: + handle.write(data) + handle.flush() + os.fsync(handle.fileno()) + if read_bounded(path) != data: + raise ValueError("persisted output differs from authored bytes") + return digest(data) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--paths", type=Path, required=True) + parser.add_argument("--paths-sha256", required=True) + parser.add_argument("--cutoff", required=True) + parser.add_argument("--results", type=Path, required=True) + args = parser.parse_args() + cutoff = instant(args.cutoff) + raw = read_bounded(args.paths) + if digest(raw) != args.paths_sha256: + raise ValueError("locator inventory hash mismatch") + paths = [Path(line) for line in raw.decode("utf-8").splitlines()] + if not paths or len(paths) > MAX_LOCATORS or any(not path.is_absolute() for path in paths): + raise ValueError("require 1..10000 explicit absolute locators") + check_contracts() + args.results.mkdir(mode=0o700) + locators, documents, summary = audit(paths, cutoff) + summary.update({ + "completed_at_utc": datetime.now(timezone.utc).isoformat(), + "helper_sha256": digest(read_bounded(Path(__file__))), + "paths_sha256": digest(raw), "proposed_cutoff_utc": args.cutoff, + "locators_sha256": write_json(args.results / "locators.json", locators), + "documents_sha256": write_json(args.results / "documents.json", documents), + "status": "BOUNDED_NATIVE_OBSERVATIONS_BASELINE_RECONCILIATION_STILL_OPEN", + "limitations": [ + "Locator search scope is external; this is not an exhaustive archive search", + "Declared timing, source inputs and exact census membership need independent replay", + "Markers are retained observations, never automatic fixture exclusion", + "Partial/engineering/rejected observations remain; no scientific approval inferred", + "No canonical schema validation or source/evidence correctness asserted", + ], + }) + write_json(args.results / "summary.json", summary) + descriptor = os.open(args.results, os.O_RDONLY) + try: + os.fsync(descriptor) + finally: + os.close(descriptor) + print(json.dumps(summary, sort_keys=True)) + return 0 if summary["all_locators_read_and_parsed"] else 1 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/scripts/adhoc/provenance/restart-native-inventory-20261120/summary.json b/scripts/adhoc/provenance/restart-native-inventory-20261120/summary.json new file mode 100644 index 0000000..6ff3901 --- /dev/null +++ b/scripts/adhoc/provenance/restart-native-inventory-20261120/summary.json @@ -0,0 +1,33 @@ +{ + "all_locators_read_and_parsed": true, + "byte_variant_count": 619, + "completed_at_utc": "2026-11-20T05:58:07.394544+00:00", + "distinct_declared_review_ids": 120, + "documents_sha256": "87d4779ec447b4e6c520eb9e8ed464c1c374b8035d892f7e685a8a4b9615198f", + "full_target_frozen": false, + "helper_sha256": "e63d43b695f9d6e66645ff21131303a55ef0b6aad302cb8772694b634f2c8a95", + "limitations": [ + "Locator search scope is external; this is not an exhaustive archive search", + "Declared timing, source inputs and exact census membership need independent replay", + "Markers are retained observations, never automatic fixture exclusion", + "Partial/engineering/rejected observations remain; no scientific approval inferred", + "No canonical schema validation or source/evidence correctness asserted" + ], + "locator_count": 871, + "locator_status_counts": { + "parsed_observations_only": 871 + }, + "locators_sha256": "d40b19ddd73f50f0cbd0fadb0996f866ee3530e56219debdd9e86346ef05a33a", + "paths_sha256": "5ea37a4cfff117e5e2d5f447f55de7e2e1c92f25d0eff1fac858011f65c8b9a5", + "proposed_cutoff_utc": "2026-11-20T05:26:45Z", + "queue_A_count": null, + "queue_B_count": null, + "scientific_review_coverage": 0, + "status": "BOUNDED_NATIVE_OBSERVATIONS_BASELINE_RECONCILIATION_STILL_OPEN", + "variant_timing_counts": { + "declared_at_or_before_cutoff": 618, + "unknown_or_incomplete_declared_timing": 1 + }, + "variants_with_orphan_assessment_ids": 0, + "variants_with_synthetic_content_markers": 222 +} diff --git a/scripts/adhoc/provenance/restart-source-20261120/apply-summary.json b/scripts/adhoc/provenance/restart-source-20261120/apply-summary.json new file mode 100644 index 0000000..8cc6e59 --- /dev/null +++ b/scripts/adhoc/provenance/restart-source-20261120/apply-summary.json @@ -0,0 +1,27 @@ +{ + "scope": "Sanitized actual source-restoration result; private invocation and full receipt retained unchanged", + "date_utc": "2026-11-20", + "issues": [228, 231], + "reviewed_pr": "https://github.com/CultureBotAI/EdgeMech/pull/232", + "reviewed_executed_head": "e3d63b0984382b5df4f3f1ada23d66db99e1f54d", + "executed_helper_sha256": "a06782633c92ce8ce59957a0d65c371592e2bdafbd7ad6f52836f8bd4b9cdb37", + "actual_private_receipt_sha256": "337232466649ce8fa45fcec918e63c07f95956b338480bea1d42348a5c29f34a", + "status": "restored_source_bytes_verified_full_census_replay_pending", + "terminal_exit": 0, + "live_apply_attempts": 1, + "started_at_utc": "2026-11-20T05:51:54.515827+00:00", + "finished_at_utc": "2026-11-20T05:52:01.824713+00:00", + "member_count": 3, + "member_bytes": 3267015185, + "manifest_bytes": 4903, + "manifest_sha256": "f585e55a616d3771f382c91c78713cb8d74812c7ba177576090ccd5f9e6654b2", + "manifest_published_last": true, + "owner_head_and_preexisting_status_preserved": true, + "source_member_hashes_and_persisted_readback_verified": true, + "maintained_full_census_replay": "separate running verification at this checkpoint; no terminal verdict inferred", + "scientific_review_coverage": 0, + "full_target_frozen": false, + "queue_A_count": null, + "queue_B_count": null, + "merge_performed": false +} diff --git a/tests/test_audit_restart_native_reviews_20261120.py b/tests/test_audit_restart_native_reviews_20261120.py new file mode 100644 index 0000000..ee33592 --- /dev/null +++ b/tests/test_audit_restart_native_reviews_20261120.py @@ -0,0 +1,145 @@ +"""Baseline inventory must preserve uncertainty and never manufacture membership.""" + +import copy +import hashlib +import importlib.util +import json +import sys +from pathlib import Path + +import pytest + +ROOT = Path(__file__).resolve().parents[1] +SPEC = importlib.util.spec_from_file_location( + "native_inventory", ROOT / "scripts/adhoc/audit_restart_native_reviews_20261120.py" +) +helper = importlib.util.module_from_spec(SPEC) +SPEC.loader.exec_module(helper) +ID = "urn:kg-microbe:occurrence:v1:" + "a" * 64 +OTHER = "urn:kg-microbe:occurrence:v1:" + "b" * 64 +CUTOFF = helper.instant("2026-11-20T05:26:45Z") + + +@pytest.fixture +def review(): + return { + "review_id": "retained-partial", "started_at": "2026-11-19T00:00:00Z", + "finished_at": "2026-11-19T00:01:00Z", "completion": "partial", + "scientific_review": False, "reviewer": {"identity": "historical author"}, + "source": {"inputs": [{"path": "packet.json", "sha256": "c" * 64, "role": "target"}]}, + "targets": [{"target_id": ID, "kind": "snapshot_row"}], + "assessments": [{"assessment_id": "partial", "outcome": "unknown", "target_ids": [ID]}], + "evidence": [{"summary": "Mention only: " + OTHER}], + } + + +def save(path, review): + path.write_text(json.dumps(review)) + return path + + +def test_copies_and_changed_bytes_with_same_review_id_all_survive(tmp_path, review): + paths = [save(tmp_path / name, review) for name in ("first", "copy")] + revised = copy.deepcopy(review) + revised["assessments"][0]["outcome"] = "concern" + paths.append(save(tmp_path / "changed", revised)) + locators, documents, summary = helper.audit(paths, CUTOFF) + assert len(locators) == 3 and len(documents) == 2 + assert locators[0]["sha256"] == locators[1]["sha256"] != locators[2]["sha256"] + assert summary["distinct_declared_review_ids"] == 1 + assert {row["assessment_rows"][0]["outcome"] for row in documents} == {"unknown", "concern"} + + +def test_partial_engineering_and_unknown_outcome_are_observed_without_membership(review): + result = helper.observations(review, CUTOFF) + assert result["completion"] == "partial" and result["scientific_review_declared"] is False + assert result["declared_assessed_occurrence_ids"] == [ID] + assert result["membership_disposition"].startswith("UNRESOLVED") + assert OTHER not in result["declared_assessed_occurrence_ids"] + + +def test_orphan_targets_and_population_mentions_never_become_bound_assessments(review): + review["scope"] = {"reviewed_target_ids": [OTHER], "population_size": 17_637_435} + review["targets"].append({"target_id": OTHER}) + orphan = "urn:kg-microbe:occurrence:v1:" + "d" * 64 + review["assessments"].append({"target_ids": [orphan]}) + result = helper.observations(review, CUTOFF) + assert result["declared_assessed_occurrence_ids"] == [ID] + assert result["orphan_assessment_occurrence_ids"] == [orphan] + assert result["declared_occurrence_targets_without_assessments"] == [OTHER] + + +def test_fixture_content_is_flagged_even_in_nonfixture_filename_and_not_auto_excluded(review): + review["reviewer"]["identity"] = "Fixture" + review["review_id"] = "20000101T000000Z-fixture" + review["source"]["inputs"][0]["role"] = "fixture input" + result = helper.observations(review, CUTOFF) + assert len(result["synthetic_content_markers"]) == 3 + assert result["declared_assessed_occurrence_ids"] == [ID] + assert result["membership_disposition"].startswith("UNRESOLVED") + + +@pytest.mark.parametrize(("start", "finish", "expected"), [ + ("2026-11-19T00:00:00Z", "2026-11-20T05:26:45Z", "declared_at_or_before_cutoff"), + ("2026-11-20T06:00:00Z", "2026-11-20T06:01:00Z", "declared_after_cutoff"), + ("2026-11-19T00:00:00Z", "2026-11-20T06:00:00Z", "declared_straddles_cutoff"), + ("2026-11-19T00:00:00Z", None, "unknown_or_incomplete_declared_timing"), + ("2026-11-19T00:00:00Z", "2026-11-18T00:00:00Z", "invalid_declared_time_order"), + ("2026-11-19T00:00:00Z", "2026-11-19T00:01:00", "unknown_or_incomplete_declared_timing"), +]) +def test_cutoff_never_guesses_from_filename_or_missing_timezone(review, start, finish, expected): + review.update(started_at=start, finished_at=finish) + assert helper.observations(review, CUTOFF)["timing"] == expected + + +def test_missing_and_duplicate_key_inputs_are_retained_as_errors(tmp_path): + duplicate = tmp_path / "duplicate.yaml" + duplicate.write_text("review_id: first\nreview_id: replaced\n") + locators, documents, summary = helper.audit([tmp_path / "missing", duplicate], CUTOFF) + assert [row["status"] for row in locators] == ["unresolved_read", "unresolved_parse_or_shape"] + assert len(documents) == 1 and not summary["all_locators_read_and_parsed"] + assert summary["queue_A_count"] is None and summary["queue_B_count"] is None + + +def test_symlink_is_not_followed(tmp_path, review): + path = save(tmp_path / "review", review) + link = tmp_path / "link" + link.symlink_to(path) + locators, documents, summary = helper.audit([link], CUTOFF) + assert locators[0]["status"] == "unresolved_read" + assert documents == [] and not summary["all_locators_read_and_parsed"] + + +def test_malformed_assessment_shape_is_not_silently_discarded(tmp_path, review): + review["assessments"] = {"lost": "assessment"} + locators, _, summary = helper.audit([save(tmp_path / "review", review)], CUTOFF) + assert locators[0]["status"] == "unresolved_parse_or_shape" + assert not summary["all_locators_read_and_parsed"] + + +def test_main_retains_error_readback_and_never_overwrites_results(tmp_path, monkeypatch): + paths = tmp_path / "paths.txt" + paths.write_text(str(tmp_path / "absent") + "\n") + result = tmp_path / "results" + monkeypatch.setattr(helper, "check_contracts", lambda: None) + monkeypatch.setattr(sys, "argv", [ + "audit", "--paths", str(paths), "--paths-sha256", hashlib.sha256(paths.read_bytes()).hexdigest(), + "--cutoff", "2026-11-20T05:26:45Z", "--results", str(result), + ]) + assert helper.main() == 1 + before = (result / "summary.json").read_bytes() + assert json.loads(before)["locator_status_counts"] == {"unresolved_read": 1} + with pytest.raises(FileExistsError): + helper.main() + assert (result / "summary.json").read_bytes() == before + + +def test_bad_inventory_pin_fails_before_output_creation(tmp_path, monkeypatch): + paths = tmp_path / "paths.txt" + paths.write_text(str(tmp_path / "absent") + "\n") + result = tmp_path / "results" + monkeypatch.setattr(sys, "argv", ["audit", "--paths", str(paths), "--paths-sha256", "f" * 64, + "--cutoff", "2026-11-20T05:26:45Z", "--results", str(result)]) + with pytest.raises(ValueError, match="hash mismatch"): + helper.main() + assert not result.exists()