Skip to content

Commit 999a105

Browse files
frawarecursoragent
andcommitted
Add PCS formalization artifacts and Lean failure gallery.
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 0637a3f commit 999a105

143 files changed

Lines changed: 5102 additions & 373 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/pcs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ jobs:
7575
run: python examples/pcs_qc_release/scripts/ci_validate_regeneration_report.py
7676
- name: Validate failure_case_manifest.json gallery metadata
7777
run: python examples/pcs_qc_release/scripts/ci_validate_failure_manifests.py
78+
- name: Validate proof-obligation formalization artifacts
79+
run: python examples/pcs_qc_release/scripts/ci_validate_formalization.py
7880
- name: Verify LabTrust release protocol package
7981
run: |
8082
labtrust verify-release-protocol \

docs/contracts/cli_contract.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ This document defines the contract for all LabTrust-Gym CLI commands: exit codes
6969
| verify-release-protocol | `--release-dir <dir>`; optional `--pcs-core <dir>` | 0 | (stderr OK labels) | examples/pcs_qc_release/RUNBOOK.md |
7070
| verify-release-fixtures | alias for `verify-release-protocol` | 0 | (stderr OK labels) | examples/pcs_qc_release/RUNBOOK.md |
7171
| check-status-policy | `--release-dir <dir>`; optional `--workflow-profile`; `--json` | 0 | Status boundary checks (no ProofChecked from LabTrust) | examples/pcs_qc_release/RUNBOOK.md |
72-
| regenerate-release-protocol | `--out <release-dir>`; `--certifyedge-bin`; optional `--pcs-core`; `--workflow-profile`; `--json-summary`; `--summary-out` | 0 | Full protocol package; writes `<out>/regeneration_report.json` (pcs-bench fields) | examples/pcs_qc_release/RUNBOOK.md |
72+
| regenerate-release-protocol | `--out <release-dir>`; `--certifyedge-bin`; optional `--pcs-core`; `--workflow-profile`; `--json-summary`; `--summary-out` | 0 | Full protocol package; writes `<out>/regeneration_report.json`, `proof_obligation_hints.json`, `proof_obligation_identifiers.json`, `formalization_readiness_report.json` (pcs-bench; Lean extraction inputs only) | examples/pcs_qc_release/RUNBOOK.md, schemas_or_docs/FormalizationReadinessReport.v0.md |
7373
| regenerate-release-chain | alias for `regenerate-release-protocol` | 0 | same as above | examples/pcs_qc_release/RUNBOOK.md |
7474
| generate-failure-gallery | `--workflow <id\|property_id>`; `--out <dir>`; optional `--release-dir`; `--workflow-profile` | 0 | Per-case `failure_case_manifest.json`, `README.md`, `artifacts/`, legacy `expected_failure.json` / `repair_hint.json` | examples/pcs_qc_release/failures/ |
7575

76-
**PCS CI scripts (not `labtrust` subcommands):** `run_pcs_ci_local.{sh,ps1}` runs `pytest tests/pcs`, `ci_validate_workflow_profile.py`, export/release validation, `check-status-policy`, failure gallery generate/verify, and optional `verify-release-protocol` (matches `.github/workflows/pcs.yml`). `materialize_workflow_profile.py` refreshes `workflow_profile.v0.json` digest. `generate_golden.py` regenerates `expected/` in deterministic mode.
76+
**PCS CI scripts (not `labtrust` subcommands):** `run_pcs_ci_local.{sh,ps1}` runs `pytest tests/pcs`, `ci_validate_workflow_profile.py`, `ci_validate_formalization.py`, export/release validation, `check-status-policy`, failure gallery generate/verify, and optional `verify-release-protocol` (matches `.github/workflows/pcs.yml`). `materialize_workflow_profile.py` refreshes `workflow_profile.v0.json` digest. `materialize_formalization_artifacts.py` rebuilds formalization JSON from an existing `release/` tree. `generate_golden.py` regenerates `expected/` in deterministic mode.
7777

7878
## Optional / conditional commands
7979

docs/pcs-reference-implementation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ machine-readable benchmark report.
2424
| Reference workflow | `src/labtrust_gym/pcs/workflows/qc_release.py` |
2525
| Registry | `src/labtrust_gym/pcs/workflows/registry.py` |
2626
| Regeneration report | `src/labtrust_gym/pcs/regeneration_report.py` |
27+
| Proof-obligation / Lean readiness | `src/labtrust_gym/pcs/formalization.py` |
2728
| Failure manifests | `src/labtrust_gym/pcs/failure_case_manifest.py` |
2829
| JSON Schema | `policy/schemas/pcs/RegenerationReport.v0.schema.json`, `FailureCaseManifest.v0.schema.json` |
2930
| Committed release | `examples/pcs_qc_release/release/` |
@@ -38,6 +39,7 @@ labtrust regenerate-release-protocol \
3839
--out examples/pcs_qc_release/release
3940

4041
python examples/pcs_qc_release/scripts/ci_validate_regeneration_report.py
42+
python examples/pcs_qc_release/scripts/ci_validate_formalization.py
4143
python examples/pcs_qc_release/scripts/ci_validate_failure_manifests.py
4244
pytest tests/pcs -q
4345
```

docs/pcs-workflow-implementation-guide.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,13 @@ CI validators (LabTrust reference):
143143
- `examples/pcs_qc_release/scripts/ci_validate_failure_manifests.py`
144144
- `examples/pcs_qc_release/scripts/materialize_regeneration_report.py` (refresh report without CertifyEdge)
145145

146+
Proof-obligation readiness (Lean extraction, not Lean execution):
147+
148+
- `proof_obligation_hints.json` — artifact paths for pcs-core
149+
- `proof_obligation_identifiers.json` — stable IDs for ProofObligation.v0
150+
- `formalization_readiness_report.json` — emitted by `regenerate-release-protocol`
151+
- WorkflowProfile `formalization.formalization_scope` must be `trust_envelope_only`
152+
146153
JSON Schema (validated on write and in CI):
147154

148155
- `policy/schemas/pcs/RegenerationReport.v0.schema.json`

examples/pcs_qc_release/RUNBOOK.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,12 @@ labtrust regenerate-release-protocol \
292292
# examples/pcs_qc_release/release/regeneration_report.json
293293
python examples/pcs_qc_release/scripts/ci_validate_regeneration_report.py
294294

295+
# Lean readiness (LabTrust does not run Lean; trust_envelope_only):
296+
# proof_obligation_hints.json, proof_obligation_identifiers.json,
297+
# formalization_readiness_report.json
298+
python examples/pcs_qc_release/scripts/ci_validate_formalization.py
299+
python examples/pcs_qc_release/scripts/materialize_formalization_artifacts.py
300+
295301
labtrust check-status-policy \
296302
--release-dir examples/pcs_qc_release/release
297303

@@ -342,6 +348,7 @@ pytest tests/pcs/test_pcs_release_contract.py -q
342348
pytest tests/pcs/test_release_protocol_producer.py -q
343349
python examples/pcs_qc_release/scripts/ci_validate_release_fixtures.py
344350
python examples/pcs_qc_release/scripts/ci_validate_regeneration_report.py
351+
python examples/pcs_qc_release/scripts/ci_validate_formalization.py
345352
python examples/pcs_qc_release/scripts/ci_validate_failure_manifests.py
346353
python examples/pcs_qc_release/scripts/ci_validate_pcs_exports.py
347354
python examples/pcs_qc_release/scripts/write_failure_case_manifests.py

examples/pcs_qc_release/failures/certificate_id_tamper/artifacts/handoff_to_certifyedge.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"created_at": "2026-05-18T21:00:43Z",
2+
"created_at": "2026-05-18T23:17:38Z",
33
"expected_outputs": {
44
"trace_certificate.json": {
55
"artifact_type": "TraceCertificate.v0"
@@ -11,7 +11,7 @@
1111
"input_artifacts": {
1212
"runtime_receipt.json": {
1313
"artifact_type": "RuntimeReceipt.v0",
14-
"sha256": "sha256:3ad5c55458a79ef502508f86cd215c746d42b4f0cc5c9aa4feeba9c03b4e1d60"
14+
"sha256": "sha256:10576e0d581c624f7988a937ffaacb47775dceb166050cd957379a929af65ac3"
1515
},
1616
"trace.json": {
1717
"artifact_type": "LabTrust.Trace.v0",
@@ -23,8 +23,8 @@
2323
"trace_hash": "sha256:c3e8a3dc4ad86d533de1dfa4ae7fe2a338c2cff3c945404c96a75216524d58cd"
2424
},
2525
"schema_version": "v0",
26-
"signature_or_digest": "sha256:352ae4a199281a1c03551e2dedd41eddb6465e659f563f17a8cdc192607a7dab",
27-
"source_commit": "17ed831acfd775889ab497d11004cceb083a9c2d",
26+
"signature_or_digest": "sha256:7adfc5945dda3368d8c8e833c015ce1d3116d5128dc2206b36a48efacef74bd7",
27+
"source_commit": "8369892d8872bc08ef5acb6cf503f38665c36733",
2828
"source_repo": "https://github.com/fraware/LabTrust-Gym",
2929
"status": "Validated",
3030
"to_component": "CertifyEdge"

examples/pcs_qc_release/failures/certificate_id_tamper/artifacts/handoff_to_pf.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"created_at": "2026-05-18T21:00:43Z",
2+
"created_at": "2026-05-18T23:17:38Z",
33
"expected_outputs": {
44
"signed_science_claim_bundle.json": {
55
"artifact_type": "SignedScienceClaimBundle.v0"
@@ -14,17 +14,17 @@
1414
"input_artifacts": {
1515
"science_claim_bundle.certified.json": {
1616
"artifact_type": "ScienceClaimBundle.v0",
17-
"sha256": "sha256:a8c5268390a35989cd504e34080e477229604ff13f6b4c69311a281a027eeede"
17+
"sha256": "sha256:68d59a16ac4f5d1e6e5aff61a011be192fbb12f9b4476fa221079a934b1265fc"
1818
}
1919
},
2020
"invariants": {
21-
"certificate_id": "cert-trace-1f02c608-8c7e-41fc-86dd-8808429cb371",
22-
"certified_bundle_hash": "sha256:a8c5268390a35989cd504e34080e477229604ff13f6b4c69311a281a027eeede",
21+
"certificate_id": "cert-trace-02b3a7c1-35f7-4d23-85c2-dfd60aff7693",
22+
"certified_bundle_hash": "sha256:68d59a16ac4f5d1e6e5aff61a011be192fbb12f9b4476fa221079a934b1265fc",
2323
"trace_hash": "sha256:c3e8a3dc4ad86d533de1dfa4ae7fe2a338c2cff3c945404c96a75216524d58cd"
2424
},
2525
"schema_version": "v0",
26-
"signature_or_digest": "sha256:1e1bed58050d790cb99bd892c0c405246e2e16be90c5ce1faff7ed3aa35f8f2f",
27-
"source_commit": "17ed831acfd775889ab497d11004cceb083a9c2d",
26+
"signature_or_digest": "sha256:081150b883dfd4ad70d3744803f30dc15f457e9d7234457b3f4045d486198367",
27+
"source_commit": "8369892d8872bc08ef5acb6cf503f38665c36733",
2828
"source_repo": "https://github.com/fraware/LabTrust-Gym",
2929
"status": "Validated",
3030
"to_component": "Provability Fabric"

examples/pcs_qc_release/failures/certificate_id_tamper/artifacts/labtrust_release_fragment.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
"artifacts": {
33
"handoff_to_certifyedge.json": {
44
"artifact_type": "HandoffManifest.v0",
5-
"sha256": "sha256:0fc716f0506f182b454996fc8529ac52fff5a10d413166d1837f289ff38aec9a"
5+
"sha256": "sha256:36a9b102c821dd7820c2074bb5e503d6ac2a8c6fcc255503549a41a61f5be4c1"
66
},
77
"handoff_to_pf.json": {
88
"artifact_type": "HandoffManifest.v0",
9-
"sha256": "sha256:594f3b1cdbc53f3fcd87ece5ad88ea5483e7c121379f414c8d47efd6830dbbe3"
9+
"sha256": "sha256:2236bcf2eca9c9ad251267462720cd9276c816cb4f73f3984e8644f30fc799c5"
1010
},
1111
"runtime_receipt.json": {
1212
"artifact_type": "RuntimeReceipt.v0",
13-
"sha256": "sha256:3ad5c55458a79ef502508f86cd215c746d42b4f0cc5c9aa4feeba9c03b4e1d60"
13+
"sha256": "sha256:10576e0d581c624f7988a937ffaacb47775dceb166050cd957379a929af65ac3"
1414
},
1515
"science_claim_bundle.certified.json": {
1616
"artifact_type": "ScienceClaimBundle.v0",
17-
"sha256": "sha256:a8c5268390a35989cd504e34080e477229604ff13f6b4c69311a281a027eeede"
17+
"sha256": "sha256:68d59a16ac4f5d1e6e5aff61a011be192fbb12f9b4476fa221079a934b1265fc"
1818
},
1919
"science_claim_bundle.pending.json": {
2020
"artifact_type": "ScienceClaimBundle.v0",
21-
"sha256": "sha256:406d376c6d26eb949c32f2b6c6f6578aa877f24c9ea0cb0a8b87bd377c72cfe0"
21+
"sha256": "sha256:e89b0866cd25a9308f7ba70deb68e8e3c8f072b6885ca6f2e9fcaaa55706e6c7"
2222
},
2323
"trace.json": {
2424
"artifact_type": "LabTrust.Trace.v0",
@@ -27,7 +27,7 @@
2727
},
2828
"component": "LabTrust-Gym",
2929
"schema_version": "v0",
30-
"signature_or_digest": "sha256:de29dc1c2ade982685b56455c5be342c0c6b7ab2d12e3d3e60904b42dff21e27",
31-
"source_commit": "17ed831acfd775889ab497d11004cceb083a9c2d",
30+
"signature_or_digest": "sha256:a2728a29078c80afc7d094b1678b8c35eeeb673a0ff087c14c82df051d98d6ac",
31+
"source_commit": "8369892d8872bc08ef5acb6cf503f38665c36733",
3232
"source_repo": "https://github.com/fraware/LabTrust-Gym"
3333
}
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
{
22
"artifacts": {
3-
"runtime_receipt.json": "sha256:3ad5c55458a79ef502508f86cd215c746d42b4f0cc5c9aa4feeba9c03b4e1d60",
4-
"science_claim_bundle.certified.json": "sha256:a8c5268390a35989cd504e34080e477229604ff13f6b4c69311a281a027eeede",
5-
"science_claim_bundle.pending.json": "sha256:406d376c6d26eb949c32f2b6c6f6578aa877f24c9ea0cb0a8b87bd377c72cfe0",
3+
"runtime_receipt.json": "sha256:10576e0d581c624f7988a937ffaacb47775dceb166050cd957379a929af65ac3",
4+
"science_claim_bundle.certified.json": "sha256:68d59a16ac4f5d1e6e5aff61a011be192fbb12f9b4476fa221079a934b1265fc",
5+
"science_claim_bundle.pending.json": "sha256:e89b0866cd25a9308f7ba70deb68e8e3c8f072b6885ca6f2e9fcaaa55706e6c7",
66
"trace.json": "sha256:f99eb0a90cd2b9819816a25ec4e938663d26ae8d40868cd8188665e940f7ad5c",
7-
"trace_certificate.json": "sha256:c6cb984bf1639a25ae5a077a0677e1ec1b6346d8e5f7440fb414dd4b4886bed3"
7+
"trace_certificate.json": "sha256:f25188838271cb394eeac93628d500e6b9ec9a7c0a8b7d6b0258d58790bd5c6c"
88
},
9-
"certificate_id": "cert-trace-1f02c608-8c7e-41fc-86dd-8808429cb371",
9+
"certificate_id": "cert-trace-02b3a7c1-35f7-4d23-85c2-dfd60aff7693",
1010
"certificate_producer": "CertifyEdge",
1111
"certificate_source_repo": "https://github.com/fraware/CertifyEdge",
12-
"certified_bundle_hash": "sha256:a8c5268390a35989cd504e34080e477229604ff13f6b4c69311a281a027eeede",
12+
"certified_bundle_hash": "sha256:68d59a16ac4f5d1e6e5aff61a011be192fbb12f9b4476fa221079a934b1265fc",
1313
"certified_bundle_id": "scb-pcs-qc-release-v0.1",
1414
"certifyedge_bin": "C:\\Users\\mateo\\CertifyEdge\\target\\debug\\certifyedge.exe",
15-
"certifyedge_commit": "635fca3771ad54fe3f8b49d1bb77ee35d0680ddc",
15+
"certifyedge_commit": "11e079bc643b9e813c1a5516dc6d4db1d60a3f8a",
1616
"certifyedge_spec": "CertifyEdge/templates/hospital_lab/qc_release.stl",
17-
"generated_at": "2026-05-18T21:00:42Z",
17+
"generated_at": "2026-05-18T23:17:38Z",
1818
"generator": "regenerate_release_protocol",
1919
"handoff_id": "handoff-labtrust-qc_release_v0-1-to-pf",
20-
"labtrust_gym_commit": "17ed831acfd775889ab497d11004cceb083a9c2d",
20+
"labtrust_gym_commit": "8369892d8872bc08ef5acb6cf503f38665c36733",
2121
"mock_certificate": false,
22-
"pcs_core_commit": "17e414501b3e1c58e8fbde1fe89a828440a945d9",
22+
"pcs_core_commit": "5ed33a0f995df88392ee0fc849967e9c42038738",
2323
"schema_version": "v0",
2424
"trace_hash": "sha256:c3e8a3dc4ad86d533de1dfa4ae7fe2a338c2cff3c945404c96a75216524d58cd"
2525
}

examples/pcs_qc_release/failures/certificate_id_tamper/artifacts/runtime_receipt.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"run_id": "qc-release",
2222
"run_outcome": "passed",
2323
"schema_version": "v0",
24-
"signature_or_digest": "sha256:b311c7e474ba4053a9c0265b8a9f13cf2a505f89d5205d19242246223cf148c5",
25-
"source_commit": "17ed831acfd775889ab497d11004cceb083a9c2d",
24+
"signature_or_digest": "sha256:ecce874ad042b848e57bfa54dc4ea9a5992ea351a06ed5da49e3a5c28da55d8b",
25+
"source_commit": "8369892d8872bc08ef5acb6cf503f38665c36733",
2626
"source_repo": "https://github.com/fraware/LabTrust-Gym",
2727
"started_at": "2026-01-15T08:00:00Z",
2828
"status": "RuntimeObserved",

0 commit comments

Comments
 (0)