Skip to content

Commit bb550d4

Browse files
frawarecursoragent
andcommitted
Add canonical RC import/render gate tests with pcs-core drift enforcement.
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 0108451 commit bb550d4

11 files changed

Lines changed: 144 additions & 126 deletions

.github/workflows/corpus-validation.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,11 @@ jobs:
6262
PCS_CORE_PATH: ${{ github.workspace }}/pcs-core
6363
run: bash scripts/run_pcs_tests.sh
6464

65-
- name: Fail if labtrust-release fixtures drift from pcs-core RC
65+
- name: PCS canonical RC gate (fixture drift + strict import + render)
6666
if: hashFiles('pcs-core/examples/labtrust-release/**') != ''
6767
env:
6868
PCS_CORE_PATH: ${{ github.workspace }}/pcs-core
69-
run: |
70-
uv run pytest tests/pcs/test_canonical_rc.py::test_scimem_signed_bundle_fixture_matches_pcs_core_rc -q
69+
run: uv run pytest tests/pcs/test_canonical_rc.py -q
7170

7271
- name: Run PCS live integration (pcs-core)
7372
if: hashFiles('pcs-core/python/**') != ''

JUSTFILE

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,10 @@ mcp-server:
205205
metrics *ARGS:
206206
uv run --project pipeline python -m sm_pipeline.cli metrics {{ARGS}}
207207

208+
# Canonical RC gate (fixture drift + strict import + render); requires pcs-core checkout
209+
pcs-rc-gate:
210+
bash scripts/sm_python.sh -m pytest tests/pcs/test_canonical_rc.py -q
211+
208212
# PCS LabTrust v0.1 (positional args; optional defaults on pcs-v01-clean-chain-sm)
209213
# just pcs-import-bundle tests/pcs/fixtures/labtrust-release/signed_science_claim_bundle.json
210214
# just pcs-render-claim claim-pcs-qc-release-v0.1

corpus/pcs/claims/claim-pcs-qc-release-v0.1/scientific_memory_import_report.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
"allow_legacy": false,
33
"bundle_shape": "pcs_core",
44
"claim_id": "claim-pcs-qc-release-v0.1",
5-
"imported_at": "2026-05-17T16:31:10Z",
5+
"imported_at": "2026-05-17T16:45:30Z",
66
"render_path": "/pcs/claims/claim-pcs-qc-release-v0.1",
7-
"scientific_memory_commit": "5b4b81049b430d1b59ff5b51f688eb0feaeef76c",
7+
"scientific_memory_commit": "01084512c1522a1e0df4334a1b304d1e7da076f7",
88
"source_bundle_path": "C:\\Users\\mateo\\scientific-memory\\tests\\pcs\\fixtures\\labtrust-release\\signed_science_claim_bundle.json",
99
"stale_artifacts": [],
1010
"strict": true,
1111
"verification_status": "passed",
1212
"warnings": [],
13-
"source_commit": "5b4b81049b430d1b59ff5b51f688eb0feaeef76c",
13+
"source_commit": "01084512c1522a1e0df4334a1b304d1e7da076f7",
1414
"source_repo": "https://github.com/fraware/scientific-memory"
1515
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"schema_version": "v0",
33
"release_candidate": "pcs-v0.1.0-rc1",
4-
"generated_at": "2026-05-17T16:27:23Z",
5-
"pcs_core_commit": "5bdffe6c6b59a3fca1b17aa907419c03ddc63448",
4+
"generated_at": "2026-05-17T16:43:03Z",
5+
"pcs_core_commit": "8caca0e2c7a20d8c8e9496e9b6d4f25d6a8faa66",
66
"labtrust_gym_commit": "4c5439ae358733f9a4c4a58e33fdaed1ab0d29de",
77
"certifyedge_commit": "cb6848001e2e60a484e04eba5ad6be3fe2e4eccc",
88
"provability_fabric_commit": "0f659b90c80c46a6bbfd51b0d37ea723b032fb9d",
9-
"scientific_memory_commit": "5b4b81049b430d1b59ff5b51f688eb0feaeef76c",
9+
"scientific_memory_commit": "01084512c1522a1e0df4334a1b304d1e7da076f7",
1010
"artifacts": {
1111
"trace.json": "sha256:f99eb0a90cd2b9819816a25ec4e938663d26ae8d40868cd8188665e940f7ad5c",
1212
"runtime_receipt.json": "sha256:8e642b59657d70b408be354323006421b963bb0c9fc9514f6abc7aab305345b6",
@@ -15,6 +15,6 @@
1515
"science_claim_bundle.certified.json": "sha256:9b42d792199eb6f358d26f822699f0ed65bb4366eee306d4958d42121c656833",
1616
"verification_result.json": "sha256:3b4b1215b4be6a945c3b99bb548e33a08527981290e7be1ab1da52b67ad8ba14",
1717
"signed_science_claim_bundle.json": "sha256:d0ab55f964227c1350b29fe359dcaf61d04ad6b7dfcf1db351b717e1c47aab43",
18-
"scientific_memory_import_report.json": "sha256:4928363620ad3847e92be95bd7e024ac28c425657fd180d2e4e5e585ad289bc5"
18+
"scientific_memory_import_report.json": "sha256:6d564fd38d09b47fa14833ec5346d2f7d56b6d5a4c0dc1c3ff1eb55db6647f91"
1919
}
2020
}

