diff --git a/.github/workflows/proofs.yml b/.github/workflows/proofs.yml index 76b2806e..0b249d6b 100644 --- a/.github/workflows/proofs.yml +++ b/.github/workflows/proofs.yml @@ -20,6 +20,12 @@ concurrency: env: LANG: C.UTF-8 LC_ALL: C.UTF-8 +# A job with a container: runs its steps with sh, not bash, unless told; the +# images here (Debian 13, Ubuntu 24.04) both ship bash, and steps use set -o +# pipefail. GitHub runs bash as `bash --noprofile --norc -eo pipefail {0}`. +defaults: + run: + shell: bash jobs: proofs: name: Lattice laws, pinned sibling, controls and expected rejections @@ -30,7 +36,7 @@ jobs: - name: Install the pinned prover run: | apt-get update - apt-get install --no-install-recommends -y ca-certificates git agda-bin=2.6.4.3-1+b2 + apt-get install --no-install-recommends -y ca-certificates curl git agda-bin=2.6.4.3-1+b2 - name: Checkout uses: actions/checkout@v7.0.1 with: @@ -50,31 +56,46 @@ jobs: - name: Fetch siblings at their pinned commits run: bash scripts/fetch-siblings.sh - name: Proof gate - run: bash scripts/check.sh - # The receipt names the gate, its flags, the claim PWGs and the hashed - # import cone (PROOF-POLICY §8). A committed receipt that no longer - # matches the tree fails here. - - name: Verification receipt matches the tree and the claim list - run: bash scripts/grade-receipt.sh --check - - name: Emit the receipt for this commit + run: bash scripts/check.sh | tee "$RUNNER_TEMP/agda-proof.log" + - name: Fetch the pinned tools of the standard + run: bash scripts/grade-receipt.sh --fetch-standards + # PROOF-POLICY §8.4 and §8.5.1: the receipt's trusted base and Agda input + # set must be exactly what the pinned Agda reports for the graded root. + - name: Receipt trusted base and Agda cone match the prover + run: bash scripts/check-trusted-base.sh + # The image is read from this job's own container line, so the row names + # the image the checker ran in (pattern: secret-types#57). An empty read + # fails here: a row without an image would silently never count toward + # PWG-1. A one-entry matrix would rename this job's check. + - name: Record image-bound run rows in the job log run: | - bash scripts/grade-receipt.sh --write --commit "$(git rev-parse --short=12 HEAD)" - sed -n '1,40p' verification/receipts/agda-pwg_praxis.deed + git config --global --add safe.directory "$GITHUB_WORKSPACE" + CHECKER_IMAGE="$(sed -n '/^ proofs:$/,/^ [a-z][a-z-]*:$/{s/^ container: *//p}' .github/workflows/proofs.yml)" + [[ "$CHECKER_IMAGE" == *@sha256:* ]] || { echo "no pinned container image for the proofs job" >&2; exit 1; } + bash scripts/grade-receipt.sh --run-row agda \ + --run "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID/attempts/$GITHUB_RUN_ATTEMPT" \ + --commit "$(git rev-parse HEAD)" --checker "$(agda --version)" \ + --reported "$(grep '^PASS: Lintel proofs,' "$RUNNER_TEMP/agda-proof.log")" \ + --axioms none --image "$CHECKER_IMAGE" # The Rocq and Lean recheck legs (PROOF-POLICY §2), re-proved by hand on top # of secret-types' own legs at the sibling pin (verification/legs/README.adoc # gives the route and the statement correspondence). Both provers are pinned: # Coq by its Ubuntu package version, Lean by its release tarball's sha256. # Neither leg may depend on anything but secret-types' leg, nor rest on an - # axiom; scripts/check-legs.sh refuses either. + # axiom; scripts/check-legs.sh refuses either. The job runs in an image + # pinned by its digest, so the checker is isolated in the sense of + # PROOF-POLICY §8.2 (owner ruling 2026-11-16): a bare runner's image can + # change underneath a version-pinned prover. legs: name: Rocq and Lean recheck legs (no axioms, no libraries) runs-on: ubuntu-24.04 timeout-minutes: 30 + container: ubuntu:24.04@sha256:73b999393d07f2bf65a40373778a44dc9a6d54ad7718d29247d8ff9413c4d6a8 steps: - name: Install the pinned Coq run: | - sudo apt-get update - sudo apt-get install --no-install-recommends -y coq=8.18.0+dfsg-1build2 zstd + apt-get update + apt-get install --no-install-recommends -y ca-certificates curl git zstd coq=8.18.0+dfsg-1build2 - name: Install the pinned Lean (release tarball, sha256-checked) env: LEAN_URL: https://github.com/leanprover/lean4/releases/download/v4.24.0/lean-4.24.0-linux.tar.zst @@ -92,7 +113,58 @@ jobs: persist-credentials: false - name: Leg diagnostics and correspondence self-test run: bash tests/legs-receipt-test.sh + - name: Recheck gate self-test (escape hatches, pins, axiom lines) + run: bash tests/check-legs-test.sh - name: Fetch siblings at their pinned commits run: bash scripts/fetch-siblings.sh - name: Both legs check, with no axioms - run: bash scripts/check-legs.sh + run: bash scripts/check-legs.sh | tee "$RUNNER_TEMP/legs-proof.log" + - name: Fetch the pinned tools of the standard + run: bash scripts/grade-receipt.sh --fetch-standards + # As in the proofs job: the image is read from this job's container line. + - name: Record image-bound run rows in the job log + run: | + git config --global --add safe.directory "$GITHUB_WORKSPACE" + CHECKER_IMAGE="$(sed -n '/^ legs:$/,/^ [a-z][a-z-]*:$/{s/^ container: *//p}' .github/workflows/proofs.yml)" + [[ "$CHECKER_IMAGE" == *@sha256:* ]] || { echo "no pinned container image for the legs job" >&2; exit 1; } + for prover in rocq lean; do + case "$prover" in + rocq) checker="$(coqc --version | head -n 1)"; reported="$(grep '^PASS: Rocq leg ' "$RUNNER_TEMP/legs-proof.log")" ;; + lean) checker="$(lean --version)"; reported="$(grep '^PASS: Lean leg ' "$RUNNER_TEMP/legs-proof.log")" ;; + esac + bash scripts/grade-receipt.sh --run-row "$prover" \ + --run "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID/attempts/$GITHUB_RUN_ATTEMPT" \ + --commit "$(git rev-parse HEAD)" --checker "$checker" \ + --reported "$reported" --axioms none --image "$CHECKER_IMAGE" + done + # The proof receipt (PROOF-POLICY §8.5): the pinned reader of the standard + # derives each grade, the shared git checker does the checks of §8.5.3, and + # every current receipt must still describe this commit. The git checks read + # the history, so the checkout is full. Bun is the release zip, pinned by + # sha256 (the digest oven-sh publishes in SHASUMS256.txt for v1.4.2). + receipt: + name: Proof receipt (reader, git checks, currency) + runs-on: ubuntu-24.04 + timeout-minutes: 15 + steps: + - name: Install the pinned Bun (release zip, sha256-checked) + env: + BUN_URL: https://github.com/oven-sh/bun/releases/download/bun-v1.4.2/bun-linux-x64.zip + BUN_SHA256: 36368faef7527875d5ffa52e53cd48021741f2a83eb6208a8dd64068d422a913 + run: | + set -euo pipefail + curl --proto '=https' --proto-redir '=https' --tlsv1.2 -fsSL "$BUN_URL" -o "$RUNNER_TEMP/bun.zip" + echo "$BUN_SHA256 $RUNNER_TEMP/bun.zip" | sha256sum --check --strict + unzip -q "$RUNNER_TEMP/bun.zip" -d "$RUNNER_TEMP/bun" + echo "$RUNNER_TEMP/bun/bun-linux-x64" >> "$GITHUB_PATH" + - name: Checkout (full history) + uses: actions/checkout@v7.0.1 + with: + persist-credentials: false + fetch-depth: 0 + - name: Fetch siblings at their pinned commits + run: bash scripts/fetch-siblings.sh + - name: Fetch the pinned tools of the standard + run: bash scripts/grade-receipt.sh --fetch-standards + - name: The receipt holds + run: bash scripts/grade-receipt.sh --check diff --git a/README.adoc b/README.adoc index 20cf8fdd..05302d90 100644 --- a/README.adoc +++ b/README.adoc @@ -153,21 +153,26 @@ runs `scripts/fetch-siblings.sh` then `scripts/check.sh`), and so does the `Agda proofs` workflow: Agda 2.6.4.3 with the flags of `scripts/proof-flags.sh`, the canonical `--safe --without-K --cubical-compatible` (`PROOF-POLICY.adoc` §2.1) and `--no-libraries --ignore-interfaces --double-check -W error` besides, -secret-types pinned at `45046c2`. - -*Grade.* The PROVEN claims (L-1 to L-4, L-6, L-7) are at Proof Witness Grade -**`PWG-2ii`** (`PROOF-POLICY.adoc` §8) and no higher. Each is also re-proved by -hand in Rocq (Coq 8.18.0) and in Lean (4.24.0, no Mathlib), on top of -secret-types' own legs at the same pin, with no axioms in either. The statements -are compared in link:verification/legs/README.adoc[`verification/legs/README.adoc`]; -Claude Code wrote that comparison, and it is provisional until the owner reviews -it. `bash scripts/check-legs.sh` checks both legs. Not `PWG-1`: no per-commit -receipt captures each checker's observed result yet. -L-5 is a set of checked refusals and A-1 an assumption; neither is a theorem, so -neither is graded. The machine record is -link:verification/receipts/agda-pwg_praxis.deed[`verification/receipts/agda-pwg_praxis.deed`], -generated by `scripts/grade-receipt.sh` and checked in CI, and the per-claim -record is link:docs/status/PROOF-STATUS.adoc[`docs/status/PROOF-STATUS.adoc`]. +secret-types pinned at `9fb8430`, its `main`. + +*Grade.* Each PROVEN claim (L-1 to L-4, L-6, L-7) is also re-proved by hand in +Rocq (Coq 8.18.0) and in Lean (4.24.0, no Mathlib), on top of secret-types' own +legs at the same pin, with no axioms in either. The statements are compared in +link:verification/legs/README.adoc[`verification/legs/README.adoc`]; Claude Code +wrote that comparison, and it is provisional until the owner reviews it: the two +recheck legs, and so the grade, rest on it. `bash scripts/check-legs.sh` checks +both legs. The grade is derived from the receipt, never stated here +(`PROOF-POLICY.adoc` §8). The re-pin of secret-types to `9fb8430` changed every +leg's inputs, so the receipt grades nothing until the first run on `main` after +it is recorded. That run checks the Agda in a digest-pinned Debian image and both +legs in a digest-pinned Ubuntu image (isolated, §8.2), so its receipt can derive +`PWG-1`. The runs before it, on `89ceac3`, checked the legs on a bare runner, +which supports `PWG-2ii` at most. L-5 is a set of checked refusals and A-1 an +assumption; neither is a theorem, so neither is graded. The machine record is +link:verification/receipts/agda-pwg_praxis.deed[`verification/receipts/agda-pwg_praxis.deed`] +(PROOF-POLICY §8.5.1), written and checked in CI by `scripts/grade-receipt.sh` with +the standard's shared generator; the per-claim record is +link:docs/status/PROOF-STATUS.adoc[`docs/status/PROOF-STATUS.adoc`]. == Licence diff --git a/docs/status/PROOF-NEEDS.adoc b/docs/status/PROOF-NEEDS.adoc index f256d30c..08dd7423 100644 --- a/docs/status/PROOF-NEEDS.adoc +++ b/docs/status/PROOF-NEEDS.adoc @@ -62,9 +62,9 @@ rechecked in Rocq and in Lean, with no Mathlib (`standards/3-practice/PROOF-POLI |=== | # | Proof Needed | Category | Prover | Priority | File(s) -| L-1 to L-4 | The reader-set lattice: laws, reverse inclusion, the link's confinement | DOM | Agda, Rocq, Lean (done, `PWG-2ii`) | — | `src/Lintel/Lattice.agda` -| L-6 | TINI at this lattice, per role and per coalition | SEC | Agda, Rocq, Lean (done, `PWG-2ii`) | — | `src/Lintel/Instance.agda` -| L-7 | Self-defeating compositions cannot be built as programs | SEC | Agda, Rocq, Lean (done, `PWG-2ii`) | — | `src/Lintel/Composition.agda` +| L-1 to L-4 | The reader-set lattice: laws, reverse inclusion, the link's confinement | DOM | Agda, Rocq, Lean (done; graded by the next recorded run) | — | `src/Lintel/Lattice.agda` +| L-6 | TINI at this lattice, per role and per coalition | SEC | Agda, Rocq, Lean (done; graded by the next recorded run) | — | `src/Lintel/Instance.agda` +| L-7 | Self-defeating compositions cannot be built as programs | SEC | Agda, Rocq, Lean (done; graded by the next recorded run) | — | `src/Lintel/Composition.agda` | R-1 | Rocq leg for L-1 to L-4, L-6, L-7 (§2) | DOM/SEC | Rocq | done | `verification/legs/rocq/Lintel.v` | R-2 | Lean leg for L-1 to L-4, L-6, L-7 (§2), no Mathlib | DOM/SEC | Lean | done | `verification/legs/lean/` |=== diff --git a/docs/status/PROOF-STATUS.adoc b/docs/status/PROOF-STATUS.adoc index f2bdb2dd..9d29e6bd 100644 --- a/docs/status/PROOF-STATUS.adoc +++ b/docs/status/PROOF-STATUS.adoc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) Jonathan D.A. Jewell = Proof Status — Lintel -:revdate: 2026-11-09 +:revdate: 2026-11-17 This is Lintel's proof-status file in the sense of `standards/3-practice/PROOF-POLICY.adoc` §8.5: the per-claim record of status @@ -9,8 +9,17 @@ tokens, Proof Witness Grades (PWG) and recheck legs. The claims themselves, with their statements and artefacts, are the table in link:../../README.adoc[README] (L-1 to L-7, A-1). The machine copy is link:../../verification/receipts/agda-pwg_praxis.deed[`verification/receipts/agda-pwg_praxis.deed`], -generated by `scripts/grade-receipt.sh`; CI fails if it drifts from the tree, the -import cone or the README's claim IDs. +a §8.5.1 proof receipt. `scripts/grade-receipt.sh` holds Lintel's ledgers and +hooks and writes it with the standard's shared generator +(`scripts/proof-receipt.sh`, pinned with the reader, the reference digest and the +git checker at one standards commit), deriving every manifest, digest, import and +grade from git. Its `--check` (the `receipt` job of the `Agda proofs` +workflow) runs the pinned reader, the git checks of §8.5.3 and a currency check, +and compares two sets of claim IDs: the IDs in this table must be the +receipt's claims, and the claims with a `RECONCILED` leg in +`verification/legs/README.adoc` must be those the receipt records as +`RECONCILED`. It compares IDs only. This table's tokens and grade cells are +written by hand, and nothing checks them against the receipt yet. Until 2026-11-09 this file was the RSR template's placeholder ("0% proven", Idris ABI rows). That never described this repository. The README's claim table was @@ -25,7 +34,7 @@ sibling, under the flags of `scripts/proof-flags.sh`: flags. `scripts/check.sh` checks, in order: . coverage: every module under `src/Lintel` is imported by `Lintel.All`; -. the sibling at its pin, `hyperpolymath/secret-types` `45046c2`, all of +. the sibling at its pin, `hyperpolymath/secret-types` `9fb8430` (its `main`), all of `SecretTypes.All` under the same flags; . `Lintel.All`; . the 5 positive controls under `tests/accept`; @@ -34,8 +43,9 @@ flags. `scripts/check.sh` checks, in order: . a negative control: the rejection check, pointed at each positive control, reports it accepted, so step 5 cannot pass vacuously. -Trust base: no postulates, no escape hatches, no library, no axioms (`--safe`, and -the counts in the receipt). A-1 is a hypothesis of the threat model, not an axiom +Trust base: no postulates, no escape hatches, no library, no axioms (`--safe`). +The receipt's `(trusted-base …)` lists the prover's own postulates in the cone: +`Level`, `lzero`, `lsuc` and `_⊔_` of `Agda.Primitive`, each BUILTIN-bound (§8.4). A-1 is a hypothesis of the threat model, not an axiom of any proof: no proof assumes it, and `Lintel.Instance.collusion-gap` proves what happens without it. @@ -45,13 +55,13 @@ what happens without it. |=== | Claim | Token | PWG | Rocq leg | Lean leg | Note -| L-1 | proven | `PWG-2ii` | re-proved | re-proved | `Lintel.Lattice` -| L-2 | proven | `PWG-2ii` | re-proved | re-proved | `Lintel.Lattice` -| L-3 | proven | `PWG-2ii` | re-proved | re-proved | `Lintel.Lattice`, packed as `Lintel.Instance.reader-sets` -| L-4 | proven | `PWG-2ii` | re-proved | re-proved | `Lintel.Lattice` +| L-1 | proven | ungraded until the next run | re-proved | re-proved | `Lintel.Lattice` +| L-2 | proven | ungraded until the next run | re-proved | re-proved | `Lintel.Lattice` +| L-3 | proven | ungraded until the next run | re-proved | re-proved | `Lintel.Lattice`, packed as `Lintel.Instance.reader-sets` +| L-4 | proven | ungraded until the next run | re-proved | re-proved | `Lintel.Lattice` | L-5 | tested-only | n/a | n/a | n/a | Checked refusals and acceptances; not a theorem (§8.1) -| L-6 | proven | `PWG-2ii` | re-proved | re-proved | `Lintel.Instance`; rests on secret-types N-7, itself `PWG-2ii` at the pin -| L-7 | proven | `PWG-2ii` | re-proved | re-proved | `Lintel.Composition` +| L-6 | proven | ungraded until the next run | re-proved | re-proved | `Lintel.Instance`; rests on secret-types N-7 at the pin; the receipt lists those files as `(import …)` once a current run is recorded (none is yet) +| L-7 | proven | ungraded until the next run | re-proved | re-proved | `Lintel.Composition` | A-1 | argued | n/a | n/a | n/a | An assumption; its gap is proved (`collusion-gap`) |=== @@ -73,12 +83,37 @@ link:../../verification/legs/README.adoc[`verification/legs/README.adoc`]. Every row is `RECONCILED`. Claude Code wrote the comparison, and it is provisional until the owner reviews it (estate doctrine 4). -*Why not higher.* `PWG-1` needs a receipt per witness and per commit that -records each checker's observed result (§8.2). The receipt records each leg's -pinned checker, invocation and input digests, the sibling's leg files -included, but not the result. The verification claim is CI-backed until -per-leg, per-commit receipts record the observed results. The `legs` job log -is execution evidence, not a substitute for those receipts. +*The receipts.* A grade is derived from the receipt (§8.2, §8.4). `PWG-1` needs +a current receipt, for every witness, of a pinned, headless and isolated checker +run that describes the receipt's `:source-commit`; isolated means in an image +pinned by its digest (owner ruling 2026-11-16). Under standards#1625 (owner ruling 2026-11-16), `PWG-1` additionally needs every counted witness's current receipt to carry a digest-pinned `:image "NAME@sha256:<64 hex>"`. The pinned image-aware generator and reader enforce this for all three legs; +a missing image limits an otherwise eligible claim to `PWG-2ii`. After each +successful gate, CI prints `--run-row --image` rows using the image read +from the job's own `container:` line: Debian for Agda and Ubuntu for Rocq and Lean. Record +those rows in `receipt_runs` and regenerate with `--write`; field 13 carries +the image, retaining empty import or trusted-base fields as needed. Images +are never inferred from checker version text or added to historical runs. The last runs, +https://github.com/metadatastician/lintel/actions/runs/42740256887[42740256887] +on `89ceac3`, checked the inputs at the earlier secret-types pin, and its legs ran +on a bare runner, so they support `PWG-2ii` at most; the re-pin to `9fb8430` +superseded them, and the receipt grades nothing until the first run on `main` +after it is recorded. The reader at standards 4813fa1092a3 derives `ungraded` for L-1, L-2, L-3, L-4, L-6 and L-7 from that receipt today. That run checks the Agda in +`debian:13-slim@sha256:a29215f6…` and both legs in +`ubuntu:24.04@sha256:73b99939…`. Each receipt lists the files of its graded +invocation: for Agda, the import cone of `src/Lintel/All.agda` (the gate's +separate run over all of `SecretTypes.All` is not a witness of these claims +and is not listed); for Rocq and Lean, the leg's files. Files of secret-types +at the pin go in an `(import …)` of a current receipt, and the git checks +confirm each one at its commit. The currency check covers current receipts only, so it applies once a +run is recorded as current; every recorded run is superseded today, and until +the next run on `main` is recorded nothing is checked for currency. From then +on, a change to a Lintel file of a current receipt fails the check until a new +run is recorded. The imported files are fixed by their pinned commit, which +the git checks read; they change only with a repin, and the pin file +`scripts/fetch-siblings.sh` is a Lintel input of every leg, so a repin fails +the check too. `scripts/check-trusted-base.sh` checks that the +receipt's Agda input set and `(trusted-base …)` are exactly what Agda reports +(`--dependency-graph` and a scan of the prover-supplied modules). *The template skeletons are not the legs.* `verification/proofs/{agda,coq,lean4,idris2,tlaplus}` are RSR template boilerplate. They prove nothing about Lintel, and no workflow @@ -93,16 +128,13 @@ derivation and the `Writes` derivation together on one `Cmd` index. It now reads `Writes` into `Writes′`, the same relation computed by recursion on the command, and recurses on the typing derivation alone. `Writes`, the relation L-7 is stated over, is unchanged, as is every statement. The sibling needed the matching change, -hyperpolymath/secret-types#26 (`just-injective`). That, and secret-types' legs -(hyperpolymath/secret-types#29, stacked on #26), are why the pin is a branch -commit, `45046c2`, until they merge. +which reached secret-types `main` as hyperpolymath/secret-types#30, with its legs +as hyperpolymath/secret-types#34. The pin is `9fb8430`, on that `main` +(re-pin from metadatastician/lintel#27). == Open * Owner review of the legs' statement comparison (link:../../verification/legs/README.adoc[`verification/legs/README.adoc`]). -* Re-pin secret-types to its `main` once hyperpolymath/secret-types#26 and - hyperpolymath/secret-types#29 (its legs) merge. The squash commits will differ - from `45046c2`. * A-1 stays an assumption by design: confinement of the link is per role, and a proxy–target coalition can join the two fields outside any program. diff --git a/scripts/check-legs.sh b/scripts/check-legs.sh index 9781e8a6..ba86e446 100644 --- a/scripts/check-legs.sh +++ b/scripts/check-legs.sh @@ -19,7 +19,7 @@ # * every `#print axioms` line must read "does not depend on any axioms". # # Pins: COQ_VERSION and LEAN_VERSION below, fixed (no environment override); -# scripts/grade-receipt.sh reads them from here into the receipt. +# the receipt's [[run]] rows (verification/receipts/proof-receipt.toml) name them. set -euo pipefail cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." export LC_ALL="${LC_ALL:-C.UTF-8}" diff --git a/scripts/check-trusted-base.sh b/scripts/check-trusted-base.sh new file mode 100755 index 00000000..508a681d --- /dev/null +++ b/scripts/check-trusted-base.sh @@ -0,0 +1,125 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: MPL-2.0 +# SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +# +# check-trusted-base.sh: the prover's trusted base and the Agda input set of +# the receipt, against what Agda itself reports (PROOF-POLICY §8.4, §8.5.1). +# Pattern: hyperpolymath/secret-types scripts/check-trusted-base.sh. +# +# The import cone of src/Lintel/All.agda includes modules that Agda supplies, +# such as Agda.Primitive. Some declare primitives by postulate, and --safe +# accepts them. Such a postulate is admissible only if the receipt lists it by +# name with its binding, and the gate checks that exact list. This script: +# 1. runs the scanner's controls (tests/trusted-base), so a scanner that +# stops finding postulates fails here first; +# 2. asks Agda for the cone (--dependency-graph, under the gate's flags), and +# requires the receipt's Agda input set to be exactly that cone: the +# Lintel modules of `grade-receipt.sh --inputs agda`, and the +# secret-types modules of `grade-receipt.sh --sibling-cone` (its imports); +# 3. scans every prover-supplied module of the cone for postulates; +# 4. requires the result to be exactly proof_trusted_base +# (scripts/proof-flags.sh), which the receipt writes as (trusted-base ...). +# Any difference fails. A prover pin bump that changes the list fails here +# until proof_trusted_base is updated and the receipt is earned again. +# +# Needs agda (the pinned version), the secret-types checkout +# (scripts/fetch-siblings.sh) and the pinned standards files +# (scripts/grade-receipt.sh --fetch-standards). +set -euo pipefail +cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." +export LC_ALL=C +. scripts/proof-flags.sh +prover="${AGDA:-agda}" +st="${SECRET_TYPES_SRC:-${DEPENDENCIES_DIR:-_build/dependencies}/secret-types/src}" +root=src/Lintel/All.agda +scan=scripts/scan-agda-postulates.awk +work="$(mktemp -d)"; trap 'rm -rf "$work"' EXIT +[[ -d "$st" ]] || { echo "ERROR: secret-types sources not found at $st (run scripts/fetch-siblings.sh)" >&2; exit 1; } + +# 1. Controls. Positive and comment-only fixtures must give their expected +# lists; the refusal fixtures must be refused (exit 3), never passed. Two +# refusal controls carry control bytes, which the estate's invisible-character +# scan refuses in the tree (and .gitattributes would normalise CRLF), so they +# are stored without them and get them here; each must then be refused for +# that byte, since its postulate alone would be refused too. +ff="$(printf '\f')" +declare -A reason=([CarriageReturn]='carriage return' [FormFeed]='form feed') +for f in tests/trusted-base/*.txt; do + name="$(basename -- "$f" .txt)" + case "$name" in + CarriageReturn) + sed 's/$/\r/' "$f" > "$work/$name.ctl" + grep -q $'\r' "$work/$name.ctl" || { echo 'FAIL: could not build the CRLF control' >&2; exit 1; } + f="$work/$name.ctl" ;; + FormFeed) + sed "s/^postulate Hidden/postulate${ff}Hidden/" "$f" > "$work/$name.ctl" + grep -q "$ff" "$work/$name.ctl" || { echo 'FAIL: could not build the form-feed control' >&2; exit 1; } + f="$work/$name.ctl" ;; + esac + set +e; awk -v "module=Fixture.$name" -f "$scan" "$f" > "$work/$name.out" 2> "$work/$name.err"; rc=$?; set -e + if [[ -f "tests/trusted-base/$name.expected" ]]; then + if (( rc != 0 )) || ! diff -u "tests/trusted-base/$name.expected" "$work/$name.out"; then + cat "$work/$name.err" >&2 + echo "FAIL: scanner control $name (rc=$rc)" >&2; exit 1 + fi + elif (( rc != 3 )); then + cat "$work/$name.out" >&2 + echo "FAIL: scanner control $name was not refused (rc=$rc)" >&2; exit 1 + fi + if [[ -n "${reason[$name]:-}" ]] && ! grep -q "${reason[$name]}" "$work/$name.err"; then + cat "$work/$name.err" >&2 + echo "FAIL: scanner control $name was refused, but not for its ${reason[$name]}" >&2; exit 1 + fi +done +echo "PASS: scanner controls ($(ls tests/trusted-base/*.txt | wc -l | tr -d ' ') fixtures)" + +# 2. The cone, as Agda reports it under the gate's flags. +mapfile -t flags < <(proof_flags) +"$prover" "${flags[@]}" -i src -i "$st" --dependency-graph="$work/cone.dot" "$root" > "$work/agda.log" 2>&1 \ + || { cat "$work/agda.log" >&2; echo 'FAIL: agda could not produce the dependency graph' >&2; exit 1; } +mapfile -t cone < <(sed -n 's/.*label="\([^"]*\)".*/\1/p' "$work/cone.dot" | sort -u) +(( ${#cone[@]} > 0 )) || { echo 'FAIL: empty dependency graph' >&2; exit 1; } +agda_dir="$("$prover" --print-agda-dir)" + +# The receipt's Agda input set, from the hooks the receipt is written with. +bash scripts/grade-receipt.sh --inputs agda | grep -E '\.agda$' | sort > "$work/scan-home" \ + || { echo 'FAIL: grade-receipt.sh --inputs agda failed' >&2; exit 1; } +bash scripts/grade-receipt.sh --sibling-cone | sort > "$work/scan-import" \ + || { echo 'FAIL: grade-receipt.sh --sibling-cone failed' >&2; exit 1; } +: > "$work/cone-home"; : > "$work/cone-import" +for m in "${cone[@]}"; do + rel="${m//.//}.agda" + if [[ -f "src/$rel" ]]; then printf 'src/%s\n' "$rel" >> "$work/cone-home" + elif [[ -f "$st/$rel" ]]; then printf 'src/%s\n' "$rel" >> "$work/cone-import"; fi +done +sort -o "$work/cone-home" "$work/cone-home"; sort -o "$work/cone-import" "$work/cone-import" +for part in home import; do + if ! diff -u "$work/cone-$part" "$work/scan-$part"; then + echo "FAIL: the receipt's Agda input set ($part) differs from the cone agda --dependency-graph reports" >&2 + exit 1 + fi +done +echo "PASS: the receipt's Agda input set equals the cone Agda reports ($(wc -l < "$work/cone-home" | tr -d ' ') Lintel, $(wc -l < "$work/cone-import" | tr -d ' ') secret-types modules)" + +# 3. Scan the prover-supplied modules. Every module of the cone is Lintel's, +# the sibling's, or Agda's (under the prover's lib/prim); a module in none of +# them fails, so nothing in the cone goes unscanned. +supplied=0 +: > "$work/found" +for m in "${cone[@]}"; do + rel="${m//.//}.agda" + if [[ -f "src/$rel" || -f "$st/$rel" ]]; then continue; fi + path="$agda_dir/lib/prim/$rel" + [[ -f "$path" ]] || { echo "FAIL: module $m of the cone is in neither src/, the sibling, nor $agda_dir/lib/prim" >&2; exit 1; } + supplied=$((supplied + 1)) + awk -v "module=$m" -f "$scan" "$path" >> "$work/found" +done + +# 4. Compare with proof_trusted_base, the list the receipt writes. +sort -u "$work/found" > "$work/found.sorted" +proof_trusted_base | sort -u > "$work/declared.sorted" +if ! diff -u "$work/declared.sorted" "$work/found.sorted"; then + echo 'FAIL: the prover-supplied postulates of the cone differ from proof_trusted_base (scripts/proof-flags.sh)' >&2 + exit 1 +fi +echo "PASS: trusted base: $(wc -l < "$work/found.sorted" | tr -d ' ') prover postulates in $supplied prover-supplied modules of the cone, each BUILTIN-bound and listed; no other postulate" diff --git a/scripts/fetch-siblings.sh b/scripts/fetch-siblings.sh index 38fdc978..320cee91 100755 --- a/scripts/fetch-siblings.sh +++ b/scripts/fetch-siblings.sh @@ -20,7 +20,7 @@ set -euo pipefail cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." -SECRET_TYPES_COMMIT="${SECRET_TYPES_COMMIT:-45046c2c0f92ddae2ff73c8c05555bed419f46ad}" +SECRET_TYPES_COMMIT="${SECRET_TYPES_COMMIT:-9fb8430c3aa2d1d89016619722dc0a2631df0566}" DEPENDENCIES_DIR="${DEPENDENCIES_DIR:-_build/dependencies}" # fetch_pinned diff --git a/scripts/grade-receipt.sh b/scripts/grade-receipt.sh index b4b5243a..f260acf9 100644 --- a/scripts/grade-receipt.sh +++ b/scripts/grade-receipt.sh @@ -2,274 +2,182 @@ # SPDX-License-Identifier: MPL-2.0 # SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell # -# grade-receipt.sh [--write|--check] [--commit ] +# grade-receipt.sh: Lintel's proof receipt, verification/receipts/agda-pwg_praxis.deed, +# in the shape of PROOF-POLICY §8.5.1 to §8.5.3, written and checked by the +# shared generator of the standard (scripts/proof-receipt.sh, standards#1620). +# This file holds only what is Lintel's: the claim, run and echo ledgers and +# the hooks that name each leg's invocation and input set. # -# Writes (or checks) verification/receipts/agda-pwg_praxis.deed: the machine -# record of Lintel's Agda claims and their Proof Witness Grades -# (standards/3-practice/PROOF-POLICY.adoc §8, owner ruling 2026-11-04). -# Pattern: hyperpolymath/secret-types scripts/grade-receipt.sh. +# --fetch-standards fetch the pinned standards files into _build/standards +# and check each one's sha256 +# --write write the receipt from the tree and the ledgers +# --check regenerate it, refuse any difference, run the git +# checks of §8.5.3, check that each current receipt still +# describes the tree, and run the pinned reader with a +# negative control +# --inputs PROVER the §8.5.1 home input set of a leg +# --sibling-cone the secret-types modules of the Agda cone, as paths in +# that repository (scripts/check-trusted-base.sh reads it) +# --run-row PROVER --run URL --commit SHA --checker TEXT --reported TEXT +# --axioms none --image NAME@sha256:<64 hex> +# print the ledger row of a run that just passed, +# recording the image the checker actually ran in # -# PWG-2ii (§8.2): the Agda proof is PROVEN under the canonical §2.1 -# invocation, and both the Rocq and the Lean leg count: kernel-checked -# (scripts/check-legs.sh, no axioms) and RECONCILED against the Agda -# statement (verification/legs/README.adoc). Not PWG-1: that needs a -# per-commit receipt of each checker's observed result, which this file is not. -# -# The receipt is DERIVED from the tree, except for the claim list below, which -# is cross-checked in both directions against the claim IDs of README.adoc's -# claim table. It records the import cone (§8.2): every Lintel module and -# every secret-types module they reach, with the sibling's pinned commit and a -# sha256 per file. It does not run Agda: the gate (scripts/check.sh, in -# .github/workflows/proofs.yml) is the execution evidence, and the receipt says -# which gate produced which result (PROOF-POLICY §2.3). -# -# Run scripts/fetch-siblings.sh first: the cone is hashed from the sibling -# checkout at its pin. -set -euo pipefail +# Run scripts/fetch-siblings.sh first: the receipt imports secret-types at its +# pin, and the hooks read that checkout. +# Sourced (by tests), it defines the ledgers and hooks and runs nothing. +[[ "${BASH_SOURCE[0]}" != "$0" ]] || set -euo pipefail cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." +export LC_ALL=C.UTF-8 . scripts/proof-flags.sh -out=verification/receipts/agda-pwg_praxis.deed -deps="${DEPENDENCIES_DIR:-_build/dependencies}" -st="${SECRET_TYPES_SRC:-$deps/secret-types/src}" -mode= -commit_override= -while (( $# )); do - case "$1" in - --write|--check) mode="$1" ;; - --commit) commit_override="${2:-}"; shift ;; - -h|--help) - printf 'usage: %s [--write|--check] [--commit ]\n' "${0##*/}" - exit 0 ;; - *) printf 'unknown argument: %s\n' "$1" >&2; exit 2 ;; - esac - shift -done +# ── The pinned standard: four files at one commit, each with its sha256 ────── +STANDARDS_COMMIT=4813fa1092a38a6782e722ede5b09ce79e92fba3 +declare -A STANDARDS_FILES=( + [scripts/proof-receipt.sh]=47e9e5596e69574440260e4372c4b400f6c5f97192ff04292a59bffc4c215fe8 + [1-formats/deed/tools/deed_lint.js]=29278b46654bdee70e8e1ff4a7ff8cb810e04b618c9ca1520a6979d6c4c91f18 + [scripts/proof-inputs-sha256.sh]=dfc6dde01a3a79df638eebe4cad0eae584d8f17280077e149174c0667e9508f4 + [scripts/check-proof-receipt.sh]=f2375747238464535d1b4a61f658f07cb2f8504c69bfb1812311c79429a4e23e +) +STD=_build/standards +SIBLING=${DEPENDENCIES_DIR:-_build/dependencies}/secret-types +PIN_FILE=scripts/fetch-siblings.sh + +die() { printf 'ERROR: %s\n' "$*" >&2; exit 1; } +fetch_standards() { + local path sum dest + for path in "${!STANDARDS_FILES[@]}"; do + sum="${STANDARDS_FILES[$path]}" dest="$STD/$path" + mkdir -p "$(dirname "$dest")" + curl --proto '=https' --tlsv1.2 -fsSL \ + "https://raw.githubusercontent.com/metadatastician/standards/$STANDARDS_COMMIT/$path" -o "$dest.tmp" + echo "$sum $dest.tmp" | sha256sum --check --strict >/dev/null \ + || { rm -f "$dest.tmp"; die "the fetched $path does not match its pinned sha256"; } + mv "$dest.tmp" "$dest"; printf 'FETCHED %s (standards %s)\n' "$path" "${STANDARDS_COMMIT:0:12}" + done +} +check_standards() { + local path + for path in "${!STANDARDS_FILES[@]}"; do + [[ -f "$STD/$path" ]] || die "the pinned $path is missing: run bash scripts/grade-receipt.sh --fetch-standards" + [[ "$(sha256sum "$STD/$path" | cut -d' ' -f1)" == "${STANDARDS_FILES[$path]}" ]] \ + || die "$STD/$path is not the pinned file (sha256 differs)" + done +} + +RECEIPT_STD=$STD +RECEIPT_STANDARDS_COMMIT=$STANDARDS_COMMIT +RECEIPT_OUT=verification/receipts/agda-pwg_praxis.deed +RECEIPT_REPOSITORY=metadatastician/lintel +RECEIPT_DEFAULT_BRANCH=main +RECEIPT_CANONICAL_NAME=lintel-proof-receipt +RECEIPT_SCRIPT=scripts/grade-receipt.sh # ── The claim list ──────────────────────────────────────────────────────────── -# id | ledger token (README-EXPLAINME-STANDARD §5: proven | proven-with-postulates -# | tested-only | argued | open) | PWG (PROOF-POLICY §8.5: 3 | 2i | 2ii | 1 | -# ungraded; n/a for what is not a theory theorem, §8.1) | Rocq leg | Lean leg -# (§2: transported | re-proved | waived | unavailable). -claims() { +# id | §5 token of the Agda proof | kind | Rocq route | Rocq §2.2 state | +# Lean route | Lean §2.2 state | Rocq reason | Lean reason. Only theorems are +# graded (§8.1). Both recheck legs are re-proved and RECONCILED in +# verification/legs/README.adoc. +receipt_claims() { cat <<'ROWS' -L-1|proven|2ii|re-proved|re-proved -L-2|proven|2ii|re-proved|re-proved -L-3|proven|2ii|re-proved|re-proved -L-4|proven|2ii|re-proved|re-proved -L-5|tested-only|n/a|n/a|n/a -L-6|proven|2ii|re-proved|re-proved -L-7|proven|2ii|re-proved|re-proved -A-1|argued|n/a|n/a|n/a +L-1|proven|theorem|re-proved|RECONCILED|re-proved|RECONCILED|| +L-2|proven|theorem|re-proved|RECONCILED|re-proved|RECONCILED|| +L-3|proven|theorem|re-proved|RECONCILED|re-proved|RECONCILED|| +L-4|proven|theorem|re-proved|RECONCILED|re-proved|RECONCILED|| +L-5|tested-only|demonstration|n/a|n/a|n/a|n/a|| +L-6|proven|theorem|re-proved|RECONCILED|re-proved|RECONCILED|| +L-7|proven|theorem|re-proved|RECONCILED|re-proved|RECONCILED|| +A-1|argued|assumption|n/a|n/a|n/a|n/a|| ROWS } -# ── Derived facts ───────────────────────────────────────────────────────────── -repo="metadatastician/lintel" -source_commit="${commit_override:-$(git rev-parse --short=12 HEAD 2>/dev/null || printf 'unknown')}" -sibling_pin="$(sed -nE 's/^SECRET_TYPES_COMMIT="\$\{SECRET_TYPES_COMMIT:-([0-9a-f]{40})\}"$/\1/p' scripts/fetch-siblings.sh)" -[[ "$sibling_pin" =~ ^[0-9a-f]{40}$ ]] || { echo 'ERROR: no 40-hex secret-types pin in scripts/fetch-siblings.sh' >&2; exit 1; } -if [ ! -d "$st" ]; then - echo "ERROR: secret-types sources not found at $st (run scripts/fetch-siblings.sh)" >&2 - exit 1 -fi - -# Print Lintel's module paths in sorted order. -own_modules() { find src/Lintel -name '*.agda' | LC_ALL=C sort; } -# Print the fixtures (positive controls and expected rejections) in sorted order. -fixtures() { find tests/accept tests/reject -name '*.agda' | LC_ALL=C sort; } - -# Print the SecretTypes module names a file imports. -st_imports() { - sed -nE 's/^[[:space:]]*(open[[:space:]]+)?import[[:space:]]+(SecretTypes(\.[A-Za-z0-9_′]+)*).*/\2/p' "$1" +# ── The run ledger ──────────────────────────────────────────────────────────── +# prover | run | commit | checker | invocation | inputs sha256 | reported | +# state | reason | axioms [| imports [| trusted base [| image]]]. +# Image is field 13; empty imports/trusted-base fields are kept. PWG-1 +# requires a digest-pinned image on every counted current witness. A current row is +# printed by --run-row from the log of the run that passed; no row is typed. +# Run 42740256887 (on 89ceac3, main) checked the legs at the earlier +# secret-types pin; the re-pin to 9fb8430 changed every leg's inputs, so the +# first run on main after it is recorded next. Until then nothing is graded. +receipt_runs() { + cat <<'ROWS' +agda|https://github.com/metadatastician/lintel/actions/runs/42740256887/attempts/1|89ceac3b8685467c664737a98364eef4febb9ff2|Agda version 2.6.4.3 (Debian 13 agda-bin=2.6.4.3-1+b2, container debian:13-slim)|agda --safe --without-K --cubical-compatible --no-libraries --ignore-interfaces --double-check -W error -i src -i _build/dependencies/secret-types/src src/Lintel/All.agda|39a57e7d6ad052fd5dae5c3d1528ecb2121b9d7579c9f5517e0af7645e3a6194|PASS: Lintel proofs, 5 positive control(s), 4 expected rejection(s), negative control|superseded|the re-pin of secret-types from 45046c2 to 9fb8430 changed the inputs; the first run on main after it replaces this one| +rocq|https://github.com/metadatastician/lintel/actions/runs/42740256887/attempts/1|89ceac3b8685467c664737a98364eef4febb9ff2|Coq 8.18.0 (Ubuntu 24.04 coq=8.18.0+dfsg-1build2, bare runner)|coqc -q -Q . SecretTypesLeg SecretTypes.v (in the secret-types leg); coqc -q -Q ../../../_build/dependencies/secret-types/verification/legs/rocq SecretTypesLeg Lintel.v (in verification/legs/rocq)|71aa1f2cdfc11d1e4ac01538aea470d7991bbbd5f67db122693604bf735947e7|PASS: Rocq leg (Coq 8.18.0), 36 statements closed under the global context|superseded|the re-pin of secret-types from 45046c2 to 9fb8430 changed the inputs, and this run was on a bare runner (PROOF-POLICY 8.2 isolation); the first run on main in the pinned image replaces it| +lean|https://github.com/metadatastician/lintel/actions/runs/42740256887/attempts/1|89ceac3b8685467c664737a98364eef4febb9ff2|Lean 4.24.0 (release tarball, bare runner)|lake build; lake env lean Axioms.lean (in verification/legs/lean)|01ef18b09ee3a85365e2888d673f1490a5bc16489352f4ca8f155c6f8e60a914|PASS: Lean leg (Lean 4.24.0, core only), 36 statements depend on no axioms|superseded|the re-pin of secret-types from 45046c2 to 9fb8430 changed the inputs, and this run was on a bare runner (PROOF-POLICY 8.2 isolation); the first run on main in the pinned image replaces it| +ROWS } -# Print the sibling's import cone: every SecretTypes module reached from -# Lintel's modules, transitively, as paths relative to the sibling's src. -sibling_cone() { - local -A seen=() - local -a queue=() - local f m p - while read -r f; do - while read -r m; do [ -n "$m" ] && queue+=("$m"); done < <(st_imports "$f") - done < <(own_modules) - while (( ${#queue[@]} )); do - m="${queue[0]}"; queue=("${queue[@]:1}") - [ -n "${seen[$m]:-}" ] && continue - seen[$m]=1 - p="${m//.//}.agda" - if [ ! -f "$st/$p" ]; then - echo "ERROR: $m is imported but $st/$p does not exist" >&2 - return 1 - fi - while read -r f; do [ -n "$f" ] && queue+=("$f"); done < <(st_imports "$st/$p") - done - printf '%s\n' "${!seen[@]}" | sed 's|\.|/|g; s|$|.agda|' | LC_ALL=C sort -} +# ── The echo ledger (§8.5.2) ────────────────────────────────────────────────── +receipt_echoes() { :; } -# Print escape-hatch lines from Lintel's Agda files (the sibling has its own -# receipt and gate for its tree). -escape_hits() { - grep -rn --include='*.agda' -E \ - '(^|[^A-Za-z])(postulate|believe_me|trustMe|sorry|Admitted)([^A-Za-z]|$)|{-# *(TERMINATING|NON_TERMINATING) *#-}|--type-in-type' \ - src/Lintel tests/accept tests/reject 2>/dev/null || true +receipt_header() { + cat <<'HEAD' +;; SPDX-License-Identifier: CC-BY-SA-4.0 +;; SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell +;; The proof receipt of Lintel (PROOF-POLICY §8.5.1). +;; GENERATED by scripts/grade-receipt.sh with the shared generator of the +;; standard (scripts/proof-receipt.sh): regenerate with --write, check with --check. +;; L-5 (checked refusals) and A-1 (an assumption) are not theorems (§8.1). +;; The trusted base is what scripts/check-trusted-base.sh finds in the +;; prover-supplied modules of the import cone of src/Lintel/All.agda. +HEAD } -# The claim list and README.adoc's claim table must name exactly the same -# claims; one without the other is drift, in either direction. -check_claim_ids() { - local decl doc - decl="$(claims | cut -d'|' -f1 | LC_ALL=C sort)" - doc="$(grep -oE '^\| [LA]-[0-9]+$' README.adoc | tr -d '| ' | LC_ALL=C sort -u || true)" - if [[ -z "$doc" ]]; then - echo 'ERROR: no claim ids found in README.adoc; the table layout changed' >&2 - exit 1 - fi - if [[ "$decl" != "$doc" ]]; then - echo 'ERROR: claim ids differ between this receipt and README.adoc' >&2 - diff <(printf '%s\n' "$doc") <(printf '%s\n' "$decl") \ - | sed 's/^/ only in grade-receipt.sh:/' >&2 - exit 1 - fi -} +receipt_trusted_base() { proof_trusted_base; } -# Print repository-relative Rocq sources, then Lean sources (excluding .lake), -# each group sorted, followed by the Lean package and toolchain files. -leg_sources() { - find verification/legs/rocq -name '*.v' | LC_ALL=C sort - find verification/legs/lean -name '*.lean' -not -path '*/.lake/*' | LC_ALL=C sort - printf '%s\n' verification/legs/lean/lakefile.toml verification/legs/lean/lean-toolchain -} -# Print the fixed list of leg inputs relative to the secret-types checkout. -sibling_leg_sources() { - printf '%s\n' verification/legs/rocq/SecretTypes.v verification/legs/lean/SecretTypes/Generic.lean \ - verification/legs/lean/lakefile.toml verification/legs/lean/lean-toolchain +receipt_invocation() { + case "$1" in + agda) printf 'agda %s -i src -i _build/dependencies/secret-types/src src/Lintel/All.agda\n' "$(proof_flags_line)" ;; + rocq) printf '%s\n' 'coqc -q -Q . SecretTypesLeg SecretTypes.v (in the secret-types leg); coqc -q -Q ../../../_build/dependencies/secret-types/verification/legs/rocq SecretTypesLeg Lintel.v (in verification/legs/rocq)' ;; + lean) printf '%s\n' 'lake build; lake env lean Axioms.lean (in verification/legs/lean)' ;; + esac } -# Print the (legs) block: per leg, the pinned checker, its invocation, the -# axiom check, and the sha256 of every input, the sibling's leg files -# included. The pins are read from scripts/check-legs.sh, which the gate uses. -# Write to stdout without running either checker. A missing sibling leg input -# reports an error to stderr and returns 1; stdout may already contain output. -emit_legs() { - local coq lean sib="$deps/secret-types" - coq="$(sed -n 's/^COQ_VERSION=\(.*\)$/\1/p' scripts/check-legs.sh)" - lean="$(sed -n 's/^LEAN_VERSION=\(.*\)$/\1/p' scripts/check-legs.sh)" - printf ' (legs\n :gate "bash scripts/check-legs.sh"\n :ci ".github/workflows/proofs.yml (job legs)"\n' - printf ' :correspondence "verification/legs/README.adoc"\n' - printf ' :route "re-proved"\n' - printf ' :route-reason "Agda2Dedukti is an Agda backend pinned to a fork (b026db1, GHC 8.10) and cannot run on Agda %s; no released Dedukti/Lambdapi exporter to Lean 4, and no pinned route to Rocq"\n' "$(proof_agda_pin)" - printf ' :state "RECONCILED"\n' - printf ' :review "statement comparison written by Claude Code; provisional until owner review (estate doctrine 4)"\n' - printf ' :depends-on "secret-types legs at the sibling pin (record, language, typing, TINI): imported, not restated"\n' - printf ' (leg :prover "rocq" :checker "coqc" :version "%s" :invocation "coqc -q -Q /verification/legs/rocq SecretTypesLeg Lintel.v (in verification/legs/rocq)" :libraries "secret-types Rocq leg only (no standard library)" :axioms "none (Print Assumptions: Closed under the global context)")\n' "$coq" - printf ' (leg :prover "lean" :checker "lean" :version "%s" :invocation "lake build; lake env lean Axioms.lean (in verification/legs/lean)" :libraries "secret-types Lean leg only (no Mathlib)" :axioms "none (#print axioms: does not depend on any axioms)")\n' "$lean" - printf ' (inputs\n' - while read -r p; do - printf ' (input :path "%s" :sha256 "%s")\n' "$p" "$(sha256sum "$p" | cut -d' ' -f1)" - done < <(leg_sources) - while read -r p; do - [ -f "$sib/$p" ] || { echo "ERROR: sibling leg file $sib/$p missing (run scripts/fetch-siblings.sh)" >&2; return 1; } - printf ' (input :repository "hyperpolymath/secret-types" :path "%s" :sha256 "%s")\n' "$p" "$(sha256sum "$sib/$p" | cut -d' ' -f1)" - done < <(sibling_leg_sources) - printf ' ))\n' +# The home input set of each leg (§8.5.1). The pin file is in each, because +# it fixes the imported files: a repin changes every leg's digest. +lean_files() { git -C "$1" ls-files -- verification/legs/lean | grep -E '(\.lean|/lakefile\.(lean|toml)|/lean-toolchain|/lake-manifest\.json)$'; } +receipt_inputs() { + [[ -d "$SIBLING/src" ]] || return 3 + case "$1" in + agda) receipt_agda_cone src/Lintel/All.agda src "$SIBLING/src" | grep -v "^$SIBLING/" ;; + rocq) printf '%s\n' verification/legs/rocq/Lintel.v ;; + lean) lean_files . ;; + esac + printf '%s\n' "$PIN_FILE" } - -# Each counted leg must be RECONCILED in the correspondence record, and -# the reverse: the grade is derived from the §2.2 record (PROOF-POLICY §8.4). -# On a mismatch, report the differing claim IDs to stderr and exit the script -# with status 1; matching records produce no output. -check_leg_records() { - local rec=verification/legs/README.adoc counted recorded - counted="$(claims | awk -F'|' ' - $4=="re-proved" || $4=="transported" {print $1 "|rocq|RECONCILED"} - $5=="re-proved" || $5=="transported" {print $1 "|lean|RECONCILED"} - ' | LC_ALL=C sort)" - recorded="$(awk -F'|' ' - function trim(s) {gsub(/^[[:space:]]+|[[:space:]]+$/, "", s); return s} - /^\| [LA]-[0-9]+([[:space:]]|$)/ { - print trim($2) "|rocq|" trim($3) - print trim($2) "|lean|" trim($4) - } - ' "$rec" | LC_ALL=C sort)" - if [[ "$counted" != "$recorded" ]]; then - echo "ERROR: counted legs must match RECONCILED states in $rec" >&2 - diff <(printf '%s\n' "$recorded") <(printf '%s\n' "$counted") \ - | grep -E '^[<>]' | sed "s|^<| only in $rec:|; s/^>/ only in grade-receipt.sh:/" >&2 - exit 1 - fi +# The files each leg read from secret-types at the pin its home commit names. +receipt_imports() { + local pin + pin="$(git show "$2:$PIN_FILE" | sed -nE 's/^SECRET_TYPES_COMMIT="\$\{SECRET_TYPES_COMMIT:-([0-9a-f]{40})\}"$/\1/p')" + [[ "$pin" =~ ^[0-9a-f]{40}$ ]] || return 3 + case "$1" in + agda) receipt_agda_cone src/Lintel/All.agda src "$SIBLING/src" | sed -n "s|^$SIBLING/||p" ;; + rocq) printf '%s\n' verification/legs/rocq/SecretTypes.v ;; + lean) lean_files "$SIBLING" ;; + esac | while read -r p; do printf '%s|%s|%s|%s\n' hyperpolymath/secret-types "$pin" "$SIBLING" "$p"; done } -# Print the derived receipt. -emit() { - local cone - cone="$(sibling_cone)" - printf ';; SPDX-License-Identifier: CC-BY-SA-4.0\n' - printf ';; SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell\n' - printf ';; GENERATED by scripts/grade-receipt.sh; regenerate with --write, check with --check.\n' - printf ';; This describes the gate and tree; the CI log is the execution evidence.\n' - printf '(praxis-deed\n :schema-version "1.0.0"\n :canonical-name "lintel-agda-pwg-receipt"\n' - printf ' (identity\n :project "lintel"\n :name "agda verification receipt (Proof Witness Grades)"\n' - printf ' :repository "%s"\n :repo-uuid #u5"github.com/%s"\n' "$repo" "$repo" - printf ' :kind "theory"\n :source-commit "%s")\n' "$source_commit" - printf ' (prover\n :tool "agda"\n :version "%s"\n :provenance "%s"\n' "$(proof_agda_pin)" "$(proof_agda_provenance)" - printf ' :library "none (--no-libraries; Agda builtins and the pinned sibling only)"\n :flags "%s"\n' "$(proof_flags_line)" - printf ' :flags-source "scripts/proof-flags.sh")\n' - printf ' (conformance\n :policy "standards/3-practice/PROOF-POLICY.adoc"\n' - printf ' :policy-revision "section 2.1 dated 2026-11-01; section 8 (PWG) dated 2026-11-04"\n' - printf ' :canonical-invocation "agda --safe --without-K --cubical-compatible"\n' - printf ' :cubical-compatible "met"\n' - printf ' :stronger-than-canonical ("--no-libraries" "--ignore-interfaces" "--double-check" "-W error"))\n' - printf ' (gate\n :command "bash scripts/check.sh"\n :ci ".github/workflows/proofs.yml"\n' - printf ' :module-count %s\n :fixture-count %s)\n' "$(own_modules | wc -l | tr -d ' ')" "$(fixtures | wc -l | tr -d ' ')" - printf ' (trust-base\n :postulates %s\n :escape-hatches %s\n' \ - "$(grep -rlw --include='*.agda' postulate src/Lintel tests/accept tests/reject 2>/dev/null | wc -l | tr -d ' ')" \ - "$(escape_hits | wc -l | tr -d ' ')" - printf ' :library-dependencies 0\n :axioms-assumed 0\n' - printf ' :assumption "A-1 non-collusion is a stated hypothesis of the threat model (argued), not an axiom of any proof")\n' - printf ' ; PWGs apply to theory theorems (PROOF-POLICY section 8.1); L-5 (refusal fixtures) and A-1 (an assumption) are n/a.\n' - printf ' ; Rocq and Lean legs: re-proved by hand on top of secret-types'"'"' legs, RECONCILED in verification/legs/README.adoc.\n' - emit_legs - printf ' (claims\n' - while IFS='|' read -r id token pwg coq lean; do - printf ' (claim :id "%s" :token "%s" :pwg "%s" :coq-leg "%s" :lean-leg "%s")\n' "$id" "$token" "$pwg" "$coq" "$lean" - done < <(claims) - printf ' )\n ; The import cone: every module the proofs rest on, hashed.\n (modules\n' - while read -r m; do - printf ' (module :path "%s" :sha256 "%s")\n' "$m" "$(sha256sum "$m" | cut -d' ' -f1)" - done < <(own_modules) - printf ' )\n (sibling\n :repository "hyperpolymath/secret-types"\n :commit "%s"\n' "$sibling_pin" - while read -r m; do - printf ' (module :path "src/%s" :sha256 "%s")\n' "$m" "$(sha256sum "$st/$m" | cut -d' ' -f1)" - done <<< "$cone" - printf ' )\n (fixtures\n' - while read -r f; do - printf ' (fixture :path "%s")\n' "$f" - done < <(fixtures) - printf ' )\n)\n' +# The claim ids of the proof-status table, and the ids whose two recheck legs +# the legs record lists as RECONCILED (a row with any other state drops out, +# so the gate fails on it). +receipt_status_ids() { grep -oE '^\| [LA]-[0-9]+ \|' docs/status/PROOF-STATUS.adoc | tr -d '| ' || true; } +receipt_recorded_legs() { + [[ -f verification/legs/README.adoc ]] || return 3 + awk -F'|' 'function t(s){gsub(/^[[:space:]]+|[[:space:]]+$/,"",s); return s} + /^\| [LA]-[0-9]+ \|/ { id=t($2); if (t($3)=="RECONCILED" && t($4)=="RECONCILED") ok[id]=1; else bad[id]=1 } + END { for (i in ok) if (!(i in bad)) print i }' verification/legs/README.adoc } -check_claim_ids -check_leg_records - -case "$mode" in - --write|"") - mkdir -p "$(dirname "$out")" - emit > "$out" - printf 'WROTE %s (source-commit %s)\n' "$out" "$source_commit" - ;; - --check) - tmp="$(mktemp)"; diff_out="$(mktemp)"; trap 'rm -f "$tmp" "$diff_out"' EXIT - emit > "$tmp" - # The source-commit line is expected to differ: a committed receipt names - # its parent. Everything else must match byte for byte. - filter() { grep -v '^ :source-commit ' "$1"; } - if ! diff -u <(filter "$out") <(filter "$tmp") > "$diff_out" 2>&1; then - echo 'ERROR: verification receipt does not match the tree:' >&2 - sed -n '1,60p' "$diff_out" >&2 - echo 'Regenerate with: bash scripts/grade-receipt.sh --write' >&2 - exit 1 - fi - echo "PASS: verification receipt matches the tree ($(own_modules | wc -l | tr -d ' ') Lintel modules, $(sibling_cone | wc -l | tr -d ' ') sibling modules, all sha256 verified)" - ;; +[[ "${BASH_SOURCE[0]}" == "$0" ]] || return 0 +case "${1:-}" in + --fetch-standards) fetch_standards; exit 0 ;; + -h|--help|'') sed -n '5,25p' "$0" | sed 's/^# \{0,1\}//'; [[ -n "${1:-}" ]]; exit ;; esac +check_standards +. "$RECEIPT_STD/scripts/proof-receipt.sh" +if [[ "${1:-}" == --sibling-cone ]]; then + receipt_agda_cone src/Lintel/All.agda src "$SIBLING/src" | sed -n "s|^$SIBLING/||p" | LC_ALL=C sort + exit 0 +fi +receipt_main "$@" diff --git a/scripts/proof-flags.sh b/scripts/proof-flags.sh index 04ea1554..af4b7c54 100644 --- a/scripts/proof-flags.sh +++ b/scripts/proof-flags.sh @@ -55,3 +55,17 @@ proof_agda_pin() { proof_agda_provenance() { printf '%s\n' 'Debian 13 agda-bin=2.6.4.3-1+b2' } + +# The prover's trusted base (PROOF-POLICY §8.4): every postulate in a +# prover-supplied module of the import cone of src/Lintel/All.agda, as +# module|name|binding. scripts/check-trusted-base.sh checks that this exact +# list is what the cone holds; the receipt writes it as (trusted-base ...). +# A prover pin bump can change it; the gate then fails until this list is +# updated and the receipt is earned again. +proof_trusted_base() { + printf '%s\n' \ + 'Agda.Primitive|Level|BUILTIN LEVEL' \ + 'Agda.Primitive|lzero|BUILTIN LEVELZERO' \ + 'Agda.Primitive|lsuc|BUILTIN LEVELSUC' \ + 'Agda.Primitive|_⊔_|BUILTIN LEVELMAX' +} diff --git a/scripts/scan-agda-postulates.awk b/scripts/scan-agda-postulates.awk new file mode 100644 index 00000000..f673fa3e --- /dev/null +++ b/scripts/scan-agda-postulates.awk @@ -0,0 +1,157 @@ +# SPDX-License-Identifier: MPL-2.0 +# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) +# +# scan-agda-postulates.awk: list every postulate that one Agda source file +# declares, with the BUILTIN binding that gives it its meaning +# (standards/3-practice/PROOF-POLICY.adoc §8.4). +# +# LC_ALL=C awk -v module=Agda.Primitive -f scripts/scan-agda-postulates.awk FILE +# +# Output: one line per postulated name, "module|name|binding", where binding +# is "BUILTIN " from a {-# BUILTIN #-} pragma in FILE. +# +# The scan lexes as Agda does where a mistake could HIDE a postulate: +# * nested block comments {- ... -} are blanked (newlines are kept); +# * pragma bodies {-# ... #-} are blanked, and BUILTIN pragmas are read; +# * a line comment starts at a run of two or more dashes that begins a token +# and is followed by a space, a letter, a digit or the end of the line. +# Any other dash run (for example an operator such as -->) stays code, so +# a doubtful case can only find MORE postulates, never fewer. +# It refuses (exit 3) what it does not lex: a string literal, a character +# literal, a tab, a carriage return, a form feed or any other control byte, +# a nested module, explicit layout braces +# after postulate, a declaration with no type signature, and a postulate with +# no BUILTIN binding. A refusal is a +# gate failure: extend the scanner, never weaken it. +# Positive and negative controls: tests/trusted-base/ (run by +# scripts/check-trusted-base.sh on every gate run). + +function refuse(msg) { + printf "REFUSE %s (%s): %s\n", FILENAME, module, msg > "/dev/stderr" + refused = 1 + exit 3 +} + +function idchar(c) { + # A character that can continue an Agda name. Any non-ASCII byte counts. + return c !~ /^[ \n(){};.@"]$/ && c != "" +} + +{ src = src $0 "\n" } + +END { + if (refused) exit 3 + if (module == "") { print "scan-agda-postulates.awk: set -v module=NAME" > "/dev/stderr"; exit 2 } + if (index(src, "\t")) refuse("a tab character") + if (index(src, "\r")) refuse("a carriage return (CRLF line ends are not lexed)") + # Agda reads a form feed (and other layout controls) as whitespace, so one + # between `postulate` and a name would hide the name from the scan. No other + # C0 control byte, nor DEL, is lexed: each is refused. + if (index(src, "\f")) refuse("a form feed") + if (match(src, /[\001-\010\013-\037\177]/)) refuse("a control character") + n = length(src); out = ""; i = 1; npragma = 0 + while (i <= n) { + c = substr(src, i, 1); c2 = substr(src, i, 2); c3 = substr(src, i, 3) + if (c3 == "{-#") { + j = index(substr(src, i + 3), "#-}") + if (j == 0) refuse("an unterminated pragma") + body = substr(src, i + 3, j - 1) + pragma[++npragma] = body + blank = body; gsub(/[^\n]/, " ", blank) + out = out " " blank " " + i += 3 + j - 1 + 3 + continue + } + if (c2 == "{-") { + depth = 1; k = i + 2 + while (k <= n && depth > 0) { + d2 = substr(src, k, 2) + if (d2 == "{-") { depth++; k += 2; continue } + if (d2 == "-}") { depth--; k += 2; continue } + k++ + } + if (depth > 0) refuse("an unterminated block comment") + blank = substr(src, i, k - i); gsub(/[^\n]/, " ", blank) + out = out blank; i = k + continue + } + if (c2 == "--") { + prev = (i == 1) ? "\n" : substr(src, i - 1, 1) + k = i; while (substr(src, k, 1) == "-") k++ + after = substr(src, k, 1) + if (prev ~ /^[ \n(){};]$/ && (after == "\n" || after == " " || after ~ /^[A-Za-z0-9]$/ || k > n)) { + while (k <= n && substr(src, k, 1) != "\n") k++ + blank = substr(src, i, k - i); gsub(/./, " ", blank) + out = out blank; i = k + continue + } + } + if (c == "\"") refuse("a string literal (this scanner does not lex strings)") + if (c == "'") { + prev = (i == 1) ? "\n" : substr(src, i - 1, 1) + if (!idchar(prev)) refuse("a character literal (this scanner does not lex them)") + } + out = out c; i++ + } + + # BUILTIN bindings: name -> "BUILTIN THING". + for (p = 1; p <= npragma; p++) { + body = pragma[p]; gsub(/\n/, " ", body) + m = split(body, w, / +/); t = 0 + for (q = 1; q <= m; q++) if (w[q] != "") tok[++t] = w[q] + if (t == 3 && tok[1] == "BUILTIN") binding[tok[3]] = "BUILTIN " tok[2] + delete tok + } + + nl = split(out, line, "\n") + # One module per file: a BUILTIN binding is keyed by its short name, so a + # nested module could reuse a bound name for an unbound postulate. Refuse + # any module declaration after the first, until the scan tracks scopes. + nmod = 0 + for (l = 1; l <= nl; l++) if (line[l] ~ /(^|[ ;{])module( |$)/ && ++nmod > 1) refuse("a nested module on line " l) + for (l = 1; l <= nl; l++) { + s = line[l] + if (!match(s, /(^|[ (){};])postulate([ (){};]|$)/)) continue + pos = RSTART + (substr(s, RSTART, 1) == "p" ? 0 : 1) + prefix = substr(s, 1, pos - 1) + if (prefix ~ /[\200-\377]/) refuse("non-ASCII text before postulate on line " l) + match(s, /^ */); indent = RLENGTH + rest = substr(s, pos + 9) + if (rest ~ /^ *\{/) refuse("explicit layout braces after postulate on line " l) + ndecl = 0 + if (rest ~ /[^ ]/) { + match(rest, /^ */); col = pos + 9 + RLENGTH - 1 + decl[++ndecl] = rest + start = l + 1 + } else { + col = -1; start = l + 1 + } + for (k = start; k <= nl; k++) { + t2 = line[k] + if (t2 !~ /[^ ]/) continue + match(t2, /^ */); ind = RLENGTH + if (ind <= indent) break + if (col < 0) col = ind + if (ind < col) break + if (ind == col) decl[++ndecl] = t2 + else decl[ndecl] = decl[ndecl] " " t2 + } + l = k - 1 + if (ndecl == 0) refuse("an empty postulate block on line " l) + for (d = 1; d <= ndecl; d++) { + m = split(decl[d], w, / +/); colon = 0; nn = 0 + for (q = 1; q <= m; q++) { + if (w[q] == "") continue + if (w[q] == ":") { colon = 1; break } + names[++nn] = w[q] + } + if (!colon || nn == 0) refuse("a postulate with no type signature: " decl[d]) + for (q = 1; q <= nn; q++) { + if (!(names[q] in binding)) refuse("postulate " names[q] " has no BUILTIN binding") + printf "%s|%s|%s\n", module, names[q], binding[names[q]] + } + delete names + } + delete decl + } +} diff --git a/src/Lintel/Composition.agda b/src/Lintel/Composition.agda index 9afa4b6a..5a4c3204 100644 --- a/src/Lintel/Composition.agda +++ b/src/Lintel/Composition.agda @@ -21,7 +21,7 @@ -- link-writable and it can be written there, so the refusal is -- not a refusal of everything -- --- Pin: hyperpolymath/secret-types 45046c2c0f92ddae2ff73c8c05555bed419f46ad +-- Pin: hyperpolymath/secret-types 9fb8430c3aa2d1d89016619722dc0a2631df0566 -- SecretTypes.Vars, SecretTypes.Lang, SecretTypes.Typing.Generic -- (scripts/fetch-siblings.sh) module Lintel.Composition where diff --git a/src/Lintel/Instance.agda b/src/Lintel/Instance.agda index 7ca8bd6c..a4fe1e19 100644 --- a/src/Lintel/Instance.agda +++ b/src/Lintel/Instance.agda @@ -17,7 +17,7 @@ -- coalition-blind ... nor the client's local state, so coalition TINI -- relates stores that differ there -- --- Pin: hyperpolymath/secret-types 45046c2c0f92ddae2ff73c8c05555bed419f46ad +-- Pin: hyperpolymath/secret-types 9fb8430c3aa2d1d89016619722dc0a2631df0566 -- SecretTypes.Vars, SecretTypes.Lang, SecretTypes.Lattice.Record, -- SecretTypes.Noninterference.Generic (scripts/fetch-siblings.sh) module Lintel.Instance where diff --git a/src/Lintel/Lattice.agda b/src/Lintel/Lattice.agda index 75f30de5..5b0fe870 100644 --- a/src/Lintel/Lattice.agda +++ b/src/Lintel/Lattice.agda @@ -22,7 +22,7 @@ -- here. -- -- Pins: --- hyperpolymath/secret-types 45046c2c0f92ddae2ff73c8c05555bed419f46ad +-- hyperpolymath/secret-types 9fb8430c3aa2d1d89016619722dc0a2631df0566 -- SecretTypes.Prelude, imported (scripts/fetch-siblings.sh) -- hyperpolymath/proven-servers b58289e7862139efd918561a7ddc9cb5605ea9d8 -- protocols/proven-odns/src/ODNS/Types.idr, Role = Client | Proxy | Target; diff --git a/tests/check-legs-test.sh b/tests/check-legs-test.sh index ce775c55..46ef8b96 100644 --- a/tests/check-legs-test.sh +++ b/tests/check-legs-test.sh @@ -127,7 +127,8 @@ done for stage in SIBLING ROCQ BUILD LEAN; do reset_case export "TEST_${stage}_STATUS=17" - check 1 'does not check' + if [[ "$stage" == BUILD ]]; then check 1 'FAIL: the Lean leg does not build' + else check 1 'does not check'; fi if [[ "$stage" == SIBLING || "$stage" == ROCQ ]]; then if grep -q '^lake ' "$TEST_CALLS"; then exit 1; fi elif [[ "$stage" == BUILD ]]; then diff --git a/tests/grade-receipt-legs-test.sh b/tests/grade-receipt-legs-test.sh deleted file mode 100644 index 98ce1bff..00000000 --- a/tests/grade-receipt-legs-test.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: MPL-2.0 -# Exercise the new legs receipt against an isolated, synthetic sibling tree. -set -euo pipefail -root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)" -fixture="$(mktemp -d)" -trap 'rm -rf "$fixture"' EXIT -mkdir -p "$fixture/scripts" "$fixture/verification" "$fixture/src/Lintel" \ - "$fixture/tests/accept" "$fixture/tests/reject" "$fixture/dependencies/secret-types/src" -cp "$root/scripts/"{grade-receipt,proof-flags,fetch-siblings,check-legs}.sh "$fixture/scripts/" -cp "$root/README.adoc" "$fixture/" -cp -R "$root/verification/legs" "$fixture/verification/" -printf 'module Lintel.All where\nimport SecretTypes\n' > "$fixture/src/Lintel/All.agda" -printf 'module SecretTypes where\n' > "$fixture/dependencies/secret-types/src/SecretTypes.agda" -# The receipt hashes sibling inputs without invoking a prover. Deliberately -# distinct contents make accidentally hashing Lintel's files detectable. -sibling_files=(verification/legs/rocq/SecretTypes.v verification/legs/lean/SecretTypes/Generic.lean - verification/legs/lean/lakefile.toml verification/legs/lean/lean-toolchain) -for file in "${sibling_files[@]}"; do - mkdir -p "$fixture/dependencies/secret-types/$(dirname "$file")" - printf 'synthetic sibling input: %s\n' "$file" > "$fixture/dependencies/secret-types/$file" -done -export DEPENDENCIES_DIR="$fixture/dependencies" SECRET_TYPES_SRC="$fixture/dependencies/secret-types/src" -receipt="$fixture/verification/receipts/agda-pwg_praxis.deed" -check() { - local expected="$1" diagnostic="$2" status=0 - shift 2 - bash "$fixture/scripts/grade-receipt.sh" "$@" > "$fixture/output" 2>&1 || status=$? - if [[ "$status" != "$expected" ]] || ! grep -qF "$diagnostic" "$fixture/output"; then - cat "$fixture/output" >&2 - echo "FAIL: $diagnostic (expected $expected, got $status)" >&2 - exit 1 - fi - echo "PASS: $diagnostic" -} -write_receipt() { check 0 WROTE --write --commit aaaaaaaaaaaa; } -check_receipt() { check 0 'PASS: verification receipt matches the tree' --check --commit bbbbbbbbbbbb; } -write_receipt -check_receipt # Parent revision is intentionally ignored by --check. -cp "$receipt" "$fixture/first-receipt" -write_receipt -cmp "$receipt" "$fixture/first-receipt" -grep -qF ':prover "rocq" :checker "coqc" :version "8.18.0"' "$receipt" -grep -qF ':prover "lean" :checker "lean" :version "4.24.0"' "$receipt" -grep -qxF ' :state "RECONCILED"' "$receipt" -for id in L-1 L-2 L-3 L-4 L-6 L-7; do - grep -qxF " (claim :id \"$id\" :token \"proven\" :pwg \"2ii\" :coq-leg \"re-proved\" :lean-leg \"re-proved\")" "$receipt" -done -for row in 'L-5 tested-only' 'A-1 argued'; do - read -r id token <<< "$row" - grep -qxF " (claim :id \"$id\" :token \"$token\" :pwg \"n/a\" :coq-leg \"n/a\" :lean-leg \"n/a\")" "$receipt" -done -# Independently enumerate all local inputs, checking exact hashes and that -# each appears once. Sorted output must not depend on filesystem order. -mapfile -t own_files < <(cd "$fixture" && find verification/legs -type f \ - \( -name '*.v' -o -name '*.lean' -o -name lakefile.toml -o -name lean-toolchain \) | LC_ALL=C sort) -for file in "${own_files[@]}"; do - hash="$(sha256sum "$fixture/$file" | cut -d' ' -f1)" - [[ "$(grep -cxF " (input :path \"$file\" :sha256 \"$hash\")" "$receipt")" == 1 ]] -done -for file in "${sibling_files[@]}"; do - hash="$(sha256sum "$fixture/dependencies/secret-types/$file" | cut -d' ' -f1)" - [[ "$(grep -cxF " (input :repository \"hyperpolymath/secret-types\" :path \"$file\" :sha256 \"$hash\")" "$receipt")" == 1 ]] -done -[[ "$(grep -c '^ (input ' "$receipt")" == $((${#own_files[@]} + ${#sibling_files[@]})) ]] -# Build caches are deliberately excluded from source hashing. -mkdir -p "$fixture/verification/legs/lean/.lake/packages/example" -echo 'generated build artifact' > "$fixture/verification/legs/lean/.lake/packages/example/Generated.lean" -check_receipt -# Every category of local and sibling input must invalidate a stale receipt. -for file in "${own_files[@]}"; do - cp "$fixture/$file" "$fixture/saved" - printf '\n-- changed input\n' >> "$fixture/$file" - check 1 'ERROR: verification receipt does not match the tree' --check --commit bbbbbbbbbbbb - cp "$fixture/saved" "$fixture/$file" -done -for file in "${sibling_files[@]}"; do - cp "$fixture/dependencies/secret-types/$file" "$fixture/saved" - echo 'changed sibling input' >> "$fixture/dependencies/secret-types/$file" - check 1 'ERROR: verification receipt does not match the tree' --check --commit bbbbbbbbbbbb - cp "$fixture/saved" "$fixture/dependencies/secret-types/$file" - mv "$fixture/dependencies/secret-types/$file" "$fixture/missing" - check 1 'ERROR: sibling leg file' --check --commit bbbbbbbbbbbb - mv "$fixture/missing" "$fixture/dependencies/secret-types/$file" -done -# Checker pins are derived from the gate, not independently hard-coded. -sed -i 's/^COQ_VERSION=.*/COQ_VERSION=8.19.0/; s/^LEAN_VERSION=.*/LEAN_VERSION=4.25.0/' "$fixture/scripts/check-legs.sh" -check 1 'ERROR: verification receipt does not match the tree' --check --commit bbbbbbbbbbbb -write_receipt -grep -qF ':prover "rocq" :checker "coqc" :version "8.19.0"' "$receipt" -grep -qF ':prover "lean" :checker "lean" :version "4.25.0"' "$receipt" -check_receipt -# Cross-check correspondence rows in both directions. Repeated rows are -# legitimate: a claim may map to more than one theorem. -record="$fixture/verification/legs/README.adoc" -cp "$record" "$fixture/record" -printf '\n| L-1\n' >> "$record" -check_receipt -for id in L-1 L-2 L-3 L-4 L-6 L-7; do - sed "/^| $id$/d" "$fixture/record" > "$record" - check 1 'ERROR: claims with a counted leg differ' --check --commit bbbbbbbbbbbb - grep -qF "only in grade-receipt.sh: $id" "$fixture/output" -done -for id in L-5 A-1 L-99; do - cp "$fixture/record" "$record" - printf '\n| %s\n' "$id" >> "$record" - check 1 'ERROR: claims with a counted leg differ' --check --commit bbbbbbbbbbbb - grep -qF "only in verification/legs/README.adoc: $id" "$fixture/output" -done -rm "$record" -check 1 'ERROR: claims with a counted leg differ' --check --commit bbbbbbbbbbbb -cp "$fixture/record" "$record" -check_receipt diff --git a/tests/legs-receipt-test.sh b/tests/legs-receipt-test.sh index 30bef9ef..ec53c635 100644 --- a/tests/legs-receipt-test.sh +++ b/tests/legs-receipt-test.sh @@ -6,34 +6,44 @@ fixture="$(mktemp -d)" trap 'rm -rf "$fixture"' EXIT mkdir -p "$fixture/scripts" "$fixture/src/Lintel" "$fixture/tests/accept" "$fixture/tests/reject" "$fixture/bin" cp "$root/scripts/"{check-legs,grade-receipt,proof-flags,fetch-siblings}.sh "$fixture/scripts/" -cp "$root/README.adoc" "$fixture/" -mkdir -p "$fixture/verification" +mkdir -p "$fixture/docs/status" "$fixture/verification" +cp "$root/docs/status/PROOF-STATUS.adoc" "$fixture/docs/status/" cp -R "$root/verification/legs" "$fixture/verification/" sibling="$fixture/_build/dependencies/secret-types" -mkdir -p "$sibling/src" "$sibling/verification/legs/rocq" "$sibling/verification/legs/lean/SecretTypes" -mkdir -p "$sibling/src/SecretTypes" -printf "import SecretTypes.Prelude\n" > "$fixture/src/Lintel/All.agda" -touch "$sibling/src/SecretTypes/Prelude.agda" "$sibling/verification/legs/rocq/SecretTypes.v" \ - "$sibling/verification/legs/lean/SecretTypes/Generic.lean" \ +mkdir -p "$sibling/verification/legs/rocq" "$sibling/verification/legs/lean/SecretTypes" +touch "$sibling/verification/legs/rocq/SecretTypes.v" "$sibling/verification/legs/lean/SecretTypes/Generic.lean" \ "$sibling/verification/legs/lean/lean-toolchain" "$sibling/verification/legs/lean/lakefile.toml" -# A baseline receipt can be generated, but neither pending leg may overwrite it. -bash "$fixture/scripts/grade-receipt.sh" --write > /dev/null -receipt="$fixture/verification/receipts/agda-pwg_praxis.deed" -cp "$receipt" "$fixture/baseline" +# The receipt's cross-checks run in the shared generator (standards' +# scripts/proof-receipt.sh, tested there). What is Lintel's are the hooks they +# read: the claim ids of the proof-status table and the claims whose two legs +# the legs record lists as RECONCILED. Sourcing grade-receipt.sh defines them +# and runs nothing. +hooks() { (cd "$fixture" && . scripts/grade-receipt.sh && "$@"); } +theorems="$(hooks receipt_claims | awk -F'|' '$3=="theorem"{print $1}' | sort | paste -sd' ')" +[ "$(hooks receipt_recorded_legs | sort | paste -sd' ')" = "$theorems" ] +echo "PASS: the legs record lists both legs RECONCILED for exactly the theorems ($theorems)" +[ "$(hooks receipt_status_ids | sort | paste -sd' ')" = "$(hooks receipt_claims | cut -d'|' -f1 | sort | paste -sd' ')" ] +echo "PASS: the proof-status table names exactly the claims of the ledger" for leg in rocq lean; do if [ "$leg" = rocq ]; then sed 's/| L-1 | RECONCILED | RECONCILED/| L-1 | PENDING | RECONCILED/' "$root/verification/legs/README.adoc" > "$fixture/verification/legs/README.adoc" else sed 's/| L-1 | RECONCILED | RECONCILED/| L-1 | RECONCILED | PENDING/' "$root/verification/legs/README.adoc" > "$fixture/verification/legs/README.adoc" fi - status=0 - bash "$fixture/scripts/grade-receipt.sh" --write > "$fixture/output" 2>&1 || status=$? - [ "$status" -eq 1 ] - grep -q 'counted legs must match RECONCILED states' "$fixture/output" - cmp "$receipt" "$fixture/baseline" - echo "PASS: pending $leg correspondence rejects receipt generation" + ! hooks receipt_recorded_legs | grep -qx 'L-1' + echo "PASS: a pending $leg correspondence drops L-1 from the recorded legs" done +cp "$root/verification/legs/README.adoc" "$fixture/verification/legs/README.adoc" +printf '\n| L-1 | RECONCILED | PENDING\n' >> "$fixture/verification/legs/README.adoc" +! hooks receipt_recorded_legs | grep -qx 'L-1' +echo "PASS: a second row for L-1 that disagrees drops it too" +cp "$root/verification/legs/README.adoc" "$fixture/verification/legs/README.adoc" +rm "$fixture/verification/legs/README.adoc" +status=0; hooks receipt_recorded_legs > /dev/null 2>&1 || status=$? +[ "$status" -eq 3 ] +echo "PASS: a missing legs record is a hook refusal, not an empty list" +cp "$root/verification/legs/README.adoc" "$fixture/verification/legs/README.adoc" # Fake checkers exercise orchestration and diagnostics, not proof correctness. cat > "$fixture/bin/coqc" <<'COQ' diff --git a/tests/trusted-base/CarriageReturn.txt b/tests/trusted-base/CarriageReturn.txt new file mode 100644 index 00000000..b8c11e72 --- /dev/null +++ b/tests/trusted-base/CarriageReturn.txt @@ -0,0 +1,6 @@ +-- SPDX-License-Identifier: MPL-2.0 +-- Refusal control: CRLF line ends. Agda reads a carriage return as +-- whitespace, but the scan does not lex it, so it refuses the file. +module Fixture.CarriageReturn where +postulate + Hidden : Set diff --git a/tests/trusted-base/CommentsOnly.expected b/tests/trusted-base/CommentsOnly.expected new file mode 100644 index 00000000..e69de29b diff --git a/tests/trusted-base/CommentsOnly.txt b/tests/trusted-base/CommentsOnly.txt new file mode 100644 index 00000000..b3a834ec --- /dev/null +++ b/tests/trusted-base/CommentsOnly.txt @@ -0,0 +1,8 @@ +-- SPDX-License-Identifier: MPL-2.0 +-- Negative control: postulate appears only in comments and a pragma body, +-- so a scan finds no postulate. Not an Agda module of the development. +module Fixture.CommentsOnly where +-- postulate X : Set +{- postulate Y : Set {- postulate Z : Set -} -} +{-# BUILTIN NOTHING postulate #-} +data T : Set where t : T diff --git a/tests/trusted-base/FormFeed.txt b/tests/trusted-base/FormFeed.txt new file mode 100644 index 00000000..07571da2 --- /dev/null +++ b/tests/trusted-base/FormFeed.txt @@ -0,0 +1,7 @@ +-- SPDX-License-Identifier: MPL-2.0 +-- Refusal control: a form feed between `postulate` and the name. Agda reads +-- it as whitespace, so the scan must refuse the file or it would miss Hidden. +-- The form feed is put in by scripts/check-trusted-base.sh (the estate scan +-- refuses control bytes in the tree), in place of the space on the last line. +module Fixture.FormFeed where +postulate Hidden : Set diff --git a/tests/trusted-base/NestedModule.txt b/tests/trusted-base/NestedModule.txt new file mode 100644 index 00000000..ded19816 --- /dev/null +++ b/tests/trusted-base/NestedModule.txt @@ -0,0 +1,11 @@ +-- SPDX-License-Identifier: MPL-2.0 +-- Refusal control: a nested module reuses the short name of a bound +-- postulate for an unbound one. BUILTIN bindings are keyed by short name, +-- so the scan refuses any module after the first. +module Fixture.NestedModule where +postulate + A : Set +{-# BUILTIN ONE A #-} +module Inner where + postulate + A : Set diff --git a/tests/trusted-base/Positive.expected b/tests/trusted-base/Positive.expected new file mode 100644 index 00000000..8b6c3826 --- /dev/null +++ b/tests/trusted-base/Positive.expected @@ -0,0 +1,5 @@ +Fixture.Positive|A|BUILTIN ONE +Fixture.Positive|b|BUILTIN TWO +Fixture.Positive|c|BUILTIN THREE +Fixture.Positive|d|BUILTIN FOUR +Fixture.Positive|e|BUILTIN FIVE diff --git a/tests/trusted-base/Positive.txt b/tests/trusted-base/Positive.txt new file mode 100644 index 00000000..cee69610 --- /dev/null +++ b/tests/trusted-base/Positive.txt @@ -0,0 +1,28 @@ +-- SPDX-License-Identifier: MPL-2.0 +-- Positive control for scripts/scan-agda-postulates.awk: a scan must find +-- every postulate below, in every layout, and nothing in the comments. +-- Not an Agda module of the development (.txt, so no gate checks it). +{-# OPTIONS --without-K #-} +module Fixture.Positive where + +{- A block comment that names a postulate: + postulate Hidden : Set + {- nested: postulate Deeper : Set -} +-} + +postulate + A : Set + b c : A + +{-# BUILTIN ONE A #-} +{-# BUILTIN TWO b #-} +{-# BUILTIN THREE c #-} + +private postulate d : A +{-# BUILTIN FOUR d #-} + +postulate + e : A → + A +-- postulate NotThis : Set +{-# BUILTIN FIVE e #-} diff --git a/tests/trusted-base/StringLiteral.txt b/tests/trusted-base/StringLiteral.txt new file mode 100644 index 00000000..71c09210 --- /dev/null +++ b/tests/trusted-base/StringLiteral.txt @@ -0,0 +1,7 @@ +-- SPDX-License-Identifier: MPL-2.0 +-- Refusal control: the scan does not lex string literals, so it refuses a +-- file that has one (a "{-" inside a string could hide a postulate). +module Fixture.StringLiteral where +s = "{-" +postulate + Hidden : Set diff --git a/tests/trusted-base/Unbound.txt b/tests/trusted-base/Unbound.txt new file mode 100644 index 00000000..508c8f6b --- /dev/null +++ b/tests/trusted-base/Unbound.txt @@ -0,0 +1,6 @@ +-- SPDX-License-Identifier: MPL-2.0 +-- Refusal control: a postulate with no BUILTIN binding is an axiom of the +-- development, not part of the prover's trusted base. The scan refuses it. +module Fixture.Unbound where +postulate + Bad : Set diff --git a/verification/legs/README.adoc b/verification/legs/README.adoc index 70c5b743..e60e29b8 100644 --- a/verification/legs/README.adoc +++ b/verification/legs/README.adoc @@ -208,12 +208,11 @@ a theorem (§8.1). and its Agda statement rests on the comparison above. Claude Code wrote it, and it is provisional until the owner reviews it (estate doctrine 4). No tool checks it. -* L-6 rests on secret-types' legs of N-7, as the Agda rests on N-7. Their - grade bounds this one. +* L-6 rests on secret-types' legs of N-7, as the Agda rests on N-7. Each run + of a leg checks those files at the pin, and the receipt lists them as an + `(import …)`, so the receipt of L-6 covers them. * `foundation_diverse` (§8.3) stays false. Agda, Rocq and Lean are all dependent type theories. -* The grade is `PWG-2ii`, not `PWG-1`. `PWG-1` needs a receipt per witness, - per commit, recording the observed result of a pinned checker run on that - commit (§8.2). The receipt here records each leg's version, invocation and - input digests, the sibling's leg files included. The CI log of the `legs` - job is the observed result, and it is not yet captured as a receipt. +* The receipt counts these legs toward the grade because their state is + `RECONCILED`. That state rests on the comparison above, so any grade the + receipt derives is provisional with it. diff --git a/verification/receipts/agda-pwg_praxis.deed b/verification/receipts/agda-pwg_praxis.deed index 4735f2cf..3258e487 100644 --- a/verification/receipts/agda-pwg_praxis.deed +++ b/verification/receipts/agda-pwg_praxis.deed @@ -1,105 +1,170 @@ ;; SPDX-License-Identifier: CC-BY-SA-4.0 ;; SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell -;; GENERATED by scripts/grade-receipt.sh; regenerate with --write, check with --check. -;; This describes the gate and tree; the CI log is the execution evidence. +;; The proof receipt of Lintel (PROOF-POLICY §8.5.1). +;; GENERATED by scripts/grade-receipt.sh with the shared generator of the +;; standard (scripts/proof-receipt.sh): regenerate with --write, check with --check. +;; L-5 (checked refusals) and A-1 (an assumption) are not theorems (§8.1). +;; The trusted base is what scripts/check-trusted-base.sh finds in the +;; prover-supplied modules of the import cone of src/Lintel/All.agda. (praxis-deed :schema-version "1.0.0" - :canonical-name "lintel-agda-pwg-receipt" - (identity - :project "lintel" - :name "agda verification receipt (Proof Witness Grades)" - :repository "metadatastician/lintel" - :repo-uuid #u5"github.com/metadatastician/lintel" - :kind "theory" - :source-commit "01bf2bf14192") - (prover - :tool "agda" - :version "2.6.4.3" - :provenance "Debian 13 agda-bin=2.6.4.3-1+b2" - :library "none (--no-libraries; Agda builtins and the pinned sibling only)" - :flags "--safe --without-K --cubical-compatible --no-libraries --ignore-interfaces --double-check -W error" - :flags-source "scripts/proof-flags.sh") - (conformance - :policy "standards/3-practice/PROOF-POLICY.adoc" - :policy-revision "section 2.1 dated 2026-11-01; section 8 (PWG) dated 2026-11-04" - :canonical-invocation "agda --safe --without-K --cubical-compatible" - :cubical-compatible "met" - :stronger-than-canonical ("--no-libraries" "--ignore-interfaces" "--double-check" "-W error")) - (gate - :command "bash scripts/check.sh" - :ci ".github/workflows/proofs.yml" - :module-count 4 - :fixture-count 9) - (trust-base - :postulates 0 - :escape-hatches 0 - :library-dependencies 0 - :axioms-assumed 0 - :assumption "A-1 non-collusion is a stated hypothesis of the threat model (argued), not an axiom of any proof") - ; PWGs apply to theory theorems (PROOF-POLICY section 8.1); L-5 (refusal fixtures) and A-1 (an assumption) are n/a. - ; Rocq and Lean legs: re-proved by hand on top of secret-types' legs, RECONCILED in verification/legs/README.adoc. - (legs - :gate "bash scripts/check-legs.sh" - :ci ".github/workflows/proofs.yml (job legs)" - :correspondence "verification/legs/README.adoc" - :route "re-proved" - :route-reason "Agda2Dedukti is an Agda backend pinned to a fork (b026db1, GHC 8.10) and cannot run on Agda 2.6.4.3; no released Dedukti/Lambdapi exporter to Lean 4, and no pinned route to Rocq" - :state "RECONCILED" - :review "statement comparison written by Claude Code; provisional until owner review (estate doctrine 4)" - :depends-on "secret-types legs at the sibling pin (record, language, typing, TINI): imported, not restated" - (leg :prover "rocq" :checker "coqc" :version "8.18.0" :invocation "coqc -q -Q /verification/legs/rocq SecretTypesLeg Lintel.v (in verification/legs/rocq)" :libraries "secret-types Rocq leg only (no standard library)" :axioms "none (Print Assumptions: Closed under the global context)") - (leg :prover "lean" :checker "lean" :version "4.24.0" :invocation "lake build; lake env lean Axioms.lean (in verification/legs/lean)" :libraries "secret-types Lean leg only (no Mathlib)" :axioms "none (#print axioms: does not depend on any axioms)") - (inputs - (input :path "verification/legs/rocq/Lintel.v" :sha256 "72fefcaa4af7facf71ebd7c9891fd55e1d388a51743f1ae3bf2e2bff1d4d218c") - (input :path "verification/legs/lean/Axioms.lean" :sha256 "fbc9517313f1d519b393b3af2dfaf23a3570b03d0d63eec672d12578d0d94cb6") - (input :path "verification/legs/lean/Lintel.lean" :sha256 "40ebf309ee76002da974837a9accfbe4de25d4e7faaa30305d33b01bafc93a9e") - (input :path "verification/legs/lean/Lintel/Composition.lean" :sha256 "03d3fe71419c3f0340c200454248301e990f9fc540e43798753eee42e93d196a") - (input :path "verification/legs/lean/Lintel/Instance.lean" :sha256 "643fd533fd646e5df59c72ab593d13b137ae233bcd1e98bf4e56462dd785c0e5") - (input :path "verification/legs/lean/Lintel/Lattice.lean" :sha256 "0b2134c82b60bd0f4332a432e8b1c0eff00c0cc55b2a1f6ebca5abb419503519") - (input :path "verification/legs/lean/lakefile.toml" :sha256 "9f3404bcc6575c35111450ac45e86bdac94ea7e034b05e4bc5e2032ca5392f8b") - (input :path "verification/legs/lean/lean-toolchain" :sha256 "387019dd5f6d8213249f99bfe1bd9f346678bf0d4612938c1e7feae386665335") - (input :repository "hyperpolymath/secret-types" :path "verification/legs/rocq/SecretTypes.v" :sha256 "acffaa9b4884b46c61fae6f2c91a34e7005b5d4b6158ebcc83bde25bc573b75e") - (input :repository "hyperpolymath/secret-types" :path "verification/legs/lean/SecretTypes/Generic.lean" :sha256 "13b10fd744828bc5ea3551346aeaa7795b51f24e8585e26c9dc737805c054cfa") - (input :repository "hyperpolymath/secret-types" :path "verification/legs/lean/lakefile.toml" :sha256 "75b8b79a27ec284d2c383302c88c90248ab56ee9902664068140d014b45bcf34") - (input :repository "hyperpolymath/secret-types" :path "verification/legs/lean/lean-toolchain" :sha256 "387019dd5f6d8213249f99bfe1bd9f346678bf0d4612938c1e7feae386665335") - )) - (claims - (claim :id "L-1" :token "proven" :pwg "2ii" :coq-leg "re-proved" :lean-leg "re-proved") - (claim :id "L-2" :token "proven" :pwg "2ii" :coq-leg "re-proved" :lean-leg "re-proved") - (claim :id "L-3" :token "proven" :pwg "2ii" :coq-leg "re-proved" :lean-leg "re-proved") - (claim :id "L-4" :token "proven" :pwg "2ii" :coq-leg "re-proved" :lean-leg "re-proved") - (claim :id "L-5" :token "tested-only" :pwg "n/a" :coq-leg "n/a" :lean-leg "n/a") - (claim :id "L-6" :token "proven" :pwg "2ii" :coq-leg "re-proved" :lean-leg "re-proved") - (claim :id "L-7" :token "proven" :pwg "2ii" :coq-leg "re-proved" :lean-leg "re-proved") - (claim :id "A-1" :token "argued" :pwg "n/a" :coq-leg "n/a" :lean-leg "n/a") - ) - ; The import cone: every module the proofs rest on, hashed. - (modules - (module :path "src/Lintel/All.agda" :sha256 "0d1e310a5ae125ce7aeaa72cfce69355c9f361cdbc1cf6dbb5a9c4e13f51cdfd") - (module :path "src/Lintel/Composition.agda" :sha256 "4b4652780509ed2dbd26533b30ae0e4c99169b9bb258e22b9cf4acc2432cd8fc") - (module :path "src/Lintel/Instance.agda" :sha256 "6780327016175c6c1358bce0e58a5cf766b3632b4582988a59dc08f5339f014e") - (module :path "src/Lintel/Lattice.agda" :sha256 "abdf9416abc4abb8f5187167b508363e8fef7f81007dd803bc154fc2ee21704a") - ) - (sibling - :repository "hyperpolymath/secret-types" - :commit "45046c2c0f92ddae2ff73c8c05555bed419f46ad" - (module :path "src/SecretTypes/Lang.agda" :sha256 "957333acdcc5c67692630411cd7a82e96075f07533b0d2cc7c99d000b1522570") - (module :path "src/SecretTypes/Lattice/Record.agda" :sha256 "25f4ee821b8e245dccb4f5f7eae9c3f1006a4b6eaeab3af14646721f14f83de3") - (module :path "src/SecretTypes/Noninterference/Generic.agda" :sha256 "7c86fcc801e256a2c4869c5ccc8302a93daa0a882e2493056e68b329ff79602a") - (module :path "src/SecretTypes/Noninterference/Statement.agda" :sha256 "f76d84eb3a434c2f9f4203303fcf30fb04282afe787ce085d4590855b43e4c45") - (module :path "src/SecretTypes/Prelude.agda" :sha256 "5fea408acc63e0c91a293463913ef8f167a722cc1665f7a7010b26c8520c4072") - (module :path "src/SecretTypes/Typing/Generic.agda" :sha256 "adacd5405be17ccbf845c56d2d7980d2b0eae7214a284df2bf5a64d64ccf7718") - (module :path "src/SecretTypes/Vars.agda" :sha256 "f188cbc8b630b036daac4720f3cfe492bf78671f87b82850919f09091ead5422") - ) - (fixtures - (fixture :path "tests/accept/LinkToClient.agda") - (fixture :path "tests/accept/ProgramField.agda") - (fixture :path "tests/accept/ProgramFieldGuarded.agda") - (fixture :path "tests/accept/ProgramLinkLocal.agda") - (fixture :path "tests/accept/ProxyWitnesses.agda") - (fixture :path "tests/reject/LinkToProxy.agda") - (fixture :path "tests/reject/LinkToTarget.agda") - (fixture :path "tests/reject/ProgramLink.agda") - (fixture :path "tests/reject/ProgramLinkImplicit.agda") - ) + :canonical-name "lintel-proof-receipt" + :profile proof-receipt + :repository "metadatastician/lintel" + :source-commit "d7bdc21a1264f08d7b4368f5d5dadc163630a1bc" + (trusted-base + (primitive :prover agda :module "Agda.Primitive" :name "Level" :binding "BUILTIN LEVEL") + (primitive :prover agda :module "Agda.Primitive" :name "lzero" :binding "BUILTIN LEVELZERO") + (primitive :prover agda :module "Agda.Primitive" :name "lsuc" :binding "BUILTIN LEVELSUC") + (primitive :prover agda :module "Agda.Primitive" :name "_⊔_" :binding "BUILTIN LEVELMAX")) + (claim :id "L-1" :pwg ungraded :foundation-diverse #f + (leg :prover agda :route source :token proven :state AGDA-VERIFIED + ; the run reported: PASS: Lintel proofs, 5 positive control(s), 4 expected rejection(s), negative control + (receipt :run "https://github.com/metadatastician/lintel/actions/runs/42740256887/attempts/1" + :commit "89ceac3b8685467c664737a98364eef4febb9ff2" + :checker "Agda version 2.6.4.3 (Debian 13 agda-bin=2.6.4.3-1+b2, container debian:13-slim)" + :invocation "agda --safe --without-K --cubical-compatible --no-libraries --ignore-interfaces --double-check -W error -i src -i _build/dependencies/secret-types/src src/Lintel/All.agda" + :state superseded + :reason "the re-pin of secret-types from 45046c2 to 9fb8430 changed the inputs; the first run on main after it replaces this one")) + (leg :prover rocq :route re-proved :token proven :state RECONCILED + ; the run reported: PASS: Rocq leg (Coq 8.18.0), 36 statements closed under the global context + (receipt :run "https://github.com/metadatastician/lintel/actions/runs/42740256887/attempts/1" + :commit "89ceac3b8685467c664737a98364eef4febb9ff2" + :checker "Coq 8.18.0 (Ubuntu 24.04 coq=8.18.0+dfsg-1build2, bare runner)" + :invocation "coqc -q -Q . SecretTypesLeg SecretTypes.v (in the secret-types leg); coqc -q -Q ../../../_build/dependencies/secret-types/verification/legs/rocq SecretTypesLeg Lintel.v (in verification/legs/rocq)" + :state superseded + :reason "the re-pin of secret-types from 45046c2 to 9fb8430 changed the inputs, and this run was on a bare runner (PROOF-POLICY 8.2 isolation); the first run on main in the pinned image replaces it")) + (leg :prover lean :route re-proved :token proven :state RECONCILED + ; the run reported: PASS: Lean leg (Lean 4.24.0, core only), 36 statements depend on no axioms + (receipt :run "https://github.com/metadatastician/lintel/actions/runs/42740256887/attempts/1" + :commit "89ceac3b8685467c664737a98364eef4febb9ff2" + :checker "Lean 4.24.0 (release tarball, bare runner)" + :invocation "lake build; lake env lean Axioms.lean (in verification/legs/lean)" + :state superseded + :reason "the re-pin of secret-types from 45046c2 to 9fb8430 changed the inputs, and this run was on a bare runner (PROOF-POLICY 8.2 isolation); the first run on main in the pinned image replaces it"))) + (claim :id "L-2" :pwg ungraded :foundation-diverse #f + (leg :prover agda :route source :token proven :state AGDA-VERIFIED + ; the run reported: PASS: Lintel proofs, 5 positive control(s), 4 expected rejection(s), negative control + (receipt :run "https://github.com/metadatastician/lintel/actions/runs/42740256887/attempts/1" + :commit "89ceac3b8685467c664737a98364eef4febb9ff2" + :checker "Agda version 2.6.4.3 (Debian 13 agda-bin=2.6.4.3-1+b2, container debian:13-slim)" + :invocation "agda --safe --without-K --cubical-compatible --no-libraries --ignore-interfaces --double-check -W error -i src -i _build/dependencies/secret-types/src src/Lintel/All.agda" + :state superseded + :reason "the re-pin of secret-types from 45046c2 to 9fb8430 changed the inputs; the first run on main after it replaces this one")) + (leg :prover rocq :route re-proved :token proven :state RECONCILED + ; the run reported: PASS: Rocq leg (Coq 8.18.0), 36 statements closed under the global context + (receipt :run "https://github.com/metadatastician/lintel/actions/runs/42740256887/attempts/1" + :commit "89ceac3b8685467c664737a98364eef4febb9ff2" + :checker "Coq 8.18.0 (Ubuntu 24.04 coq=8.18.0+dfsg-1build2, bare runner)" + :invocation "coqc -q -Q . SecretTypesLeg SecretTypes.v (in the secret-types leg); coqc -q -Q ../../../_build/dependencies/secret-types/verification/legs/rocq SecretTypesLeg Lintel.v (in verification/legs/rocq)" + :state superseded + :reason "the re-pin of secret-types from 45046c2 to 9fb8430 changed the inputs, and this run was on a bare runner (PROOF-POLICY 8.2 isolation); the first run on main in the pinned image replaces it")) + (leg :prover lean :route re-proved :token proven :state RECONCILED + ; the run reported: PASS: Lean leg (Lean 4.24.0, core only), 36 statements depend on no axioms + (receipt :run "https://github.com/metadatastician/lintel/actions/runs/42740256887/attempts/1" + :commit "89ceac3b8685467c664737a98364eef4febb9ff2" + :checker "Lean 4.24.0 (release tarball, bare runner)" + :invocation "lake build; lake env lean Axioms.lean (in verification/legs/lean)" + :state superseded + :reason "the re-pin of secret-types from 45046c2 to 9fb8430 changed the inputs, and this run was on a bare runner (PROOF-POLICY 8.2 isolation); the first run on main in the pinned image replaces it"))) + (claim :id "L-3" :pwg ungraded :foundation-diverse #f + (leg :prover agda :route source :token proven :state AGDA-VERIFIED + ; the run reported: PASS: Lintel proofs, 5 positive control(s), 4 expected rejection(s), negative control + (receipt :run "https://github.com/metadatastician/lintel/actions/runs/42740256887/attempts/1" + :commit "89ceac3b8685467c664737a98364eef4febb9ff2" + :checker "Agda version 2.6.4.3 (Debian 13 agda-bin=2.6.4.3-1+b2, container debian:13-slim)" + :invocation "agda --safe --without-K --cubical-compatible --no-libraries --ignore-interfaces --double-check -W error -i src -i _build/dependencies/secret-types/src src/Lintel/All.agda" + :state superseded + :reason "the re-pin of secret-types from 45046c2 to 9fb8430 changed the inputs; the first run on main after it replaces this one")) + (leg :prover rocq :route re-proved :token proven :state RECONCILED + ; the run reported: PASS: Rocq leg (Coq 8.18.0), 36 statements closed under the global context + (receipt :run "https://github.com/metadatastician/lintel/actions/runs/42740256887/attempts/1" + :commit "89ceac3b8685467c664737a98364eef4febb9ff2" + :checker "Coq 8.18.0 (Ubuntu 24.04 coq=8.18.0+dfsg-1build2, bare runner)" + :invocation "coqc -q -Q . SecretTypesLeg SecretTypes.v (in the secret-types leg); coqc -q -Q ../../../_build/dependencies/secret-types/verification/legs/rocq SecretTypesLeg Lintel.v (in verification/legs/rocq)" + :state superseded + :reason "the re-pin of secret-types from 45046c2 to 9fb8430 changed the inputs, and this run was on a bare runner (PROOF-POLICY 8.2 isolation); the first run on main in the pinned image replaces it")) + (leg :prover lean :route re-proved :token proven :state RECONCILED + ; the run reported: PASS: Lean leg (Lean 4.24.0, core only), 36 statements depend on no axioms + (receipt :run "https://github.com/metadatastician/lintel/actions/runs/42740256887/attempts/1" + :commit "89ceac3b8685467c664737a98364eef4febb9ff2" + :checker "Lean 4.24.0 (release tarball, bare runner)" + :invocation "lake build; lake env lean Axioms.lean (in verification/legs/lean)" + :state superseded + :reason "the re-pin of secret-types from 45046c2 to 9fb8430 changed the inputs, and this run was on a bare runner (PROOF-POLICY 8.2 isolation); the first run on main in the pinned image replaces it"))) + (claim :id "L-4" :pwg ungraded :foundation-diverse #f + (leg :prover agda :route source :token proven :state AGDA-VERIFIED + ; the run reported: PASS: Lintel proofs, 5 positive control(s), 4 expected rejection(s), negative control + (receipt :run "https://github.com/metadatastician/lintel/actions/runs/42740256887/attempts/1" + :commit "89ceac3b8685467c664737a98364eef4febb9ff2" + :checker "Agda version 2.6.4.3 (Debian 13 agda-bin=2.6.4.3-1+b2, container debian:13-slim)" + :invocation "agda --safe --without-K --cubical-compatible --no-libraries --ignore-interfaces --double-check -W error -i src -i _build/dependencies/secret-types/src src/Lintel/All.agda" + :state superseded + :reason "the re-pin of secret-types from 45046c2 to 9fb8430 changed the inputs; the first run on main after it replaces this one")) + (leg :prover rocq :route re-proved :token proven :state RECONCILED + ; the run reported: PASS: Rocq leg (Coq 8.18.0), 36 statements closed under the global context + (receipt :run "https://github.com/metadatastician/lintel/actions/runs/42740256887/attempts/1" + :commit "89ceac3b8685467c664737a98364eef4febb9ff2" + :checker "Coq 8.18.0 (Ubuntu 24.04 coq=8.18.0+dfsg-1build2, bare runner)" + :invocation "coqc -q -Q . SecretTypesLeg SecretTypes.v (in the secret-types leg); coqc -q -Q ../../../_build/dependencies/secret-types/verification/legs/rocq SecretTypesLeg Lintel.v (in verification/legs/rocq)" + :state superseded + :reason "the re-pin of secret-types from 45046c2 to 9fb8430 changed the inputs, and this run was on a bare runner (PROOF-POLICY 8.2 isolation); the first run on main in the pinned image replaces it")) + (leg :prover lean :route re-proved :token proven :state RECONCILED + ; the run reported: PASS: Lean leg (Lean 4.24.0, core only), 36 statements depend on no axioms + (receipt :run "https://github.com/metadatastician/lintel/actions/runs/42740256887/attempts/1" + :commit "89ceac3b8685467c664737a98364eef4febb9ff2" + :checker "Lean 4.24.0 (release tarball, bare runner)" + :invocation "lake build; lake env lean Axioms.lean (in verification/legs/lean)" + :state superseded + :reason "the re-pin of secret-types from 45046c2 to 9fb8430 changed the inputs, and this run was on a bare runner (PROOF-POLICY 8.2 isolation); the first run on main in the pinned image replaces it"))) + (claim :id "L-6" :pwg ungraded :foundation-diverse #f + (leg :prover agda :route source :token proven :state AGDA-VERIFIED + ; the run reported: PASS: Lintel proofs, 5 positive control(s), 4 expected rejection(s), negative control + (receipt :run "https://github.com/metadatastician/lintel/actions/runs/42740256887/attempts/1" + :commit "89ceac3b8685467c664737a98364eef4febb9ff2" + :checker "Agda version 2.6.4.3 (Debian 13 agda-bin=2.6.4.3-1+b2, container debian:13-slim)" + :invocation "agda --safe --without-K --cubical-compatible --no-libraries --ignore-interfaces --double-check -W error -i src -i _build/dependencies/secret-types/src src/Lintel/All.agda" + :state superseded + :reason "the re-pin of secret-types from 45046c2 to 9fb8430 changed the inputs; the first run on main after it replaces this one")) + (leg :prover rocq :route re-proved :token proven :state RECONCILED + ; the run reported: PASS: Rocq leg (Coq 8.18.0), 36 statements closed under the global context + (receipt :run "https://github.com/metadatastician/lintel/actions/runs/42740256887/attempts/1" + :commit "89ceac3b8685467c664737a98364eef4febb9ff2" + :checker "Coq 8.18.0 (Ubuntu 24.04 coq=8.18.0+dfsg-1build2, bare runner)" + :invocation "coqc -q -Q . SecretTypesLeg SecretTypes.v (in the secret-types leg); coqc -q -Q ../../../_build/dependencies/secret-types/verification/legs/rocq SecretTypesLeg Lintel.v (in verification/legs/rocq)" + :state superseded + :reason "the re-pin of secret-types from 45046c2 to 9fb8430 changed the inputs, and this run was on a bare runner (PROOF-POLICY 8.2 isolation); the first run on main in the pinned image replaces it")) + (leg :prover lean :route re-proved :token proven :state RECONCILED + ; the run reported: PASS: Lean leg (Lean 4.24.0, core only), 36 statements depend on no axioms + (receipt :run "https://github.com/metadatastician/lintel/actions/runs/42740256887/attempts/1" + :commit "89ceac3b8685467c664737a98364eef4febb9ff2" + :checker "Lean 4.24.0 (release tarball, bare runner)" + :invocation "lake build; lake env lean Axioms.lean (in verification/legs/lean)" + :state superseded + :reason "the re-pin of secret-types from 45046c2 to 9fb8430 changed the inputs, and this run was on a bare runner (PROOF-POLICY 8.2 isolation); the first run on main in the pinned image replaces it"))) + (claim :id "L-7" :pwg ungraded :foundation-diverse #f + (leg :prover agda :route source :token proven :state AGDA-VERIFIED + ; the run reported: PASS: Lintel proofs, 5 positive control(s), 4 expected rejection(s), negative control + (receipt :run "https://github.com/metadatastician/lintel/actions/runs/42740256887/attempts/1" + :commit "89ceac3b8685467c664737a98364eef4febb9ff2" + :checker "Agda version 2.6.4.3 (Debian 13 agda-bin=2.6.4.3-1+b2, container debian:13-slim)" + :invocation "agda --safe --without-K --cubical-compatible --no-libraries --ignore-interfaces --double-check -W error -i src -i _build/dependencies/secret-types/src src/Lintel/All.agda" + :state superseded + :reason "the re-pin of secret-types from 45046c2 to 9fb8430 changed the inputs; the first run on main after it replaces this one")) + (leg :prover rocq :route re-proved :token proven :state RECONCILED + ; the run reported: PASS: Rocq leg (Coq 8.18.0), 36 statements closed under the global context + (receipt :run "https://github.com/metadatastician/lintel/actions/runs/42740256887/attempts/1" + :commit "89ceac3b8685467c664737a98364eef4febb9ff2" + :checker "Coq 8.18.0 (Ubuntu 24.04 coq=8.18.0+dfsg-1build2, bare runner)" + :invocation "coqc -q -Q . SecretTypesLeg SecretTypes.v (in the secret-types leg); coqc -q -Q ../../../_build/dependencies/secret-types/verification/legs/rocq SecretTypesLeg Lintel.v (in verification/legs/rocq)" + :state superseded + :reason "the re-pin of secret-types from 45046c2 to 9fb8430 changed the inputs, and this run was on a bare runner (PROOF-POLICY 8.2 isolation); the first run on main in the pinned image replaces it")) + (leg :prover lean :route re-proved :token proven :state RECONCILED + ; the run reported: PASS: Lean leg (Lean 4.24.0, core only), 36 statements depend on no axioms + (receipt :run "https://github.com/metadatastician/lintel/actions/runs/42740256887/attempts/1" + :commit "89ceac3b8685467c664737a98364eef4febb9ff2" + :checker "Lean 4.24.0 (release tarball, bare runner)" + :invocation "lake build; lake env lean Axioms.lean (in verification/legs/lean)" + :state superseded + :reason "the re-pin of secret-types from 45046c2 to 9fb8430 changed the inputs, and this run was on a bare runner (PROOF-POLICY 8.2 isolation); the first run on main in the pinned image replaces it"))) )