Skip to content

fix(proof-receipt): port #1626's review fixes onto the shared generator - #1656

Merged
hyperpolymath merged 10 commits into
mainfrom
claude/serene-sagan-un5t4q
Nov 17, 2026
Merged

hyperpolymath merged 10 commits into
mainfrom
claude/serene-sagan-un5t4q

Conversation

@hyperpolymath

Copy link
Copy Markdown
Member

Summary

On 2026-11-17 the owner kept the bash generator from #1620 and closed the JS writer of #1626. The ruling was "Keep #1620, port mine". This PR ports the review fixes from #1626 that apply to scripts/proof-receipt.sh. It was waiting on #1625 (the image rule), which has merged.

The diff against main is two files. The branch also carries #1626's commits, followed by a merge that returns every file #1626 touched to main's version, so a squash merge brings in only the port.

Changes (scripts/proof-receipt.sh)

Fix Before After
Imported files count toward currency (§8.5.1, Imported repositories) Imports were derived only at the receipt's commit. A repin that the home inputs did not see, or a sibling checkout edited since the run, passed --check with exit 0. --check and --write ask receipt_imports again at HEAD and compare the binding with the current row. Each imported clone must hold the pinned files.
--run-row needs --axioms The row recorded "no axioms" for every run. --axioms none or NAME:c|b|debt,…, as the run reported. A leg outside DTT may admit axioms of disposition (c) (§8.4) and now says so.
No HEAD fallback for :source-commit With no current run, --write used HEAD. On a PR that is a commit a squash merge leaves off the default branch, so the receipt failed its git checks once merged. --write refuses unless --commit names a commit on the default branch.
Missing default branch Fell through to the checker as exit 1, reported as "git checks failed". Refused with exit 2, naming the missing ref.
Checker exit 2 ("cannot run") Reported as exit 1, as if the receipt had failed the checks. Kept as exit 2, so CI can tell a broken environment from a refused receipt.

Not ported, with reasons:

Two fixes were already in place: a single-line reported field (control characters are refused), and echo witnesses only for current legs.

Testing

Check Result
scripts/tests/proof-receipt-test.sh 89 passed, 0 failed (77 before). 12 new cases: refusals of a missing or malformed --axioms; --axioms none and Classical:c recorded; a repin the home inputs don't see; an edited imported checkout; --check passing again once restored; --write with no current run, with and without --commit; no default branch (exit 2); a checker that cannot run (exit 2).
The same suite against main's generator (with --axioms none removed from the calls) 81 passed, 8 failed: exactly the new refusal cases. The repin and edited-checkout cases exit 0 on main.
check-proof-receipt-test.sh; proof-inputs-sha256-test.sh 20 passed; 14 passed
deed_lint.js --self-test OK
shellcheck on proof-receipt.sh 14 findings, the same as main; none new

Effect beyond this repository

Every home pins standards by commit and sha256, so nothing changes until a home bumps its pin. When it does:

  • A CI job that calls --run-row must add --axioms none, or the axioms it reported. hyperpolymath/secret-types calls --run-row through its own generator today, so this applies when it moves onto the shared generator, which is the next step the owner chose. hyperpolymath/januskey may call it; I can't see that repository from this session.
  • A home with no current run must pass --commit to --write. proof: §8.5.1 receipt on the standard's shared generator; re-pin secret-types to main; legs in a pinned image lintel#31 already does.
  • A home whose --check runs with a sibling checkout away from its pin now fails. That is the intended fix.

Generated by Claude Code

…r writer and reader

PROOF-POLICY §8.5.1 asks every repository that records grades to keep a proof
receipt, and each home repository has so far carried its own generator
(secret-types' grade-receipt.sh is 622 lines; Lintel's wrote a pre-§8.5.1
shape that the reader refuses).  This adds one writer for the estate.

- scripts/proof-receipt.js (Bun): reads a TOML receipt source that holds only
  the typed facts (claims, run ledger, echoes, trusted base, input-set rules)
  and derives the rest from git: each leg's input set at its receipt's commit
  (the Agda cone through the include directories; glob patterns for other
  provers), the manifests and digests by the reference script, an (import ...)
  for each pinned sibling with its pin checked against the home pin file, the
  echo witnesses at both ends, the :source-commit, and each :pwg.  `check`
  regenerates and refuses any difference, refuses a current receipt whose
  inputs changed since its run, runs scripts/check-proof-receipt.sh, and a
  negative control on the reader.  `row` and `--runs` let CI record its own run.
