From 67e5a9829cac322adca3343d8a687a82fabaa0f8 Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Wed, 25 Nov 2026 07:21:57 +0000 Subject: [PATCH 1/4] Register Proven lifecycle evidence as an ungraded demonstration --- docs/atlas/claims/claims.jsonl | 1 + docs/atlas/generated/registry.adoc | 4 +++- docs/status/ROADMAP.adoc | 20 ++++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/docs/atlas/claims/claims.jsonl b/docs/atlas/claims/claims.jsonl index 6e60123c..b8e61df1 100644 --- a/docs/atlas/claims/claims.jsonl +++ b/docs/atlas/claims/claims.jsonl @@ -51,3 +51,4 @@ {"agda":{"module":"ResourceAlgebra.Instances.Evidence","names":["Evidence","Evidence-dioid","Evidence-ordered","Evidence-annihilating","≼→≤","≤→≼","≼-proven","⊓e-lowerˡ","⊓e-lowerʳ","⊓e-greatest"]},"claim":"E-1","id":"hyperpolymath/resource-algebra#E-1","kind":"theorem","receipt":{"path":"verification/receipts/resource-algebra-proofs_praxis.deed","sha256":"735d0044f9783c1d7fcc5443ee347e6987dd92007d4b19f36eb1705c9d4e88a7"},"repo":"hyperpolymath/resource-algebra","source_commit":"c31bf1a9ae9d186674c7ed79c6c9b018a1d59c2b","statement":"`Evidence`, the PROOF-POLICY §5 statuses as a chain (open-row < tested-only < argued < proven-with-postulates < proven), is a `ResourceAlgebra`, `IsDioid`, `IsOrdered` and `IsAnnihilating`, with ⊕ the stronger and ⊗ the weaker status; ⊗ is the meet of `≼`.","status_doc":"docs/status/PROOF-STATUS.adoc"} {"agda":{"module":"ResourceAlgebra.Ledger","names":["eff-≼-own","eff-≼-dep","eff-≼-reach"]},"claim":"E-2","id":"hyperpolymath/resource-algebra#E-2","kind":"theorem","receipt":{"path":"verification/receipts/resource-algebra-proofs_praxis.deed","sha256":"735d0044f9783c1d7fcc5443ee347e6987dd92007d4b19f36eb1705c9d4e88a7"},"repo":"hyperpolymath/resource-algebra","source_commit":"c31bf1a9ae9d186674c7ed79c6c9b018a1d59c2b","statement":"Soundness: a ledger row's derived status is no stronger than its own evidence, than any row it depends on, or than any row it reaches through dependencies.","status_doc":"docs/status/PROOF-STATUS.adoc"} {"agda":{"module":"ResourceAlgebra.Ledger","names":["Respects","eff-respects","restrict","eff-greatest"]},"claim":"E-3","id":"hyperpolymath/resource-algebra#E-3","kind":"theorem","receipt":{"path":"verification/receipts/resource-algebra-proofs_praxis.deed","sha256":"735d0044f9783c1d7fcc5443ee347e6987dd92007d4b19f36eb1705c9d4e88a7"},"repo":"hyperpolymath/resource-algebra","source_commit":"c31bf1a9ae9d186674c7ed79c6c9b018a1d59c2b","statement":"Maximality: the derived status respects the ledger, and every respectful assignment is below it row by row, so it is the strongest status the ledger supports.","status_doc":"docs/status/PROOF-STATUS.adoc"} +{"agda":null,"claim":"ABI-LC-D1","id":"hyperpolymath/proven#ABI-LC-D1","kind":"demonstration","receipt":{"path":"verification/receipts/lifecycle-20261124/receipt.json","sha256":"65d00249d0d055f84d8bd34f7b8469f53f8ded66c46db49316f92b99b615bc6c"},"repo":"hyperpolymath/proven","source_commit":"d8dd1489e7a91efa309b1231f79ab6d9df4e10c2","statement":"The production Idris lifecycle policy reaches the Linux x86_64 static and shared libraries through the Zig/RefC bridge; actual C and Rust callers observe the specified initialization, shutdown and readiness behavior, and a corrupted generated lifecycle reply is rejected with readiness false.","status_doc":"docs/status/LIFECYCLE-PROOF-STATUS.adoc"} diff --git a/docs/atlas/generated/registry.adoc b/docs/atlas/generated/registry.adoc index 8ae6bea3..7bad9522 100644 --- a/docs/atlas/generated/registry.adoc +++ b/docs/atlas/generated/registry.adoc @@ -10,7 +10,7 @@ assigned (§8.5). A grade is not a discharge (§8.4): `PWG-3` theorems still owe their Rocq and Lean legs. Status of this slice: accepted in link:../../decisions/0004-claims-registry.adoc[ADR 0004], ratified by the owner. -Census: 0 at `PWG-1`, 5 at `PWG-2ii`, 31 at `PWG-2i`, 0 at `PWG-3`, 12 `ungraded`, of 48 theorems. 5 demonstrations and assumptions are listed and not graded. +Census: 0 at `PWG-1`, 5 at `PWG-2ii`, 31 at `PWG-2i`, 0 at `PWG-3`, 12 `ungraded`, of 48 theorems. 6 demonstrations and assumptions are listed and not graded. [cols="2,1,1,4,3",options="header"] |=== @@ -26,6 +26,8 @@ Census: 0 at `PWG-1`, 5 at `PWG-2ii`, 31 at `PWG-2i`, 0 at `PWG-3`, 12 `ungraded |https://github.com/hyperpolymath/mathesis/blob/10f9f46ff7e1c8a0433164bc8bf6d8f30842fd4c/docs/status/PROOF-STATUS.adoc[hyperpolymath/mathesis#THY-1] at `10f9f46ff7e1`; the receipt describes `8c55804163fd` |theorem |`PWG-2ii` |In a dependency graph whose edges are guarded by features closed under Horn rules, and by an arbitrary per-target condition, a node unreachable with every feature requested is unreachable under any request, on each target (`Cargo.absent-under-all-features`). The general form is `Monotone.reach-mono`: reachability over a monotone family of edge sets is monotone. (`FeatureReachability`: `Cargo.absent-under-all-features`, `Monotone.reach-mono`) |the reader derives PWG-2ii from the legs and receipts at `8c55804163fd` +|https://github.com/hyperpolymath/proven/blob/d8dd1489e7a91efa309b1231f79ab6d9df4e10c2/docs/status/LIFECYCLE-PROOF-STATUS.adoc[hyperpolymath/proven#ABI-LC-D1] at `d8dd1489e7a9` |demonstration |`ungraded` |The production Idris lifecycle policy reaches the Linux x86_64 static and shared libraries through the Zig/RefC bridge; actual C and Rust callers observe the specified initialization, shutdown and readiness behavior, and a corrupted generated lifecycle reply is rejected with readiness false. |demonstration, not a theorem (§8.1) + |https://github.com/hyperpolymath/resource-algebra/blob/c31bf1a9ae9d186674c7ed79c6c9b018a1d59c2b/docs/status/PROOF-STATUS.adoc[hyperpolymath/resource-algebra#C-1] at `c31bf1a9ae9d`; the receipt describes `15fa113c7427` |theorem |`PWG-2i` |`ResourceAlgebra`: alternatives form an idempotent commutative monoid and sequencing a monoid. (`ResourceAlgebra.Core`: `ResourceAlgebra`, `IsAltMonoid.unitʳ`) |the reader derives PWG-2i from the legs and receipts at `15fa113c7427` |https://github.com/hyperpolymath/resource-algebra/blob/c31bf1a9ae9d186674c7ed79c6c9b018a1d59c2b/docs/status/PROOF-STATUS.adoc[hyperpolymath/resource-algebra#C-2] at `c31bf1a9ae9d`; the receipt describes `15fa113c7427` |theorem |`PWG-2i` |The relation `≼` induced by ⊕ is a partial order. `𝟘` is least and `⊕` is its join. (`ResourceAlgebra.Core`: `≼-refl`, `≼-trans`, `≼-antisym`, `𝟘-least`, `⊕-upperˡ`, `⊕-upperʳ`, `⊕-least`) |the reader derives PWG-2i from the legs and receipts at `15fa113c7427` diff --git a/docs/status/ROADMAP.adoc b/docs/status/ROADMAP.adoc index a9f458ce..fd9d4e8c 100644 --- a/docs/status/ROADMAP.adoc +++ b/docs/status/ROADMAP.adoc @@ -10,6 +10,26 @@ Phase `incubating`, maturity `experimental` (the deed's `(status)` and truth". The stages are under <>; the rulings that steer them are under <>. +=== Proven lifecycle registration (2026-11-25) + +The Proven owner has retained production Idris lifecycle proof checks, negative +proof controls, actual Linux static/shared libraries, C/Rust consumer and +concurrency tests, standalone unavailability and generated-result corruption +controls. The home ledger is `docs/status/LIFECYCLE-PROOF-STATUS.adoc`, claim +`ABI-LC-D1`. These are engineering proofs and an execution demonstration; no +Agda/Rocq/Lean theory grade is assigned or implied. + +Six fixture-only engineering-receipt checks and fourteen existing claims-registry +tests passed with the exact pinned reader. They registered no source or theorem. +The demonstration row pins signed receipt carrier +`d8dd1489e7a91efa309b1231f79ab6d9df4e10c2`, which binds signed implementation +snapshot `e7a0aa8a46601df22f0853c28ec26424a3874321`. The public receipt SHA-256 is +`65d00249d0d055f84d8bd34f7b8469f53f8ded66c46db49316f92b99b615bc6c`. +Final canonical registry build/check passed against the published pin, as did all fourteen registry tests and six negative fixture controls. The generated view adds one ungraded demonstration; all 48 theorem entries, their grades, admissions and the append-only theory ledger are unchanged. +Receipts remain in Proven; private bridge source is not vendored here. +The broader ABI's missing exports, compiler/marshaling/ownership +assumptions and Rust wrapper proof obligations remain open in the home ledger. + === Applied Systems (2026-11-07) * Added the owner-requested `applied-systems/` area for reusable applications, From ca3f5ab498c8d0674239601120df6cbfe7caf29b Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Wed, 25 Nov 2026 08:26:11 +0000 Subject: [PATCH 2/4] Validate engineering receipts and export isolated registry previews --- .github/workflows/actions.lock | 17 ++- .github/workflows/proven-tests.yml | 34 +++++- docs/atlas/claims/claims.jsonl | 2 +- ...006-engineering-demonstration-receipt.adoc | 39 +++++++ docs/status/ROADMAP.adoc | 10 +- scripts/registry/claims-registry.mjs | 16 ++- scripts/registry/engineering-receipt.mjs | 79 +++++++++++++ tests/registry/engineering-receipt.test.mjs | 107 ++++++++++++++++++ 8 files changed, 290 insertions(+), 14 deletions(-) create mode 100644 docs/decisions/0006-engineering-demonstration-receipt.adoc create mode 100644 scripts/registry/engineering-receipt.mjs create mode 100644 tests/registry/engineering-receipt.test.mjs diff --git a/.github/workflows/actions.lock b/.github/workflows/actions.lock index 7e3ecc19..2d3c2dac 100644 --- a/.github/workflows/actions.lock +++ b/.github/workflows/actions.lock @@ -66,9 +66,10 @@ workflows: - 'actions/upload-pages-artifact@v5.0.0' - 'haskell-actions/setup@v2.12.1' '.github/workflows/proven-tests.yml': - - 'actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9' - - 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1' - - 'oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6' + - 'actions/cache@v6.1.0' + - 'actions/checkout@v7.0.1' + - 'actions/upload-artifact@v7.0.2' + - 'oven-sh/setup-bun@v2.2.0' '.github/workflows/push-email-notify.yml': - 'hyperpolymath/smtp-notify-action@v0.5.1' '.github/workflows/quality.yml': @@ -142,6 +143,11 @@ dependencies: commit: 'sha1-cf430e030ddbb5b0abf93d22962f4752f3646cd9' owner_id: 44036562 repo_id: 192625955 + 'actions/upload-artifact@v7.0.2': + ref: 'v7.0.2' + commit: 'sha1-cf430e030ddbb5b0abf93d22962f4752f3646cd9' + owner_id: 44036562 + repo_id: 192625955 'actions/upload-pages-artifact@v5.0.0': ref: 'v5.0.0' commit: 'sha1-fc324d3547104276b827a68afc52ff2a11cc49c9' @@ -199,6 +205,11 @@ dependencies: commit: 'sha1-0c5077e51419868618aeaa5fe8019c62421857d6' owner_id: 108928776 repo_id: 512644635 + 'oven-sh/setup-bun@v2.2.0': + ref: 'v2.2.0' + commit: 'sha1-0c5077e51419868618aeaa5fe8019c62421857d6' + owner_id: 108928776 + repo_id: 512644635 'sonarsource/sonarqube-scan-action@v8.5.0': ref: 'v8.5.0' commit: 'sha1-59202af334b4ba7b5db01b701b8e79f8b3bef0f4' diff --git a/.github/workflows/proven-tests.yml b/.github/workflows/proven-tests.yml index 67f1373f..6374af90 100644 --- a/.github/workflows/proven-tests.yml +++ b/.github/workflows/proven-tests.yml @@ -29,7 +29,7 @@ jobs: NICKEL_SHA256: '9cba4dd65ae9915ec61f73033aafcff307a377665a83fd8f530df086763318cb' steps: - name: Checkout repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + uses: actions/checkout@v7.0.1 with: persist-credentials: false @@ -44,7 +44,7 @@ jobs: git -C "$RUNNER_TEMP/standards" checkout -q FETCH_HEAD - name: Set up Bun - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 + uses: oven-sh/setup-bun@v2.2.0 # PROOF-POLICY 8.5.1: the receipt must read, and the grade it records must # be the grade the canon reader derives (re-anchoring plan WO 1.5). The # canon pin above (8e48b1c) predates the reader, so the reader has its own @@ -74,6 +74,34 @@ jobs: # reader re-derives every grade from the home repositories' receipts at # their pinned commits (fetched, digest-checked). The check fails if the # committed view is stale (re-anchoring plan WO 2.2). + - name: Build and test an isolated registry preview + env: + MATHESIS_STANDARDS: ${{ runner.temp }}/receipt-reader + run: | + set -euo pipefail + preview="$RUNNER_TEMP/registry-preview" + source="$RUNNER_TEMP/registry-preview-source" + mkdir -p "$preview" "$source" + git rev-parse HEAD > "$preview/source-commit.txt" + git archive HEAD | tar -x -C "$source" + cd "$source" + sha256sum scripts/registry/*.mjs tests/registry/*.mjs docs/atlas/claims/*.jsonl > "$preview/inputs.sha256" + bun scripts/registry/claims-registry.mjs build 2>&1 | tee "$preview/build.log" + bun scripts/registry/claims-registry.mjs check 2>&1 | tee "$preview/check.log" + bun test tests/registry/ 2>&1 | tee "$preview/tests.log" + sha256sum --check --quiet "$preview/inputs.sha256" + cp docs/atlas/generated/registry.adoc "$preview/registry.adoc" + cp docs/atlas/generated/bridges.adoc "$preview/bridges.adoc" + cp docs/theory/generated/index.adoc "$preview/theory-index.adoc" + - name: Retain registry preview and regression evidence + if: always() + uses: actions/upload-artifact@v7.0.2 + with: + name: registry-preview + path: ${{ runner.temp }}/registry-preview/ + if-no-files-found: error + # The real checkout is untouched by preview generation: a stale committed + # view still fails this gate, even when the isolated preview passed. - name: Mathesis claims registry derivation and tests env: # The canon reader checked out above, at the pin the registry checks. @@ -121,7 +149,7 @@ jobs: - name: Cache pinned ijson-jcs and panic-attack binaries id: cache-ijson - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + uses: actions/cache@v6.1.0 with: path: | ~/.cargo/bin/ijson-jcs diff --git a/docs/atlas/claims/claims.jsonl b/docs/atlas/claims/claims.jsonl index b8e61df1..d9d65387 100644 --- a/docs/atlas/claims/claims.jsonl +++ b/docs/atlas/claims/claims.jsonl @@ -51,4 +51,4 @@ {"agda":{"module":"ResourceAlgebra.Instances.Evidence","names":["Evidence","Evidence-dioid","Evidence-ordered","Evidence-annihilating","≼→≤","≤→≼","≼-proven","⊓e-lowerˡ","⊓e-lowerʳ","⊓e-greatest"]},"claim":"E-1","id":"hyperpolymath/resource-algebra#E-1","kind":"theorem","receipt":{"path":"verification/receipts/resource-algebra-proofs_praxis.deed","sha256":"735d0044f9783c1d7fcc5443ee347e6987dd92007d4b19f36eb1705c9d4e88a7"},"repo":"hyperpolymath/resource-algebra","source_commit":"c31bf1a9ae9d186674c7ed79c6c9b018a1d59c2b","statement":"`Evidence`, the PROOF-POLICY §5 statuses as a chain (open-row < tested-only < argued < proven-with-postulates < proven), is a `ResourceAlgebra`, `IsDioid`, `IsOrdered` and `IsAnnihilating`, with ⊕ the stronger and ⊗ the weaker status; ⊗ is the meet of `≼`.","status_doc":"docs/status/PROOF-STATUS.adoc"} {"agda":{"module":"ResourceAlgebra.Ledger","names":["eff-≼-own","eff-≼-dep","eff-≼-reach"]},"claim":"E-2","id":"hyperpolymath/resource-algebra#E-2","kind":"theorem","receipt":{"path":"verification/receipts/resource-algebra-proofs_praxis.deed","sha256":"735d0044f9783c1d7fcc5443ee347e6987dd92007d4b19f36eb1705c9d4e88a7"},"repo":"hyperpolymath/resource-algebra","source_commit":"c31bf1a9ae9d186674c7ed79c6c9b018a1d59c2b","statement":"Soundness: a ledger row's derived status is no stronger than its own evidence, than any row it depends on, or than any row it reaches through dependencies.","status_doc":"docs/status/PROOF-STATUS.adoc"} {"agda":{"module":"ResourceAlgebra.Ledger","names":["Respects","eff-respects","restrict","eff-greatest"]},"claim":"E-3","id":"hyperpolymath/resource-algebra#E-3","kind":"theorem","receipt":{"path":"verification/receipts/resource-algebra-proofs_praxis.deed","sha256":"735d0044f9783c1d7fcc5443ee347e6987dd92007d4b19f36eb1705c9d4e88a7"},"repo":"hyperpolymath/resource-algebra","source_commit":"c31bf1a9ae9d186674c7ed79c6c9b018a1d59c2b","statement":"Maximality: the derived status respects the ledger, and every respectful assignment is below it row by row, so it is the strongest status the ledger supports.","status_doc":"docs/status/PROOF-STATUS.adoc"} -{"agda":null,"claim":"ABI-LC-D1","id":"hyperpolymath/proven#ABI-LC-D1","kind":"demonstration","receipt":{"path":"verification/receipts/lifecycle-20261124/receipt.json","sha256":"65d00249d0d055f84d8bd34f7b8469f53f8ded66c46db49316f92b99b615bc6c"},"repo":"hyperpolymath/proven","source_commit":"d8dd1489e7a91efa309b1231f79ab6d9df4e10c2","statement":"The production Idris lifecycle policy reaches the Linux x86_64 static and shared libraries through the Zig/RefC bridge; actual C and Rust callers observe the specified initialization, shutdown and readiness behavior, and a corrupted generated lifecycle reply is rejected with readiness false.","status_doc":"docs/status/LIFECYCLE-PROOF-STATUS.adoc"} +{"agda":null,"claim":"ABI-LC-D1","id":"hyperpolymath/proven#ABI-LC-D1","kind":"demonstration","receipt":{"path":"verification/receipts/lifecycle-20261125/engineering.json","sha256":"653e399024a61d3d990cc31f1e25f052ffbe9ce26b5c84d51f9c80b642992643"},"repo":"hyperpolymath/proven","source_commit":"4ac09e36c6b710099b4ceadb26066a83d949dd8f","statement":"The production Idris lifecycle policy reaches the Linux x86_64 static and shared libraries through the Zig/RefC bridge; actual C and Rust callers observe the specified initialization, shutdown and readiness behavior, and a corrupted generated lifecycle reply is rejected with readiness false.","status_doc":"docs/status/LIFECYCLE-PROOF-STATUS.adoc"} diff --git a/docs/decisions/0006-engineering-demonstration-receipt.adoc b/docs/decisions/0006-engineering-demonstration-receipt.adoc new file mode 100644 index 00000000..160c91cb --- /dev/null +++ b/docs/decisions/0006-engineering-demonstration-receipt.adoc @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// Copyright (c) Jonathan D.A. Jewell += 0006: Validate engineering demonstration receipts + +== Scope and decision + +Implemented for the owner's requested Proven evidence registration. This adds +a separate, ungraded engineering profile; it does not accept or wire the proposed +theorem JSON reader in ADR 0005 and introduces no PWG grading rule. + +A demonstration may pin a canonical JCS engineering receipt. Its closed schema +requires an exact repository, claim, statement and home status document; a full +implementation commit; pinned source and evidence manifests; nonempty successful +checks and rejecting negative controls, each naming its checker, invocation and +hashed evidence; and explicit trusted-base and open-obligation lists. +The registry fetches each referenced evidence file at the same pinned carrier +and checks its digest. Unknown fields (including asserted grades), duplicate JSON +keys, malformed source commits, unsafe paths, failed/unexecuted checks, missing +controls, identity mismatches and theorem promotion stop registration. + +Receipt carrier and implementation commit may differ. The generated view shows +both. This verifies the declared binding and retained evidence integrity; it does +not rerun commands, establish the truth of logs, verify source-manifest correspondence +against every implementation blob, or certify compiler/FFI behavior. Those remain +producer evidence and explicit trust obligations. No theorem grade is assigned. + +== Regression found during Proven integration + +Previously the JSON was sent to the praxis-deed reader, which refused it. The +non-theorem early return discarded that refusal and still rendered the row. +Malformed engineering JSON now stops registration. Engineering JSON has an +explicit reader and positive/negative end-to-end registry tests; matching a +digest alone can no longer register arbitrary JSON as engineering evidence. + +Legacy praxis-deed refusals retain the existing ungraded catalogue behavior +used for theorem rows, with the refusal now visible for demonstrations too. +The pinned Secret Types deed, for example, asserts a grade that the newer canon +reader refuses; its demonstration rows stay ungraded and expose that refusal. +This change neither upgrades that evidence nor rewrites its home receipt. diff --git a/docs/status/ROADMAP.adoc b/docs/status/ROADMAP.adoc index fd9d4e8c..f50d9cbd 100644 --- a/docs/status/ROADMAP.adoc +++ b/docs/status/ROADMAP.adoc @@ -22,11 +22,11 @@ Agda/Rocq/Lean theory grade is assigned or implied. Six fixture-only engineering-receipt checks and fourteen existing claims-registry tests passed with the exact pinned reader. They registered no source or theorem. The demonstration row pins signed receipt carrier -`d8dd1489e7a91efa309b1231f79ab6d9df4e10c2`, which binds signed implementation -snapshot `e7a0aa8a46601df22f0853c28ec26424a3874321`. The public receipt SHA-256 is -`65d00249d0d055f84d8bd34f7b8469f53f8ded66c46db49316f92b99b615bc6c`. -Final canonical registry build/check passed against the published pin, as did all fourteen registry tests and six negative fixture controls. The generated view adds one ungraded demonstration; all 48 theorem entries, their grades, admissions and the append-only theory ledger are unchanged. -Receipts remain in Proven; private bridge source is not vendored here. +`4ac09e36c6b710099b4ceadb26066a83d949dd8f`, which binds signed implementation +snapshot `8da3131d19ef2304c9a5fccc3a8f31fcfa492d7c`. The public receipt SHA-256 is +`653e399024a61d3d990cc31f1e25f052ffbe9ce26b5c84d51f9c80b642992643`. +The earlier registration passed canonical build/check, fourteen registry tests and six fixture controls. Revalidation against this updated integration receipt is pending. The generated view adds one ungraded demonstration; all 48 theorem entries, their grades, admissions and the append-only theory ledger are unchanged. +Receipts remain in Proven. The integrated lifecycle adapter uses the public pinned Idris2 SDK; no private bridge source is required or vendored here. The broader ABI's missing exports, compiler/marshaling/ownership assumptions and Rust wrapper proof obligations remain open in the home ledger. diff --git a/scripts/registry/claims-registry.mjs b/scripts/registry/claims-registry.mjs index 61ed9f6f..811a2301 100644 --- a/scripts/registry/claims-registry.mjs +++ b/scripts/registry/claims-registry.mjs @@ -33,6 +33,7 @@ import {readJsonl} from '../atlas/census-atlas.mjs'; import {validateBridges, renderBridges} from './bridges.mjs'; import {validateAdmissions, renderTheoryIndex, HOME} from './theory.mjs'; import {validateLedger, snapshot, pending, checkAppendOnly, jcs} from './theory-ledger.mjs'; +import {readEngineeringReceipt, deriveEngineering} from './engineering-receipt.mjs'; const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../..'); const claimsFile = path.join(root, 'docs/atlas/claims/claims.jsonl'); @@ -155,6 +156,10 @@ export async function loadReader(standardsDir = process.env.MATHESIS_STANDARDS) // why the grade is not higher, and `evidence` is the commit that the receipt // describes (its :source-commit), which can differ from the commit that holds it. export function derive(row, read) { + if (read?.engineering) return deriveEngineering(row, read.engineering); + if (row.kind !== 'theorem' && read?.refusal) + return {pwg: 'ungraded', reasons: [`${row.kind}, not a theorem (§8.1)`, + `the canon reader refuses the receipt: ${read.refusal}`]}; if (row.kind !== 'theorem') return {pwg: 'ungraded', reasons: [`${row.kind}, not a theorem (§8.1)`]}; if (read === null) return {pwg: 'ungraded', reasons: ['no machine receipt in the home repository']}; if (read.refusal) return {pwg: 'ungraded', reasons: [`the canon reader refuses the receipt: ${read.refusal}`]}; @@ -271,7 +276,14 @@ export async function gitChecker(standardsDir = process.env.MATHESIS_STANDARDS) } // The reader's record of one receipt text: {record, text} or {refusal}. -function readReceipt(text, row, readProofReceipt) { +async function readReceipt(text, row, readProofReceipt, receiptsDir) { + if (row.receipt.path.endsWith('.json')) { + // ADR 0006 is engineering-only; the theorem JSON prototype of ADR 0005 + // remains unwired. Invalid engineering receipts fail the build outright. + const engineering = await readEngineeringReceipt(text, + ref => loadReceipt({...row, receipt: ref}, receiptsDir)); + return {engineering, text}; + } try { return {record: readProofReceipt(text, path.basename(row.receipt.path)), text}; } catch (e) { @@ -292,7 +304,7 @@ const receiptKey = row => export async function deriveAll(rows, receiptsDir, readProofReceipt, gitCheck = null) { const once = list => [...new Map(list.map(row => [receiptKey(row), row]))]; const reads = new Map(await Promise.all(once(rows.filter(receiptKey)).map(async ([key, row]) => - [key, readReceipt(await loadReceipt(row, receiptsDir), row, readProofReceipt)]))); + [key, await readReceipt(await loadReceipt(row, receiptsDir), row, readProofReceipt, receiptsDir)]))); const derived = rows.map(row => ({row, ...derive(row, reads.get(receiptKey(row)) ?? null)})); const graded = derived.filter(d => d.pwg === 'PWG-1').map(d => d.row); const checks = new Map(await Promise.all(once(graded).map(async ([key, row]) => diff --git a/scripts/registry/engineering-receipt.mjs b/scripts/registry/engineering-receipt.mjs new file mode 100644 index 00000000..546c91bf --- /dev/null +++ b/scripts/registry/engineering-receipt.mjs @@ -0,0 +1,79 @@ +// SPDX-License-Identifier: MPL-2.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +// Engineering demonstrations have no theorem legs or PWG grade. This reader +// validates their identity, declared source binding and retained evidence, not +// the truth of an execution log or compiler correctness. See ADR 0006. +import {jcs} from './theory-ledger.mjs'; + +const need = (ok, message) => { if (!ok) throw new Error(`engineering receipt: ${message}`); }; +const object = (v, fields) => { + need(v !== null && typeof v === 'object' && !Array.isArray(v), 'expected object'); + need(Object.keys(v).length === fields.length && fields.every(k => Object.hasOwn(v, k)), 'unknown or missing field'); +}; +const string = v => { + need(typeof v === 'string' && v.length > 0 && + !/[\u0000-\u001f\u007f\uD800-\uDFFF\uFDD0-\uFDEF]/u.test(v), 'invalid string'); + for (const c of v) need((c.codePointAt(0) & 0xffff) < 0xfffe, 'invalid string'); +}; +const list = (v, check) => { + need(Array.isArray(v) && v.length > 0, 'expected nonempty array'); + v.forEach(check); +}; +const file = v => { + object(v, ['path', 'sha256']); + string(v.path); + need(/^[A-Za-z0-9_.-]+(?:\/[A-Za-z0-9_.-]+)*$/.test(v.path) && + v.path.split('/').every(p => p !== '.' && p !== '..'), 'unsafe evidence path'); + need(/^[a-f0-9]{64}$/.test(v.sha256), 'invalid evidence digest'); +}; + +export function parseEngineeringReceipt(text) { + need(typeof text === 'string' && text.length <= 1_000_000, 'invalid text size'); + let r; + try { r = JSON.parse(text); } catch { throw new Error('engineering receipt: invalid JSON'); } + need(text === jcs(r) || text === jcs(r) + '\n', 'not canonical JCS (duplicate keys and alternate encodings refused)'); + object(r, ['profile', 'schema_version', 'repository', 'source_commit', 'claim', 'kind', + 'statement', 'status_doc', 'source_inputs', 'evidence_manifest', 'checks', 'controls', + 'trusted_base', 'open_obligations']); + need(r.profile === 'engineering-receipt' && r.schema_version === '1.0.0', 'unsupported profile/version'); + need(r.kind === 'demonstration', 'engineering evidence is only a demonstration'); + for (const k of ['repository', 'source_commit', 'claim', 'statement', 'status_doc']) string(r[k]); + need(/^[-\w.]+\/[-\w.]+$/.test(r.repository), 'invalid repository'); + need(/^[a-f0-9]{40}$/.test(r.source_commit) && !/^0+$/.test(r.source_commit), 'invalid implementation source commit'); + file(r.source_inputs); + file(r.evidence_manifest); + const names = new Set(); + const check = (c, control) => { + object(c, ['name', 'checker', 'invocation', 'result', 'evidence', ...(control ? ['expect'] : [])]); + for (const k of ['name', 'checker', 'invocation']) string(c[k]); + need(!names.has(c.name), 'duplicate check/control name'); + names.add(c.name); + need(c.result === 'pass', 'failed or unexecuted check/control'); + if (control) need(c.expect === 'reject', 'negative control must expect rejection'); + file(c.evidence); + }; + list(r.checks, c => check(c, false)); + list(r.controls, c => check(c, true)); + list(r.trusted_base, string); + list(r.open_obligations, string); + return r; +} + +export async function readEngineeringReceipt(text, loadFile) { + const r = parseEngineeringReceipt(text); + // loadFile verifies each reference's SHA-256 at the SAME pinned carrier. + // Source-manifest correspondence is recorded by the producer, not re-proved + // here. No grade or successful execution is inferred merely from these hashes. + const refs = [r.source_inputs, r.evidence_manifest, ...r.checks.map(c => c.evidence), + ...r.controls.map(c => c.evidence)]; + for (const ref of refs) await loadFile(ref); + return r; +} + +export function deriveEngineering(row, r) { + need(row.kind === 'demonstration' && row.agda == null, 'cannot promote engineering evidence to a theorem'); + for (const [field, source] of [['repo', 'repository'], ['claim', 'claim'], ['statement', 'statement'], ['status_doc', 'status_doc']]) + need(row[field] === r[source], `${field} does not match the receipt`); + return {pwg: 'ungraded', evidence: r.source_commit, + reasons: ['demonstration, not a theorem (§8.1)', 'engineering identity, declared source binding and evidence digests checked; execution and source correspondence not re-proved']}; +} diff --git a/tests/registry/engineering-receipt.test.mjs b/tests/registry/engineering-receipt.test.mjs new file mode 100644 index 00000000..c68b103f --- /dev/null +++ b/tests/registry/engineering-receipt.test.mjs @@ -0,0 +1,107 @@ +// SPDX-License-Identifier: MPL-2.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +import {test, expect} from 'bun:test'; +import {mkdtemp, mkdir, writeFile, rm} from 'node:fs/promises'; +import {createHash} from 'node:crypto'; +import {tmpdir} from 'node:os'; +import path from 'node:path'; +import {derive, deriveAll} from '../../scripts/registry/claims-registry.mjs'; +import {parseEngineeringReceipt} from '../../scripts/registry/engineering-receipt.mjs'; +import {jcs} from '../../scripts/registry/theory-ledger.mjs'; + +const digest = s => createHash('sha256').update(s).digest('hex'); +const carrier = 'a'.repeat(40), implementation = 'b'.repeat(40); +const evidence = 'Retained fixture evidence\n'; +const ref = {path: 'evidence/run.log', sha256: digest(evidence)}; +const fixture = () => ({profile: 'engineering-receipt', schema_version: '1.0.0', + repository: 'o/r', source_commit: implementation, claim: 'D-1', kind: 'demonstration', + statement: 'An explicitly scoped engineering demonstration.', status_doc: 'STATUS.adoc', + source_inputs: {...ref}, evidence_manifest: {...ref}, + checks: [{name: 'implementation', checker: 'fixture-checker', invocation: 'check implementation', result: 'pass', evidence: {...ref}}], + controls: [{name: 'mutation', checker: 'fixture-checker', invocation: 'check mutant', result: 'pass', expect: 'reject', evidence: {...ref}}], + trusted_base: ['Compiler and runtime'], open_obligations: ['Implementation refinement unproved']}); +const rowFor = text => ({id: 'o/r#D-1', repo: 'o/r', claim: 'D-1', kind: 'demonstration', + statement: fixture().statement, status_doc: 'STATUS.adoc', agda: null, source_commit: carrier, + receipt: {path: 'engineering.json', sha256: digest(text)}}); +const noTheoremReader = () => { throw new Error('engineering evidence reached theorem reader'); }; + +async function withReceipt(text, action) { + const dir = await mkdtemp(path.join(tmpdir(), 'engineering-receipt-')); + const root = path.join(dir, `o__r@${carrier}`); + try { + await mkdir(path.join(root, 'evidence'), {recursive: true}); + await writeFile(path.join(root, 'engineering.json'), text); + await writeFile(path.join(root, 'evidence/run.log'), evidence); + return await action(dir, root); + } finally { await rm(dir, {recursive: true, force: true}); } +} + +test('actual registry dispatch validates engineering evidence and preserves distinct source/carrier', async () => { + const text = jcs(fixture()) + '\n'; + await withReceipt(text, async dir => { + const [d] = await deriveAll([rowFor(text)], dir, noTheoremReader); + expect(d.pwg).toBe('ungraded'); + expect(d.evidence).toBe(implementation); + expect(d.row.source_commit).toBe(carrier); + expect(d.reasons.join()).toContain('not re-proved'); + }); +}); + +test('arbitrary JSON fails registration; legacy deed refusal remains visible and ungraded', async () => { + await withReceipt('{}\n', async dir => { + await expect(deriveAll([rowFor('{}\n')], dir, noTheoremReader)).rejects.toThrow(/missing field/); + }); + const legacy = derive({...rowFor('{}'), receipt: {path: 'old_praxis.deed', sha256: 'f'.repeat(64)}}, {refusal: 'invalid deed'}); + expect(legacy.pwg).toBe('ungraded'); + expect(legacy.reasons.join()).toContain('canon reader refuses the receipt: invalid deed'); +}); + +for (const [name, mutate, message] of [ + ['wrong repository', r => {r.repository = 'o/other';}, /repo does not match/], + ['wrong claim', r => {r.claim = 'D-2';}, /claim does not match/], + ['changed statement', r => {r.statement = 'A different assertion.';}, /statement does not match/], + ['changed status document', r => {r.status_doc = 'OTHER.adoc';}, /status_doc does not match/], + ['missing implementation binding', r => {delete r.source_commit;}, /missing field/], + ['abbreviated implementation', r => {r.source_commit = 'abc';}, /source commit/], + ['zero implementation', r => {r.source_commit = '0'.repeat(40);}, /source commit/], + ['failed execution', r => {r.checks[0].result = 'fail';}, /failed or unexecuted/], + ['unrun control', r => {r.controls[0].result = 'not-run';}, /failed or unexecuted/], + ['missing controls', r => {r.controls = [];}, /nonempty array/], + ['accepting control', r => {r.controls[0].expect = 'accept';}, /expect rejection/], + ['asserted grade', r => {r.grade = 'PWG-1';}, /unknown or missing/], + ['nested grade', r => {r.checks[0].grade = 'PWG-1';}, /unknown or missing/], + ['duplicate check name', r => {r.controls[0].name = r.checks[0].name;}, /duplicate/], + ['evidence traversal', r => {r.controls[0].evidence.path = '../outside';}, /unsafe evidence path/], + ['wrong evidence digest', r => {r.controls[0].evidence.sha256 = 'f'.repeat(64);}, /digest mismatch/], +]) test(`registry refuses ${name} even with a freshly matching receipt hash`, async () => { + const r = fixture(); mutate(r); const text = jcs(r); + await withReceipt(text, async dir => { + await expect(deriveAll([rowFor(text)], dir, noTheoremReader)).rejects.toThrow(message); + }); +}); + +test('refuses absent evidence and theorem promotion through actual registry dispatch', async () => { + const text = jcs(fixture()); + await withReceipt(text, async (dir, root) => { + await expect(deriveAll([{...rowFor(text), kind: 'theorem', agda: {module: 'M', names: ['x']}}], dir, noTheoremReader)) + .rejects.toThrow(/cannot promote/); + await rm(path.join(root, 'evidence/run.log')); + await expect(deriveAll([rowFor(text)], dir, noTheoremReader)).rejects.toThrow(/ENOENT/); + }); +}); + +test('each cached receipt is checked against every referring row', async () => { + const text = jcs(fixture()); + await withReceipt(text, async dir => { + await expect(deriveAll([rowFor(text), {...rowFor(text), claim: 'D-2', id: 'o/r#D-2'}], dir, noTheoremReader)) + .rejects.toThrow(/claim does not match/); + }); +}); + +test('canonical form rejects duplicate keys, BOM, whitespace and invalid Unicode', () => { + const text = jcs(fixture()); + for (const bad of ['\uFEFF' + text, ' ' + text, text.replace('{', '{"kind":"theorem",')]) + expect(() => parseEngineeringReceipt(bad)).toThrow(); + const r = fixture(); r.statement = '\uD800'; + expect(() => parseEngineeringReceipt(jcs(r))).toThrow(/invalid string/); +}); From f2981dbb0aa5131380b79b82d70fa886047952bd Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Wed, 25 Nov 2026 08:29:37 +0000 Subject: [PATCH 3/4] Register validated engineering evidence from hosted canonical preview --- docs/atlas/generated/registry.adoc | 12 ++++++------ docs/status/ROADMAP.adoc | 25 +++++++++++++++++++------ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/docs/atlas/generated/registry.adoc b/docs/atlas/generated/registry.adoc index 7bad9522..32184144 100644 --- a/docs/atlas/generated/registry.adoc +++ b/docs/atlas/generated/registry.adoc @@ -26,7 +26,7 @@ Census: 0 at `PWG-1`, 5 at `PWG-2ii`, 31 at `PWG-2i`, 0 at `PWG-3`, 12 `ungraded |https://github.com/hyperpolymath/mathesis/blob/10f9f46ff7e1c8a0433164bc8bf6d8f30842fd4c/docs/status/PROOF-STATUS.adoc[hyperpolymath/mathesis#THY-1] at `10f9f46ff7e1`; the receipt describes `8c55804163fd` |theorem |`PWG-2ii` |In a dependency graph whose edges are guarded by features closed under Horn rules, and by an arbitrary per-target condition, a node unreachable with every feature requested is unreachable under any request, on each target (`Cargo.absent-under-all-features`). The general form is `Monotone.reach-mono`: reachability over a monotone family of edge sets is monotone. (`FeatureReachability`: `Cargo.absent-under-all-features`, `Monotone.reach-mono`) |the reader derives PWG-2ii from the legs and receipts at `8c55804163fd` -|https://github.com/hyperpolymath/proven/blob/d8dd1489e7a91efa309b1231f79ab6d9df4e10c2/docs/status/LIFECYCLE-PROOF-STATUS.adoc[hyperpolymath/proven#ABI-LC-D1] at `d8dd1489e7a9` |demonstration |`ungraded` |The production Idris lifecycle policy reaches the Linux x86_64 static and shared libraries through the Zig/RefC bridge; actual C and Rust callers observe the specified initialization, shutdown and readiness behavior, and a corrupted generated lifecycle reply is rejected with readiness false. |demonstration, not a theorem (§8.1) +|https://github.com/hyperpolymath/proven/blob/4ac09e36c6b710099b4ceadb26066a83d949dd8f/docs/status/LIFECYCLE-PROOF-STATUS.adoc[hyperpolymath/proven#ABI-LC-D1] at `4ac09e36c6b7`; the receipt describes `8da3131d19ef` |demonstration |`ungraded` |The production Idris lifecycle policy reaches the Linux x86_64 static and shared libraries through the Zig/RefC bridge; actual C and Rust callers observe the specified initialization, shutdown and readiness behavior, and a corrupted generated lifecycle reply is rejected with readiness false. |demonstration, not a theorem (§8.1); engineering identity, declared source binding and evidence digests checked; execution and source correspondence not re-proved |https://github.com/hyperpolymath/resource-algebra/blob/c31bf1a9ae9d186674c7ed79c6c9b018a1d59c2b/docs/status/PROOF-STATUS.adoc[hyperpolymath/resource-algebra#C-1] at `c31bf1a9ae9d`; the receipt describes `15fa113c7427` |theorem |`PWG-2i` |`ResourceAlgebra`: alternatives form an idempotent commutative monoid and sequencing a monoid. (`ResourceAlgebra.Core`: `ResourceAlgebra`, `IsAltMonoid.unitʳ`) |the reader derives PWG-2i from the legs and receipts at `15fa113c7427` @@ -96,11 +96,11 @@ Census: 0 at `PWG-1`, 5 at `PWG-2ii`, 31 at `PWG-2i`, 0 at `PWG-3`, 12 `ungraded |https://github.com/hyperpolymath/secret-types/blob/4ed067220f1357b37f7d54c5ae0690ff35b292bd/PROOF-STATUS.adoc[hyperpolymath/secret-types#N-3] at `4ed067220f13` |theorem |`ungraded` |Confinement: under a secret program counter the public variable is unchanged, loops included (`SecretTypes.Noninterference`: `confine`) |the canon reader refuses the receipt: claim "N-1" records :pwg PWG-1, but its legs and receipts support PWG-2ii (PROOF-POLICY §8.2, §8.4) -|https://github.com/hyperpolymath/secret-types/blob/4ed067220f1357b37f7d54c5ae0690ff35b292bd/PROOF-STATUS.adoc[hyperpolymath/secret-types#N-4] at `4ed067220f13` |demonstration |`ungraded` |The typing side-condition is load-bearing: an explicit and an implicit flow are each refused and each actually leaks |demonstration, not a theorem (§8.1) +|https://github.com/hyperpolymath/secret-types/blob/4ed067220f1357b37f7d54c5ae0690ff35b292bd/PROOF-STATUS.adoc[hyperpolymath/secret-types#N-4] at `4ed067220f13` |demonstration |`ungraded` |The typing side-condition is load-bearing: an explicit and an implicit flow are each refused and each actually leaks |demonstration, not a theorem (§8.1); the canon reader refuses the receipt: claim "N-1" records :pwg PWG-1, but its legs and receipts support PWG-2ii (PROOF-POLICY §8.2, §8.4) -|https://github.com/hyperpolymath/secret-types/blob/4ed067220f1357b37f7d54c5ae0690ff35b292bd/PROOF-STATUS.adoc[hyperpolymath/secret-types#N-5] at `4ed067220f13` |demonstration |`ungraded` |Termination-insensitivity is real, not vacuous: a well-typed program spins on one secret and stops on another |demonstration, not a theorem (§8.1) +|https://github.com/hyperpolymath/secret-types/blob/4ed067220f1357b37f7d54c5ae0690ff35b292bd/PROOF-STATUS.adoc[hyperpolymath/secret-types#N-5] at `4ed067220f13` |demonstration |`ungraded` |Termination-insensitivity is real, not vacuous: a well-typed program spins on one secret and stops on another |demonstration, not a theorem (§8.1); the canon reader refuses the receipt: claim "N-1" records :pwg PWG-1, but its legs and receipts support PWG-2ii (PROOF-POLICY §8.2, §8.4) -|https://github.com/hyperpolymath/secret-types/blob/4ed067220f1357b37f7d54c5ae0690ff35b292bd/PROOF-STATUS.adoc[hyperpolymath/secret-types#N-6] at `4ed067220f13` |demonstration |`ungraded` |Laws census: generic TINI uses exactly the two upper-bound laws and the observer's down-closure (law-ablation certificate) |demonstration, not a theorem (§8.1) +|https://github.com/hyperpolymath/secret-types/blob/4ed067220f1357b37f7d54c5ae0690ff35b292bd/PROOF-STATUS.adoc[hyperpolymath/secret-types#N-6] at `4ed067220f13` |demonstration |`ungraded` |Laws census: generic TINI uses exactly the two upper-bound laws and the observer's down-closure (law-ablation certificate) |demonstration, not a theorem (§8.1); the canon reader refuses the receipt: claim "N-1" records :pwg PWG-1, but its legs and receipts support PWG-2ii (PROOF-POLICY §8.2, §8.4) |https://github.com/hyperpolymath/secret-types/blob/4ed067220f1357b37f7d54c5ae0690ff35b292bd/PROOF-STATUS.adoc[hyperpolymath/secret-types#N-7] at `4ed067220f13` |theorem |`ungraded` |TINI over the Lattice record: for every variable set with decidable equality, lattice, labelling and down-closed observer, two finishing runs of a well-typed command from stores agreeing on what the observer sees end agreeing on it (`SecretTypes.Noninterference.Generic`: `tini`) |the canon reader refuses the receipt: claim "N-1" records :pwg PWG-1, but its legs and receipts support PWG-2ii (PROOF-POLICY §8.2, §8.4) @@ -108,7 +108,7 @@ Census: 0 at `PWG-1`, 5 at `PWG-2ii`, 31 at `PWG-2i`, 0 at `PWG-3`, 12 `ungraded |https://github.com/hyperpolymath/secret-types/blob/4ed067220f1357b37f7d54c5ae0690ff35b292bd/PROOF-STATUS.adoc[hyperpolymath/secret-types#N-9] at `4ed067220f13` |theorem |`ungraded` |If an observer sees finishing versus not finishing, termination-sensitive noninterference is false for the current typing rules (`SecretTypes.Noninterference.OutcomeVisibility`: `termination-sensitive-fails`) |the canon reader refuses the receipt: claim "N-1" records :pwg PWG-1, but its legs and receipts support PWG-2ii (PROOF-POLICY §8.2, §8.4) -|https://github.com/metadatastician/lintel/blob/d7bdc21a1264f08d7b4368f5d5dadc163630a1bc/docs/status/PROOF-STATUS.adoc[metadatastician/lintel#A-1] at `d7bdc21a1264` |assumption |`ungraded` |Non-collusion: no party holds both the proxy and the target role (the gap is proved: collusion-gap) |assumption, not a theorem (§8.1) +|https://github.com/metadatastician/lintel/blob/d7bdc21a1264f08d7b4368f5d5dadc163630a1bc/docs/status/PROOF-STATUS.adoc[metadatastician/lintel#A-1] at `d7bdc21a1264` |assumption |`ungraded` |Non-collusion: no party holds both the proxy and the target role (the gap is proved: collusion-gap) |assumption, not a theorem (§8.1); the canon reader refuses the receipt: line 12: identity field :repo-uuid carries a #u5 literal; write #uuid"" or #u8"domain:name" (owner ruling Q2, CHORA-SPEC 7.1) |https://github.com/metadatastician/lintel/blob/d7bdc21a1264f08d7b4368f5d5dadc163630a1bc/docs/status/PROOF-STATUS.adoc[metadatastician/lintel#L-1] at `d7bdc21a1264` |theorem |`ungraded` |A lattice, not just a poset: ⊑ is a decidable partial order, ⊔ and ⊓ are least upper and greatest lower bounds, anyone is least and no-one greatest (`Lintel.Lattice`: `⊑-refl`, `⊑-trans`, `⊑-antisym`, `⊔-upper₁`, `⊔-upper₂`, `⊔-least`, `⊓-lower₁`, `⊓-lower₂`, `⊓-greatest`, `anyone-least`, `no-one-greatest`, `no-one-⋢-anyone`, `_⊑?_`) |the canon reader refuses the receipt: line 12: identity field :repo-uuid carries a #u5 literal; write #uuid"" or #u8"domain:name" (owner ruling Q2, CHORA-SPEC 7.1) @@ -118,7 +118,7 @@ Census: 0 at `PWG-1`, 5 at `PWG-2ii`, 31 at `PWG-2i`, 0 at `PWG-3`, 12 `ungraded |https://github.com/metadatastician/lintel/blob/d7bdc21a1264f08d7b4368f5d5dadc163630a1bc/docs/status/PROOF-STATUS.adoc[metadatastician/lintel#L-4] at `d7bdc21a1264` |theorem |`ungraded` |Address and query name each reach their own role; composed, only the client may observe them (`Lintel.Lattice`: `address-to-proxy`, `qname-to-target`, `link`, `link-confined`) |the canon reader refuses the receipt: line 12: identity field :repo-uuid carries a #u5 literal; write #uuid"" or #u8"domain:name" (owner ruling Q2, CHORA-SPEC 7.1) -|https://github.com/metadatastician/lintel/blob/d7bdc21a1264f08d7b4368f5d5dadc163630a1bc/docs/status/PROOF-STATUS.adoc[metadatastician/lintel#L-5] at `d7bdc21a1264` |demonstration |`ungraded` |The typechecker refuses the self-defeating compositions and accepts the client's |demonstration, not a theorem (§8.1) +|https://github.com/metadatastician/lintel/blob/d7bdc21a1264f08d7b4368f5d5dadc163630a1bc/docs/status/PROOF-STATUS.adoc[metadatastician/lintel#L-5] at `d7bdc21a1264` |demonstration |`ungraded` |The typechecker refuses the self-defeating compositions and accepts the client's |demonstration, not a theorem (§8.1); the canon reader refuses the receipt: line 12: identity field :repo-uuid carries a #u5 literal; write #uuid"" or #u8"domain:name" (owner ruling Q2, CHORA-SPEC 7.1) |https://github.com/metadatastician/lintel/blob/d7bdc21a1264f08d7b4368f5d5dadc163630a1bc/docs/status/PROOF-STATUS.adoc[metadatastician/lintel#L-6] at `d7bdc21a1264` |theorem |`ungraded` |tini holds at this lattice over the address, the query name and the client's local state, for each role's observer and for any two roles observing together (`Lintel.Instance`: `tini-per-role`, `tini-coalition`) |the canon reader refuses the receipt: line 12: identity field :repo-uuid carries a #u5 literal; write #uuid"" or #u8"domain:name" (owner ruling Q2, CHORA-SPEC 7.1) diff --git a/docs/status/ROADMAP.adoc b/docs/status/ROADMAP.adoc index f50d9cbd..8e9aef0c 100644 --- a/docs/status/ROADMAP.adoc +++ b/docs/status/ROADMAP.adoc @@ -19,13 +19,26 @@ controls. The home ledger is `docs/status/LIFECYCLE-PROOF-STATUS.adoc`, claim `ABI-LC-D1`. These are engineering proofs and an execution demonstration; no Agda/Rocq/Lean theory grade is assigned or implied. -Six fixture-only engineering-receipt checks and fourteen existing claims-registry -tests passed with the exact pinned reader. They registered no source or theorem. The demonstration row pins signed receipt carrier -`4ac09e36c6b710099b4ceadb26066a83d949dd8f`, which binds signed implementation -snapshot `8da3131d19ef2304c9a5fccc3a8f31fcfa492d7c`. The public receipt SHA-256 is -`653e399024a61d3d990cc31f1e25f052ffbe9ce26b5c84d51f9c80b642992643`. -The earlier registration passed canonical build/check, fourteen registry tests and six fixture controls. Revalidation against this updated integration receipt is pending. The generated view adds one ungraded demonstration; all 48 theorem entries, their grades, admissions and the append-only theory ledger are unchanged. +`4ac09e36c6b710099b4ceadb26066a83d949dd8f`, which binds implementation +`8da3131d19ef2304c9a5fccc3a8f31fcfa492d7c`. The canonical engineering receipt +SHA-256 is `653e399024a61d3d990cc31f1e25f052ffbe9ce26b5c84d51f9c80b642992643`. + +Review exposed that the old non-theorem shortcut discarded JSON-parser refusal. +The earlier six external fixtures did not establish semantic binding. ADR 0006 +adds a closed engineering profile and validates identity, declared implementation +binding, successful checks, rejecting controls and retained evidence digests. +Invalid engineering JSON stops registration; legacy deed refusals stay ungraded +and are now visible. No theorem JSON grading prototype is enabled. + +Hosted run 45576263195 passed the real canonical build/check and all 97 registry +tests, including 21 engineering regression cases. The unchanged-checkout gate +then correctly refused the stale committed view. This update imports only the +canon-generated registry from that retained preview. All 48 theorem entries and +their grades, the bridges, admissions and append-only theory ledger are unchanged. +The updated view displays the existing Secret Types and Lintel deed refusals on their ungraded +demonstrations and the distinct implementation/carrier binding for Proven. + Receipts remain in Proven. The integrated lifecycle adapter uses the public pinned Idris2 SDK; no private bridge source is required or vendored here. The broader ABI's missing exports, compiler/marshaling/ownership assumptions and Rust wrapper proof obligations remain open in the home ledger. From 33ab4ca55c1a22a2577e9788e7c7efab6094c255 Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Wed, 25 Nov 2026 08:46:41 +0000 Subject: [PATCH 4/4] Verify receipt and evidence digests before decoding bytes --- .github/workflows/proven-tests.yml | 6 +-- scripts/registry/claims-registry.mjs | 22 +++++--- tests/registry/engineering-receipt.test.mjs | 58 +++++++++++++++++++++ 3 files changed, 75 insertions(+), 11 deletions(-) diff --git a/.github/workflows/proven-tests.yml b/.github/workflows/proven-tests.yml index 6374af90..83d37193 100644 --- a/.github/workflows/proven-tests.yml +++ b/.github/workflows/proven-tests.yml @@ -87,12 +87,12 @@ jobs: cd "$source" sha256sum scripts/registry/*.mjs tests/registry/*.mjs docs/atlas/claims/*.jsonl > "$preview/inputs.sha256" bun scripts/registry/claims-registry.mjs build 2>&1 | tee "$preview/build.log" - bun scripts/registry/claims-registry.mjs check 2>&1 | tee "$preview/check.log" - bun test tests/registry/ 2>&1 | tee "$preview/tests.log" - sha256sum --check --quiet "$preview/inputs.sha256" cp docs/atlas/generated/registry.adoc "$preview/registry.adoc" cp docs/atlas/generated/bridges.adoc "$preview/bridges.adoc" cp docs/theory/generated/index.adoc "$preview/theory-index.adoc" + bun scripts/registry/claims-registry.mjs check 2>&1 | tee "$preview/check.log" + bun test tests/registry/ 2>&1 | tee "$preview/tests.log" + sha256sum --check --quiet "$preview/inputs.sha256" - name: Retain registry preview and regression evidence if: always() uses: actions/upload-artifact@v7.0.2 diff --git a/scripts/registry/claims-registry.mjs b/scripts/registry/claims-registry.mjs index 811a2301..24ae0af3 100644 --- a/scripts/registry/claims-registry.mjs +++ b/scripts/registry/claims-registry.mjs @@ -177,20 +177,26 @@ export function derive(row, read) { // ── Fetching receipts at their pinned commits ──────────────────────────────── -// Return the receipt text for a row, verified against its sha256. -async function loadReceipt(row, receiptsDir) { - let text; +// Hash the original bytes: replacement UTF-8 decoding is not injective. +async function loadReceiptBytes(row, receiptsDir) { + let bytes; if (receiptsDir) { - text = await readFile(path.join(receiptsDir, `${row.repo.replace('/', '__')}@${row.source_commit}`, row.receipt.path), 'utf8'); + bytes = await readFile(path.join(receiptsDir, `${row.repo.replace('/', '__')}@${row.source_commit}`, row.receipt.path)); } else { const url = `https://raw.githubusercontent.com/${row.repo}/${row.source_commit}/${row.receipt.path}`; const res = await fetch(url); if (!res.ok) throw new Error(`could not fetch ${url}: HTTP ${res.status}`); - text = await res.text(); + bytes = new Uint8Array(await res.arrayBuffer()); } - const digest = createHash('sha256').update(text).digest('hex'); + const digest = createHash('sha256').update(bytes).digest('hex'); if (digest !== row.receipt.sha256) throw new Error(`receipt digest mismatch for ${row.id}: pinned ${row.receipt.sha256}, got ${digest}`); - return text; + return bytes; +} + +// Only receipts require text; evidence may contain arbitrary binary bytes. +async function loadReceipt(row, receiptsDir) { + const bytes = await loadReceiptBytes(row, receiptsDir); + return new TextDecoder('utf-8', {fatal: true, ignoreBOM: true}).decode(bytes); } // ── The git checks of PROOF-POLICY §8.5.3 ──────────────────────────────────── @@ -281,7 +287,7 @@ async function readReceipt(text, row, readProofReceipt, receiptsDir) { // ADR 0006 is engineering-only; the theorem JSON prototype of ADR 0005 // remains unwired. Invalid engineering receipts fail the build outright. const engineering = await readEngineeringReceipt(text, - ref => loadReceipt({...row, receipt: ref}, receiptsDir)); + ref => loadReceiptBytes({...row, receipt: ref}, receiptsDir)); return {engineering, text}; } try { diff --git a/tests/registry/engineering-receipt.test.mjs b/tests/registry/engineering-receipt.test.mjs index c68b103f..db6b7b2e 100644 --- a/tests/registry/engineering-receipt.test.mjs +++ b/tests/registry/engineering-receipt.test.mjs @@ -105,3 +105,61 @@ test('canonical form rejects duplicate keys, BOM, whitespace and invalid Unicode const r = fixture(); r.statement = '\uD800'; expect(() => parseEngineeringReceipt(jcs(r))).toThrow(/invalid string/); }); + +for (const transport of ['local', 'fetch']) { + async function withBytes(receiptBytes, evidenceBytes, action) { + if (transport === 'local') return withReceipt(receiptBytes, async (dir, root) => { + await writeFile(path.join(root, 'evidence/run.log'), evidenceBytes); + return action(dir); + }); + const originalFetch = globalThis.fetch; + globalThis.fetch = async url => { + const prefix = `https://raw.githubusercontent.com/o/r/${carrier}/`; + expect(String(url).startsWith(prefix)).toBe(true); + const file = String(url).slice(prefix.length); + if (file === 'engineering.json') return new Response(receiptBytes); + if (file === 'evidence/run.log') return new Response(evidenceBytes); + throw new Error(`unexpected fixture request: ${url}`); + }; + try { return await action(null); } + finally { globalThis.fetch = originalFetch; } + } + + const withEvidenceHash = bytes => { + const r = fixture(); + for (const ref of [r.source_inputs, r.evidence_manifest, r.checks[0].evidence, r.controls[0].evidence]) + ref.sha256 = digest(bytes); + return jcs(r); + }; + + test(`${transport}: binary evidence is verified without text decoding`, async () => { + const bytes = new Uint8Array([0xff, 0x00, 0x80]); + const text = withEvidenceHash(bytes); + await withBytes(text, bytes, async dir => { + const [d] = await deriveAll([rowFor(text)], dir, noTheoremReader); + expect(d.pwg).toBe('ungraded'); + expect(d.evidence).toBe(implementation); + }); + }); + + test(`${transport}: replacement-decoding collisions fail the raw digest`, async () => { + const text = withEvidenceHash(new Uint8Array([0xef, 0xbf, 0xbd])); + await withBytes(text, new Uint8Array([0xff]), async dir => { + await expect(deriveAll([rowFor(text)], dir, noTheoremReader)).rejects.toThrow(/digest mismatch/); + }); + }); + + test(`${transport}: digest-matching invalid UTF-8 receipt is refused`, async () => { + const bytes = new Uint8Array([0xff]); + await withBytes(bytes, evidence, async dir => { + await expect(deriveAll([rowFor(bytes)], dir, noTheoremReader)).rejects.toThrow(); + }); + }); + + test(`${transport}: receipt BOM survives decoding and is refused by the canonical reader`, async () => { + const text = '\uFEFF' + jcs(fixture()); + await withBytes(text, evidence, async dir => { + await expect(deriveAll([rowFor(text)], dir, noTheoremReader)).rejects.toThrow(); + }); + }); +}