release-run/scientific_memory_import_report.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
"claim_id": "claim-pcs-qc-release-v0.1",
55
"imported_at": "2026-05-17T15:39:09Z",
66
"render_path": "/pcs/claims/claim-pcs-qc-release-v0.1",
7-
"scientific_memory_commit": "5b4b81049b430d1b59ff5b51f688eb0feaeef76c",
7+
"scientific_memory_commit": "01084512c1522a1e0df4334a1b304d1e7da076f7",
88
"source_bundle_path": "signed_science_claim_bundle.json",
99
"stale_artifacts": [],
1010
"strict": true,
1111
"verification_status": "passed",
1212
"warnings": [],
1313
"source_repo": "https://github.com/fraware/scientific-memory",
14-
"source_commit": "5b4b81049b430d1b59ff5b51f688eb0feaeef76c"
14+
"source_commit": "01084512c1522a1e0df4334a1b304d1e7da076f7"
1515
}

tests/pcs/fixtures/labtrust-release/FIXTURE_MANIFEST.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"runtime_receipt.json": "sha256:8e642b59657d70b408be354323006421b963bb0c9fc9514f6abc7aab305345b6",
88
"science_claim_bundle.certified.json": "sha256:9b42d792199eb6f358d26f822699f0ed65bb4366eee306d4958d42121c656833",
99
"science_claim_bundle.pending.json": "sha256:677e0171743c4c129ad4b1931c62ba3fa0323f10c7d6d8d76290f8a4aabae45e",
10-
"scientific_memory_import_report.json": "sha256:4928363620ad3847e92be95bd7e024ac28c425657fd180d2e4e5e585ad289bc5",
10+
"scientific_memory_import_report.json": "sha256:6d564fd38d09b47fa14833ec5346d2f7d56b6d5a4c0dc1c3ff1eb55db6647f91",
1111
"signed_science_claim_bundle.json": "sha256:d0ab55f964227c1350b29fe359dcaf61d04ad6b7dfcf1db351b717e1c47aab43",
1212
"trace.json": "sha256:f99eb0a90cd2b9819816a25ec4e938663d26ae8d40868cd8188665e940f7ad5c",
1313
"trace_certificate.json": "sha256:c0e09949aaa8441a2adc5a0be05e6827a7ab6a12c3e0c85d77f0554f191d1a28",
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"schema_version": "v0",
33
"release_candidate": "pcs-v0.1.0-rc1",
4-
"generated_at": "2026-05-17T16:27:23Z",
5-
"pcs_core_commit": "5bdffe6c6b59a3fca1b17aa907419c03ddc63448",
4+
"generated_at": "2026-05-17T16:43:03Z",
5+
"pcs_core_commit": "8caca0e2c7a20d8c8e9496e9b6d4f25d6a8faa66",
66
"labtrust_gym_commit": "4c5439ae358733f9a4c4a58e33fdaed1ab0d29de",
77
"certifyedge_commit": "cb6848001e2e60a484e04eba5ad6be3fe2e4eccc",
88
"provability_fabric_commit": "0f659b90c80c46a6bbfd51b0d37ea723b032fb9d",
9-
"scientific_memory_commit": "5b4b81049b430d1b59ff5b51f688eb0feaeef76c",
9+
"scientific_memory_commit": "01084512c1522a1e0df4334a1b304d1e7da076f7",
1010
"artifacts": {
1111
"trace.json": "sha256:f99eb0a90cd2b9819816a25ec4e938663d26ae8d40868cd8188665e940f7ad5c",
1212
"runtime_receipt.json": "sha256:8e642b59657d70b408be354323006421b963bb0c9fc9514f6abc7aab305345b6",
@@ -15,6 +15,6 @@
1515
"science_claim_bundle.certified.json": "sha256:9b42d792199eb6f358d26f822699f0ed65bb4366eee306d4958d42121c656833",
1616
"verification_result.json": "sha256:3b4b1215b4be6a945c3b99bb548e33a08527981290e7be1ab1da52b67ad8ba14",
1717
"signed_science_claim_bundle.json": "sha256:d0ab55f964227c1350b29fe359dcaf61d04ad6b7dfcf1db351b717e1c47aab43",
18-
"scientific_memory_import_report.json": "sha256:4928363620ad3847e92be95bd7e024ac28c425657fd180d2e4e5e585ad289bc5"
18+
"scientific_memory_import_report.json": "sha256:6d564fd38d09b47fa14833ec5346d2f7d56b6d5a4c0dc1c3ff1eb55db6647f91"
1919
}
2020
}

tests/pcs/fixtures/labtrust-release/scientific_memory_import_report.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
"claim_id": "claim-pcs-qc-release-v0.1",
55
"imported_at": "2026-05-17T15:39:09Z",
66
"render_path": "/pcs/claims/claim-pcs-qc-release-v0.1",
7-
"scientific_memory_commit": "5b4b81049b430d1b59ff5b51f688eb0feaeef76c",
7+
"scientific_memory_commit": "01084512c1522a1e0df4334a1b304d1e7da076f7",
88
"source_bundle_path": "signed_science_claim_bundle.json",
99
"stale_artifacts": [],
1010
"strict": true,
1111
"verification_status": "passed",
1212
"warnings": [],
1313
"source_repo": "https://github.com/fraware/scientific-memory",
14-
"source_commit": "5b4b81049b430d1b59ff5b51f688eb0feaeef76c"
14+
"source_commit": "01084512c1522a1e0df4334a1b304d1e7da076f7"
1515
}

tests/pcs/schema_fixtures.py

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,17 @@ def file_sha256(path: Path) -> str:
4646
CANONICAL_RC_LABTRUST_COMMIT = "4c5439ae358733f9a4c4a58e33fdaed1ab0d29de"
4747
CANONICAL_RC_CERTIFYEDGE_COMMIT = "cb6848001e2e60a484e04eba5ad6be3fe2e4eccc"
4848
CANONICAL_RC_PF_COMMIT = "0f659b90c80c46a6bbfd51b0d37ea723b032fb9d"
49-
_CANONICAL_MANIFEST_PATH = PCS_CORE_CANONICAL_RELEASE / "RELEASE_FIXTURE_MANIFEST.json"
50-
_CANONICAL_REPORT_PATH = PCS_CORE_CANONICAL_RELEASE / "scientific_memory_import_report.json"
49+
# Scientific Memory commit pinned in vendored import report (synced from pcs-core RC).
50+
def _fixture_scientific_memory_commit() -> str:
51+
if LABTRUST_RELEASE_IMPORT_REPORT.is_file():
52+
report = json.loads(LABTRUST_RELEASE_IMPORT_REPORT.read_text(encoding="utf-8-sig"))
53+
commit = report.get("scientific_memory_commit")
54+
if isinstance(commit, str) and len(commit) == 40:
55+
return commit
56+
return "5b4b81049b430d1b59ff5b51f688eb0feaeef76c"
5157

5258

53-
def _canonical_manifest_value(key: str, fallback: str) -> str:
54-
if not _CANONICAL_MANIFEST_PATH.is_file():
55-
return fallback
56-
manifest = json.loads(_CANONICAL_MANIFEST_PATH.read_text(encoding="utf-8-sig"))
57-
value = manifest.get(key)
58-
return value if isinstance(value, str) else fallback
59-
60-
61-
CANONICAL_RC_SCIENTIFIC_MEMORY_COMMIT = _canonical_manifest_value(
62-
"scientific_memory_commit",
63-
"d49cbf78837d42883a3c73078f098669e69f5e3d",
64-
)
59+
CANONICAL_RC_SCIENTIFIC_MEMORY_COMMIT = _fixture_scientific_memory_commit()
6560

6661
# Canonical import/render tests use the LabTrust v0.1 release fixture (synced from pcs-core).
6762
PF_SIGNED_BUNDLE = LABTRUST_RELEASE_BUNDLE

0 commit comments

Comments
 (0)