- deed_lint.js: the §8.2-§8.4 derivation moves, unchanged, out of
  readProofReceipt into the exported deriveProofGrade, which the writer calls.
  A writer and the reader cannot disagree.  331 reader tests pass unchanged.
- scripts/tests/proof-receipt-test.sh: 27 cases on a scratch home repository
  with a pinned sibling and a squash merge carried by an echo.  Two mutations
  of the writer (no comment stripping; no pin check) each fail the suite.
- 3-practice/PROOF-RECEIPT-SOURCE.adoc documents the source; PROOF-POLICY
  §8.5.1 points to the writer.  self-test.yml runs both receipt suites by name.

Acceptance: from a TOML transcription of secret-types' ledger the writer
reproduces secret-types' main receipt (9fb8430) byte for byte, and `check`
passes there; it also writes Lintel's first §8.5.1 receipt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017yYi5JxzXZs6nz1ZSForfP
…ipt.sh

The owner kept the bash generator of #1620 and closed #1626 (2026-11-17,
"Keep #1620, port mine"). This merge brings main in and returns every file
#1626 touched to main's version, so the branch's tree equals main and the
next commit holds only the port of #1626's review fixes onto
scripts/proof-receipt.sh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017yYi5JxzXZs6nz1ZSForfP
The owner kept the bash generator of #1620 and asked for the review fixes of
the closed JS writer (#1626) to be ported onto it.  Five apply:

- Currency covers imports (§8.5.1, Imported repositories).  --check and
  --write now ask receipt_imports again at HEAD and compare the binding with
  the current row, and require each imported clone to hold the pinned files.
  Before, a repin that the home inputs did not see, or a sibling checkout
  edited since the run, passed with exit 0.
- --run-row needs --axioms (none, or NAME:c|b|debt,...).  The row no longer
  asserts "no axioms" on a run's behalf; a leg outside DTT may admit (c)
  axioms (§8.4) and must say so.
- No HEAD fallback for the :source-commit.  With no current run, --write
  needs --commit: HEAD on a pull request is a commit a squash merge leaves
  off the default branch, so the receipt would fail its git checks once
  merged.
- A clone with neither origin/<default> nor <default> is refused (exit 2)
  rather than handed to the checker.
- The checker's exit 2 ("cannot run") is kept as exit 2, not reported as a
  failed check, so CI can tell a broken environment from a refused receipt.

Not ported, with reasons: claim-scoped current runs (the bash ledger has no
claim scoping); the literal- and literate-aware Agda import lexer (the cone
is a text scan that a home gate checks against agda --dependency-graph);
the shared deriveProofGrade (the reader already re-derives every grade, with
a negative control, so nothing here would call it).  A single-line reported
field and echo witnesses only for current legs were already in place.

Tests: scripts/tests/proof-receipt-test.sh 89 passed, 0 failed (77 before).
Against main's generator, with --axioms dropped from the calls, exactly the
eight new refusal cases fail and the other 81 pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017yYi5JxzXZs6nz1ZSForfP
Copilot AI balanced review requested due to automatic review settings November 17, 2026 16:49

This comment was marked as low quality.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

DEED–K9 green

🟢 conformant · commit 2c209cf65d24 · run 44190800323

Category Status Pass Fail Indeterminate N/A This PR vs its base
DEED syntax 🟢 conformant 4 0 0 0 ↔ unchanged
K9 contract typecheck 🟢 conformant 1 0 0 0 — checker only; same toolchain as base
K9 validator self-test 🟢 conformant 50 0 0 0 — checker only; same toolchain as base
K9 positive/negative controls 🟢 conformant 29 0 0 0 — checker only; same toolchain as base
K9 live corpus (L0–L2) 🟢 conformant 15 0 0 0 ↔ unchanged

Scope: DEED syntax and K9 contracts L0–L2. L3 signature verification and routed coordination files are checked by the coordination validator only. Green is limited to this scope. Orange is missing evidence; grey is an explicit scope exclusion. Logs and report.json are in the dated conformance-evidence artifact on the linked run.

Base: 58797d4 (merge base), graded by this revision's checker. Checker-only categories do not depend on the tree.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Fork governance

Lane Status Run
DEED syntax (repo deed) 🟢 conformant run 44190800667
K9-DEED conformance (L0–L2; L3 not verified) 🟢 conformant (job: success) same run
Hypatia verdict grid 🟢 no graded findings (job: success) · advisory in grid scope: 🟡 yellow (0 critical, 0 high, not grading) same run

Scope: the three lanes below are static checks at the named commit. A
green row means every applicable check in its declared scope passed;
orange means evidence is missing, not that nothing was found. The
Hypatia verdict covers GATING rows only; advisory reporters are listed
in its grid and their severity counts are limited to the grid scope.
A blocking gate may inspect findings outside the delta grid’s grade; open
the linked run and check annotations for the failing step and, where
applicable, the finding. No row is a security certification.

K9-DEED conformance

k9-deed L0–L2 green

🟢 conformant · commit 2c209cf65d24 · run 44190800667 · validator metadatastician/standards@2c209cf65d24

Category Status Pass Fail Indeterminate N/A This PR vs its base
K9 contract typecheck 🟢 conformant 1 0 0 0 — checker only; same toolchain as base
K9 validator self-test 🟢 conformant 50 0 0 0 — checker only; same toolchain as base
K9 live corpus (L0–L2) 🟢 conformant 13 0 0 2 ↔ unchanged
coordination.k9 (v1.2 ABNF) 🟢 conformant 2 0 0 0 ↔ unchanged
K9 live corpus (L0–L2): 2 finding(s) / scope notes
  • 2-protocols/k9-coordination/examples/minimal.k9 — not_applicable: Routed to the coordination.k9 validator; graded in the coordination.k9 category, not as a K9 contract.
  • coordination.k9 — not_applicable: Routed to the coordination.k9 validator; graded in the coordination.k9 category, not as a K9 contract.

Scope: K9 components L0–L2 against contract v1.0.0 at the named standards commit. L3 signature verification is not certified. coordination.k9 files are graded in their own category against the v1.2 ABNF grammar and its schema rule. Green is limited to this scope. Orange is missing evidence; yellow is grandfathered debt or warnings; grey is an explicit scope exclusion. report.json, badge.json and the validator logs are in the k9-grid artifact on the linked run.

Base: 58797d4 (the PR's merge base, or the commit a push replaced), graded by this revision's checker.

Hypatia verdict grid

Hypatia grid green

🟢 clean · commit 2c209cf65d24 · run 44190800667 · scope: this change (2 file(s)) · excludes 9-archive/

Advisory: 12 row(s), worst 🟡 medium (0 critical, 0 high in grid scope) — reported, never grading the change.

Unique graded findings across gating and advisory rows: 3 (3 reporter observations; 3 without sufficient identity to corroborate). Row counts remain per reporter; unique totals do not change gating.
Raw Hypatia alert-derived observations: 0 (code-scanning, Dependabot and secret-scanning; some may also be in SARIF; not an extra total).

Reporter Gate Status Critical High Medium Minor Since previous revision
Hypatia scan gating 🟢 clean 0 0 0 0 — no comparable baseline (scope changed)
panic-attack assail advisory 🟡 medium 0 0 1 0 — no comparable baseline (scope changed)
pons asinorum advisory 🟢 clean 0 0 0 0 — no comparable baseline (scope changed)
echidnabot advisory ⚪ not applicable 0 0 0 0 — no comparable baseline (scope changed)
rhodibot (RSR compliance) advisory 🟢 clean 0 0 0 0 — no comparable baseline (scope changed)
panicbot (panic-attack, shadow of the direct panic-attack row) advisory 🔵 minor 0 0 0 1 — no comparable baseline (scope changed)
sustainabot advisory ⚪ not applicable 0 0 0 0 — no comparable baseline (scope changed)
glambot (presentation quality) advisory 🟢 clean 0 0 0 0 — no comparable baseline (scope changed)
seambot advisory ⚪ not applicable 0 0 0 0 — no comparable baseline (scope changed)
finishingbot (release readiness) advisory 🟡 medium 0 0 1 0 — no comparable baseline (scope changed)
cipherbot advisory ⚪ not applicable 0 0 0 0 — no comparable baseline (scope changed)
accessibilitybot (WCAG on the served HTML under 2-protocols/axel/public) advisory 🟢 clean 0 0 0 0 — no comparable baseline (scope changed)
ponsbot (pons asinorum, shadow of the direct pons row) advisory 🟢 clean 0 0 0 0 — no comparable baseline (scope changed)
panic-attack assail: 83 finding(s)
  • medium CommandInjection — scripts/proof-receipt.sh — 99 potentially unquoted variable expansions in scripts/proof-receipt.sh
  • 52 further finding(s) in files this change does not touch: reported, not graded (0 critical, 5 high).
  • 30 finding(s) under a declared out-of-scope prefix: reported, never graded.
pons asinorum: 16 finding(s)
  • 16 further finding(s) in files this change does not touch: reported, not graded (0 critical, 0 high).
echidnabot: not_applicable — 2-protocols/k9-coordination/tools/validate/proofs/GrammarExtension.idr is typechecked by the idris2-standards job of echidna-verify.yml; 2-protocols/overlay/src/abi/OverlayProtocol.idr is unchecked in CI under the overlay KEEP-SPEC-DEFER-IMPL decision (3-practice/PROOF-NEEDS.adoc); no ECHIDNA engine is configured for this repository
  • ⚪ not applicable: 2-protocols/k9-coordination/tools/validate/proofs/GrammarExtension.idr is typechecked by the idris2-standards job of echidna-verify.yml; 2-protocols/overlay/src/abi/OverlayProtocol.idr is unchecked in CI under the overlay KEEP-SPEC-DEFER-IMPL decision (3-practice/PROOF-NEEDS.adoc); no ECHIDNA engine is configured for this repository
rhodibot (RSR compliance): 9 finding(s)
  • 9 further finding(s) in files this change does not touch: reported, not graded (0 critical, 2 high).
panicbot (panic-attack, shadow of the direct panic-attack row): 83 finding(s)
  • info PA009 — scripts/proof-receipt.sh — 99 potentially unquoted variable expansions in scripts/proof-receipt.sh
  • 52 further finding(s) in files this change does not touch: reported, not graded (0 critical, 0 high).
  • 30 finding(s) under a declared out-of-scope prefix: reported, never graded.
sustainabot: not_applicable — reserved fleet slot; no adapter exists (gitbot-fleet bots/sustainabot/README.adoc)
  • ⚪ not applicable: reserved fleet slot; no adapter exists (gitbot-fleet bots/sustainabot/README.adoc)
glambot (presentation quality): 663 finding(s)
  • 416 further finding(s) in files this change does not touch: reported, not graded (0 critical, 0 high).
  • 247 finding(s) under a declared out-of-scope prefix: reported, never graded.
seambot: not_applicable — no seam register is declared (spec/seams/seam-register.json)
  • ⚪ not applicable: no seam register is declared (spec/seams/seam-register.json)
finishingbot (release readiness): 507 finding(s)
  • medium TEST-001 — No supported Rust, Deno, or Agda source layout was identified.
  • 417 further finding(s) in files this change does not touch: reported, not graded (0 critical, 3 high).
  • 89 finding(s) under a declared out-of-scope prefix: reported, never graded.
cipherbot: not_applicable — this repository implements no cryptography; checksums in scripts are integrity pins, not a crypto surface
  • ⚪ not applicable: this repository implements no cryptography; checksums in scripts are integrity pins, not a crypto surface
accessibilitybot (WCAG on the served HTML under 2-protocols/axel/public): 33 finding(s)
  • 4 further finding(s) in files this change does not touch: reported, not graded (0 critical, 1 high).
  • 29 finding(s) under a declared out-of-scope prefix: reported, never graded.
ponsbot (pons asinorum, shadow of the direct pons row): 16 finding(s)
  • 16 further finding(s) in files this change does not touch: reported, not graded (0 critical, 0 high).

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.

External reviewer coverage (advisory snapshot)

Head: 2c209cf65d247d8953a1ff76e8b1240bd8a0f3ef. This is coverage, not a fourth lane or a merge verdict.
Later reviews require a fresh summary run. Silence and quota failures never mean approval.

Reviewer Evidence
Copilot NO REVIEW — quota exhausted on this head
Codex NO REVIEW observed on this head
CodeRabbit NO REVIEW observed on this head

@hyperpolymath
hyperpolymath marked this pull request as ready for review November 17, 2026 17:49
Copilot AI balanced review requested due to automatic review settings November 17, 2026 17:49

This comment was marked as low quality.

@metadatastician metadatastician deleted a comment from coderabbitai Bot Nov 17, 2026
Copilot AI balanced review requested due to automatic review settings November 17, 2026 18:26

This comment was marked as low quality.

Copilot AI balanced review requested due to automatic review settings November 17, 2026 18:28

This comment was marked as low quality.

@metadatastician metadatastician deleted a comment from coderabbitai Bot Nov 17, 2026
Copilot AI balanced review requested due to automatic review settings November 17, 2026 18:30

This comment was marked as low quality.

@metadatastician metadatastician deleted a comment from coderabbitai Bot Nov 17, 2026
Copilot AI balanced review requested due to automatic review settings November 17, 2026 18:37

This comment was marked as low quality.

Copilot AI balanced review requested due to automatic review settings November 17, 2026 22:27

This comment was marked as low quality.

Copilot AI balanced review requested due to automatic review settings November 17, 2026 22:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@metadatastician metadatastician deleted a comment from coderabbitai Bot Nov 17, 2026
@hyperpolymath
hyperpolymath merged commit 4813fa1 into main Nov 17, 2026
88 of 92 checks passed
@hyperpolymath
hyperpolymath deleted the claude/serene-sagan-un5t4q branch November 17, 2026 22:31
hyperpolymath pushed a commit that referenced this pull request Nov 18, 2026
…image

After the merge of main, --run-row needs --axioms (#1656) and a current
run counts toward PWG-1 only when it names a digest-pinned image (#1625).
The scope test's rows at the second commit had neither, so they were
refused and, once accepted, derived PWG-2ii where the test asserts that a
scope moves no grade. The rows now carry both. IMG is reused later in the
file for an echo image, so the run image has its own variable.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013CuBToxr5h9catptGiTsFX
hyperpolymath added a commit that referenced this pull request Nov 18, 2026
…-unreconciled legs; reader: foundation-diverse needs RECONCILED (#1671)

## Summary

1. `scripts/proof-receipt.sh`: new optional hook `receipt_run_scope`
(rows `prover|run|claim ids`), so a superseded run that checked only
some claims is listed under those claims only. Needed by
hyperpolymath/januskey#186.
2. A merge of main into the branch, and a test fix: the scope test's run
rows now pass `--axioms none` and `--image`, which #1656 and #1625 made
necessary.
3. Found by generating hyperpolymath/resource-algebra's receipt with the
shared generator and comparing the reader's output with a hand-written
receipt (28 of 29 claims identical; M-2, a Lean bridge with no Agda
statement, differed):
- Generator: a claim whose token is not `proven` or
`proven-with-postulates` is now written `AGDA-PENDING` with no receipt
(it was `AGDA-VERIFIED` carrying the Agda runs).
- Generator: a recheck leg in state `COQ-CHECKED`, `LEAN-CHECKED` or
`BRIDGE-PENDING` now gets token `proven` (`proven-with-postulates` when
its run reported an axiom), not `open`, per PROOF-POLICY §2.2. It still
counts toward no grade. `COQ-CHECKED` is refused on a non-Rocq leg,
`LEAN-CHECKED` on a non-Lean leg.
- Generator: optional `RECEIPT_BEHOLDING_CHORA` (`#u8"…"` or
`#uuid"…"`), written after `:canonical-name`.
- Reader (`deed_lint.js`, `readProofReceipt`): §8.3 gives the
foundation-diverse tag to a kernel-checked witness whose correspondence
is recorded as in §2.2. The reader now also requires state `RECONCILED`.
- With these, the generator reproduces all 29 claims of
resource-algebra's receipt reader-identically.
4. `1-formats/deed/tools/README.adoc`: one sentence stating the
RECONCILED condition for the tag. PROOF-POLICY §8.3/§8.5 already say
this and needed no change.

Waiting on this: hyperpolymath/januskey#186 and
hyperpolymath/resource-algebra#52. Note the branch head is now `340f546`
(docs commit on top of `f4e8304`), so pins taken at `f4e8304` still hold
the code unchanged.

## Tests (real output)

- `bash scripts/tests/proof-receipt-test.sh`: `131 passed, 0 failed`
- `bash scripts/tests/check-proof-receipt-test.sh`: `20 passed, 0
failed`
- `cd 1-formats/deed/tools && bun test deed_lint.test.js`: `337 pass, 0
fail`

---
_Generated by [Claude
Code](https://claude.ai/code/session_01J4QvDfoDA4uk25z9qQLeWv)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants