Repository navigation
fix(receipt): harden the postulate scanner and receipt generator, re-earn receipts - #40
Conversation
The canon reader (readProofReceipt, standards be39f90) refused the old receipt with "unexpected clause (identity)", so no grade could be derived from it for N-1, N-2, N-3, N-7, N-8 and N-9. - scripts/grade-receipt.sh writes :profile proof-receipt, :repository, the full :source-commit, a (trusted-base ...) and one (claim ...) per theorem with its Agda, Rocq and Lean legs and their receipts. Demonstrations N-4, N-5 and N-6 have no claim (8.1). - Receipts come from a run ledger. The new CI job "receipt" prints the ledger rows of its own run, read from that run: checker version line, invocation, commit checked out, input digest and the axiom lines the gates printed. --check fails when a leg's inputs change after the run of its current receipt (8.4, regression drops the grade). - scripts/check-trusted-base.sh asks Agda for the import cone and checks that the prover-supplied postulates are exactly the list in scripts/proof-flags.sh (8.4), with scanner controls in tests/trusted-base/. - The pinned reader runs in CI (sha256-checked) with a negative control: a receipt with a wrong :pwg must be refused. - On a pull request, the proof jobs check out the head commit, not the merge commit, so a receipt names a commit that exists on the branch. No run is recorded yet, so the reader derives "ungraded" for every claim. The docs say so. The receipts of this commit's CI run follow in the next commit. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0136P7ZpWWL8fx57pcYvnHSZ
Run 43447816480 failed before the gate ran: actions/checkout marks the workspace as a safe directory only under a temporary HOME, so the next step's "git rev-parse HEAD" refused the clone with "dubious ownership". The step now marks the workspace safe itself. The legs job passed in that run. Also from SonarCloud on this PR: every case in scripts/grade-receipt.sh has a default branch that fails loudly, and functions copy positional parameters into named locals. The run-less receipt now names the current HEAD. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0136P7ZpWWL8fx57pcYvnHSZ
The receipt job of run 43448301280 (commit 88a763a) printed one ledger row for each witness: Agda 2.6.4.3, Coq 8.18.0 and Lean 4.24.0, each with its invocation, input digest and the axiom lines its gate printed. Those rows are now in runs() as current receipts. The local runs of 2026-11-12 at eaa7e97 are kept as superseded lineage, never current. The pinned reader (standards be39f90) accepts the receipt and derives PWG-1, foundation-diverse false, for N-1, N-2, N-3, N-7, N-8 and N-9. The negative control (a recorded PWG-2ii) is refused. The leg inputs are unchanged since 88a763a, so --check holds the receipt current. The grade rests on the RECONCILED statement comparisons, which stay provisional until the owner reviews them. The docs say so. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0136P7ZpWWL8fx57pcYvnHSZ
From the CodeRabbit review of PR #39; each finding was checked against the code first. - scan-agda-postulates.awk refuses a carriage return and any nested module. Both gaps were latent: the pinned prim modules have neither. But BUILTIN bindings are keyed by short name, so a nested module could reuse a bound name for an unbound postulate after a prover pin bump. New refusal controls: tests/trusted-base/CarriageReturn.txt (git keeps its CRLF bytes, .gitattributes) and NestedModule.txt. - grade-receipt.sh writes a waived or unavailable leg with only its :reason, as the reader requires (reason columns in the claim list). - --emit-run checks that the rows' input digests describe the tree. - The receipt job writes the receipt of its run before it checks the committed receipt, so a stale receipt cannot stop the rows from being printed. The check stays a failing gate. The scanner is an input of the Agda leg, so the Agda receipt of run 43448301280 no longer describes the tree. Its row is now superseded, with the reason, and the reader derives "ungraded" until the CI run of this commit is recorded in the next commit. The docs still say PWG-1 for that one commit. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0136P7ZpWWL8fx57pcYvnHSZ
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0136P7ZpWWL8fx57pcYvnHSZ # Conflicts: # .github/workflows/proofs.yml # scripts/grade-receipt.sh # scripts/scan-agda-postulates.awk # verification/receipts/agda_praxis.deed
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 21 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
🟢 clean · commit Advisory: 11 row(s), worst 🔴 high (0 critical, 9 high) — reported, never grading the change.
Hypatia scan: 11 finding(s)
panic-attack assail: 17 finding(s)
pons asinorum: 9 finding(s)
finishingbot (release readiness): 174 finding(s)
glambot (presentation quality): 94 finding(s)
rhodibot (RSR compliance): 13 finding(s)
accessibilitybot: not_applicable — template default: enrol once the repository serves HTML
cipherbot: not_applicable — template default: enrol once the repository implements cryptography
echidnabot: not_applicable — template default: enrol once the repository carries proofs and an ECHIDNA engine is configured
panicbot: not_applicable — panic-attack is already graded by the verdict grid's own panic-attack row, from static-analysis-gate.yml evidence; enrolling panicbot would report one scanner twice and give two rows that can disagree
seambot: not_applicable — template default: enrol once a seam register exists at spec/seams/seam-register.json
sustainabot: not_applicable — reserved fleet slot; no adapter exists (gitbot-fleet bots/sustainabot/README.adoc)
Scope: static findings reported by each row's tool at the named commit. The table grades only findings in files this change touches, so the colour answers "does this change introduce anything?", not "what does the whole repository still carry?". Standing findings are counted in each accordion and in report.json; the baseline filter remains the place where acknowledged debt is recorded. The lane state is the worst GATING row; advisory rows are listed and counted but never set it. Purple, red, yellow and blue grade the worst GRADED finding present; orange is evidence missing, malformed or a scanner that did not run; grey is an explicit scope exclusion with its reason. No row is a security certification. report.json, badge.json and the raw findings are in the verdict-grid artifact on the linked run. |
- docs/EXPLAINME.adoc said every proven row is at PWG-2ii. It now points to the grade the pinned reader derives from the receipt, so the ledger cannot drift from it again. - docs/proof-debt.adoc said the trusted base has no postulates. The development has none, but the import cone holds the four Agda.Primitive postulates that Agda supplies, each bound by BUILTIN. The sentence now says so. Docs only; no leg input changes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0136P7ZpWWL8fx57pcYvnHSZ
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
The receipt job of run 43455458225 (commit 7dfeab2, the scanner and generator hardening of this PR) printed one ledger row for each witness: Agda 2.6.4.3, Coq 8.18.0 and Lean 4.24.0. Those rows are now the current receipts. The rows of run 43448301280 (88a763a) and the local runs (eaa7e97) stay as superseded lineage, each with its reason. The pinned reader (standards be39f90) accepts the receipt and derives PWG-1, foundation-diverse false, for N-1, N-2, N-3, N-7, N-8 and N-9. The negative control (a recorded PWG-2ii) is refused. This commit changes no leg input, so --check holds the receipt current. The docs name the new run and commit. The grade still rests on the RECONCILED statement comparisons, which stay provisional until the owner reviews them. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0136P7ZpWWL8fx57pcYvnHSZ
|
…(PROOF-POLICY 8.5.1 to 8.5.3) (#41) ## Summary This is the one follow-up to #40, as the owner requested: fix the receipt-schema gap, and record the echoes. #40 was squash-merged as `292d566`, so the receipts of run 43455458225 name `7dfeab2`, which main does not contain. Standards #1534 (merged as `d9b03a3`) adds three things to the receipt format: `:inputs-sha256`, `(axioms …)` and `(echo …)`. It also gives the home gate the git checks of §8.5.3. This PR makes this repository's generator write the new fields, and makes its gate run those checks. **This PR does not need a new CI run, and no recording step follows it.** It changes no leg input: - The current receipts stay those of run 43455458225. - The receipt names `:source-commit 292d566`, which is already on main. - The echo carries the grade across the squash. Any merge method keeps the receipt valid. ## Result: what the pinned reader derives The reader is `readProofReceipt`, pinned at standards `d9b03a30e9570e1ffc05f16a580ab0f7a7e6fec6`. The sha256 of `deed_lint.js` is `c06de71c26dca57e81c17dbe4998ec99dd73035e773f7b6f92b819e96559853a`. ``` PASS: git facts (source-commit 292d566 on main; each current inputs digest matches the reference script at its commit; each echo witness equal at source and image) PASS: verification/receipts/agda_praxis.deed matches the tree and the ledgers (source-commit 292d566) PASS: the pinned reader (standards d9b03a30e957) accepts verification/receipts/agda_praxis.deed source-commit 292d566 N-1 PWG-1 foundation-diverse false N-2 PWG-1 foundation-diverse false N-3 PWG-1 foundation-diverse false N-7 PWG-1 foundation-diverse false N-8 PWG-1 foundation-diverse false N-9 PWG-1 foundation-diverse false PASS: negative control (the first claim recorded as :pwg PWG-2ii is refused: its legs support PWG-1) ``` Census: 6 PWG-1, 0 PWG-2ii, 0 PWG-2i, 0 PWG-3, 0 ungraded, of 6 theorems. N-4, N-5 and N-6 are demonstrations with no claim (§8.1). The echo, with digests from the reference script `scripts/proof-inputs-sha256.sh` at standards `d9b03a3` (sha256 `dfc6dde0…08f4`): ``` (echo :source "7dfeab2dc13142fac476ee9c698cf009deb709c9" :image "292d566a81a9bafcd6bdf7f3caab7fc2ebad36bd" :witness inputs-sha256 (inputs :prover agda :sha256 "96b2f0237fcc31a0ab60cc6952edbe4e9c1b3ca5f267d79bf6491f81432b0c9e") (inputs :prover rocq :sha256 "4c96fb9c7d22685ae08d71fc2f200e394e93f07711b2b0619d2a154dbd19bc60") (inputs :prover lean :sha256 "7ed75659e1520a28b949c7b004609485605f1b9e017b810352be4285390a13d6")) ``` Each current receipt carries the same digest as `:inputs-sha256`, and `(axioms)` with no entries: no checker reported an axiom, and every gate fails on one. ## Changes - **`scripts/grade-receipt.sh`** - **Pins:** standards `d9b03a3`, both the reader and the reference digest script, each checked by sha256 (`--fetch-reader`). - **Input sets (§8.5.1):** - Agda: the repository modules of the cone of `SecretTypes.All`. - Rocq: the file that `coqc` compiles. - Lean: the tracked `.lean` files, the lakefile and the toolchain. - **Echo ledger:** it holds `7dfeab2 → 292d566`, and the forge ref `refs/pull/40/head` keeps the source. The witness digests are not typed: `--write` and `--check` compute them at both commits and refuse the echo unless they are equal. - **`--check` runs §8.5.3:** 1. the `:source-commit` is on main; 2. each current `:inputs-sha256` equals the reference digest at its commit; 3. each echo witness is equal at its source and at its image (the source is fetched by its PR ref when needed). It keeps the stricter local rule as well: each current digest must equal the digest of the tree under check. - **Grade derivation:** it follows §8.5.2 (an echo chain whose digests match) and §8.4 (a leg counts only if each reported axiom has disposition `c`). - **`scripts/check-trusted-base.sh`:** the Agda input set, a text scan of imports, must equal the cone that `agda --dependency-graph` reports. It runs on every gate run. - **`.github/workflows/proofs.yml`:** the receipt job checks out with full history, for the §8.5.3 checks. - **Docs:** PROOF-STATUS, README, EXPLAINME, proof-debt, `verification/legs/README` and the CHANGELOG describe the new shape and the echo. The `RECONCILED` statement comparisons are no longer called provisional: the owner reviewed them on 2026-11-13 (ruling relayed by the Mathesis session). ## A note on the recorded digests The current rows of the run ledger now hold the §8.5.1 digests at `7dfeab2`, computed again from git objects. Run 43455458225 printed digests under this repository's earlier input sets, which also covered gate scripts and test fixtures. A digest is a git fact of the commit, not an output of the checker, and `--check` recomputes it with the reference script. Rows that are not current keep the digests their runs printed. The receipt does not state those digests, as §8.5.1 allows. ## Negative controls | Control | Result | |---|---| | The same receipt without the echo | The reader refuses it: the receipts support only `PWG-2ii` | | One echo digest changed | The reader refuses it: two different input digests are stated for one commit | | A current ledger digest changed | The gate fails: the recorded digest is not the reference digest at `7dfeab2` | | The echo image changed to a commit that is not on main | The gate fails: the `:source-commit` is not on main | | A wrong `:pwg` (every `--check`) | The reader refuses it | ## Testing These ran locally, with pinned Agda 2.6.4.3, Coq 8.18.0 and Lean 4.24.0, and they all pass: - `scripts/check.sh` - `scripts/check-trusted-base.sh`, which now includes the cone cross-check (15 modules) - `scripts/check-legs.sh` - `scripts/grade-receipt.sh --check` - `check-adoc-renders.sh` (175 files) - `check-spdx-headers.sh`, `check-lock-sync.sh` and `check-action-pinning.js` ## RSR Quality Checklist ### Required - [x] Tests pass (see Testing) - [x] Code is formatted - [x] Linter is clean - [x] No banned language patterns (bash, POSIX awk, and Bun for the canon reader) - [x] No `unsafe` blocks - [x] No banned functions - [x] SPDX headers present - [x] No secrets ### As Applicable - [x] Documentation updated - [x] CHANGELOG updated --- _Generated by [Claude Code](https://claude.ai/code/session_0136P7ZpWWL8fx57pcYvnHSZ)_ <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Improvements** * Proof receipts now include input digests and reported axioms for Agda, Rocq, and Lean. * Proof-grade checks verify receipt inputs and commit history; the highest grade requires valid receipts from all three systems. * Repository checks now compare Agda’s dependency inputs with the reported input set. * **Documentation** * Proof status and evidence records now reflect the reviewed statement comparison and resolved recheck obligation. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude <[email protected]>



Summary
This follows #39, which merged as
2e37cd4. It carries the valid findings from the CodeRabbit review of #39; each was checked against the code first. The scanner is an input of the Agda leg, so this PR also earns the receipts again from its own CI run.Merge with a merge commit (owner decision, 2026-11-13). The receipt names
7dfeab2, a commit on this branch. A merge commit keeps it in main's history, so Mathesis can pin to the merge.Result: what the pinned reader derives
Receipt
:source-commit7dfeab2dc13142fac476ee9c698cf009deb709c9. The current receipts come from CI run 43455458225 on that exact commit.Census: 6 PWG-1, 0 PWG-2ii, 0 PWG-2i, 0 PWG-3, 0 ungraded, of 6 theorems. N-4, N-5 and N-6 are demonstrations with no claim (§8.1).
Lineage: the receipts of run 43448301280 (
88a763a) and of the local runs (eaa7e97) stay in the receipt as superseded, each with its reason.Caveat: the grade rests on the
RECONCILEDRocq and Lean statement comparisons. They stay provisional until the owner reviews them.Changes
scripts/scan-agda-postulates.awk). It refuses a carriage return and any nested module. Both gaps were latent for the pinned Agda 2.6.4.3, but a prover pin bump is exactly when this gate must catch them. There are new refusal controls,tests/trusted-base/CarriageReturn.txtandNestedModule.txt. A.gitattributesentry keeps the CRLF bytes of the first one.scripts/grade-receipt.sh).waivedorunavailableleg with only its:reason, as the reader requires.--emit-runrefuses rows whose input digest is stale..github/workflows/proofs.yml). Thereceiptjob writes its run's receipt before it checks the committed receipt. The check stays a failing gate.docs/EXPLAINME.adocno longer says PWG-2ii. It points to the grade the reader derives.docs/proof-debt.adocnow names the fourAgda.Primitivepostulates that Agda supplies; they are not axioms of this development.proofs.ymlto KYAML. Rule D280 says to leave workflows alone until the lock-coverage shim is a required context, and CodeRabbit withdrew that finding.Commits
c44f449: the hardening. The Agda receipt of run 43448301280 is marked superseded, because the scanner change makes it stale.bf19270: main merged in, because fix(receipt): proof receipt in the shape of PROOF-POLICY 8.5.1 #39 merged before commit 1 was pushed. Main's tree equalled this branch's base, so the diff against main is unchanged.7dfeab2: the doc corrections from the fix(receipt): proof receipt in the shape of PROOF-POLICY 8.5.1 #39 review. Run 43455458225 checked this commit.ca068e0: that run's rows, recorded as the current receipts, and the docs updated to name them.Testing
Locally, with pinned Agda 2.6.4.3, Coq 8.18.0 and Lean 4.24.0:
--emit-runwith a stale digest fails.In CI, run 43455458225 passed on
7dfeab2, and its receipt job printed the recorded rows.🤖 Generated with Claude Code
https://claude.ai/code/session_0136P7ZpWWL8fx57pcYvnHSZ