From 73ececbc473cdfbe14a81407880869ec39b41281 Mon Sep 17 00:00:00 2001 From: ai-hpc Date: Sun, 2 Aug 2026 01:46:31 +0000 Subject: [PATCH 1/2] test: name the cross-repo dependency instead of failing on it `test_capture_produces_a_valid_sorted_snapshot` imports `cathedral.score_class`. `cathedral` is the cathedral-compute package, not this one, and nothing in this repository declares it -- so on a checkout of this repository alone the import raises ModuleNotFoundError and this test is the entire suite's only failure: 1501 passed, 22 skipped, 1 failed ModuleNotFoundError: No module named 'cathedral' To anyone reviewing the repo that reads as a product defect, which is exactly what it is not. `pytest.importorskip` names the reason instead: the cross-repo half of the assertion still runs wherever both packages are installed, and explains itself where they are not. The skip is taken partway through the test, so everything above it -- the capture itself, the sorted hotkeys, the block hash, and that the hash is queried for EXACTLY the captured block -- is asserted either way. Only the confidential exporter's acceptance of the document needs the other package. Verified: 1501 passed, 23 skipped, 0 failed on a checkout of this repository alone. Co-Authored-By: Claude Opus 5 (1M context) --- .../publisher/tests/test_snapshot_candidates.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scaffold/publisher/tests/test_snapshot_candidates.py b/scaffold/publisher/tests/test_snapshot_candidates.py index 029c4404..f90c1f1c 100644 --- a/scaffold/publisher/tests/test_snapshot_candidates.py +++ b/scaffold/publisher/tests/test_snapshot_candidates.py @@ -67,7 +67,19 @@ def test_capture_produces_a_valid_sorted_snapshot(): assert fake.hash_calls == [123] # The confidential exporter accepts the captured document verbatim. - from cathedral.score_class import validate_candidate_snapshot + # + # `cathedral` is the cathedral-compute package, not this one, and nothing here + # declares it -- so on a checkout of this repository alone the import raised + # ModuleNotFoundError and this test was the whole suite's only failure. That + # reads as a product defect to anyone reviewing the repo, which is exactly what + # it is not. Skipping names the reason instead: the cross-repo half of this + # assertion runs where both packages are installed, and explains itself where + # they are not. Everything above this line is asserted either way. + validate_candidate_snapshot = pytest.importorskip( + "cathedral.score_class", + reason="needs the cathedral-compute package (which provides `cathedral`) " + "installed alongside this one", + ).validate_candidate_snapshot binding = validate_candidate_snapshot(document, network="finney", netuid=39) assert binding["block"] == 123 From 87aca896aaef00b1073759b7e2500fd8beab5497 Mon Sep 17 00:00:00 2001 From: Fred E <7602667+wallscaler@users.noreply.github.com> Date: Sun, 2 Aug 2026 04:24:38 -0400 Subject: [PATCH 2/2] test: keep snapshot contract required in CI Run the candidate snapshot contract in the hash-locked two-mode gate while preserving an explanatory standalone skip when cathedral-compute is not installed. --- .github/workflows/two-mode-provenance.yml | 2 ++ .../publisher/tests/test_snapshot_candidates.py | 15 +++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/two-mode-provenance.yml b/.github/workflows/two-mode-provenance.yml index 6fbe64ff..b2847268 100644 --- a/.github/workflows/two-mode-provenance.yml +++ b/.github/workflows/two-mode-provenance.yml @@ -115,12 +115,14 @@ jobs: # close can make pytest report BrokenPipe and fail a valid gate. run: | "$SN39_VENV/bin/python" -m pytest \ + scaffold/publisher/tests/test_snapshot_candidates.py \ scaffold/publisher/tests/test_validator_two_mode.py \ scaffold/publisher/tests/test_validator_thin_validated_supply.py \ scaffold/publisher/tests/test_validator_lifecycle.py \ --collect-only -q | grep test_full_path_positive_revoked_restored \ >/dev/null "$SN39_VENV/bin/python" -m pytest -q \ + scaffold/publisher/tests/test_snapshot_candidates.py \ scaffold/publisher/tests/test_sn39_continuous_authorization.py \ scaffold/publisher/tests/test_sn39_launch_approval.py \ scaffold/publisher/tests/test_validator_two_mode.py \ diff --git a/scaffold/publisher/tests/test_snapshot_candidates.py b/scaffold/publisher/tests/test_snapshot_candidates.py index f90c1f1c..80a04194 100644 --- a/scaffold/publisher/tests/test_snapshot_candidates.py +++ b/scaffold/publisher/tests/test_snapshot_candidates.py @@ -68,17 +68,16 @@ def test_capture_produces_a_valid_sorted_snapshot(): # The confidential exporter accepts the captured document verbatim. # - # `cathedral` is the cathedral-compute package, not this one, and nothing here - # declares it -- so on a checkout of this repository alone the import raised - # ModuleNotFoundError and this test was the whole suite's only failure. That - # reads as a product defect to anyone reviewing the repo, which is exactly what - # it is not. Skipping names the reason instead: the cross-repo half of this - # assertion runs where both packages are installed, and explains itself where - # they are not. Everything above this line is asserted either way. + # `cathedral` is the cathedral-compute package, not this one. The base test + # extra does not install it, so a standalone checkout skips only this + # cross-repository assertion. Required two-mode CI installs the provenance + # extra, imports cathedral explicitly, and includes this file. That keeps the + # contract mandatory on the launch path while preserving a useful standalone + # test suite. Everything above this line is asserted in both environments. validate_candidate_snapshot = pytest.importorskip( "cathedral.score_class", reason="needs the cathedral-compute package (which provides `cathedral`) " - "installed alongside this one", + "installed alongside this one", ).validate_candidate_snapshot binding = validate_candidate_snapshot(document, network="finney", netuid=39)