Skip to content

fix(proofs): fail the proof gate on Admitted, sorry and postulate (WO 1.3) - #57

Merged
hyperpolymath merged 1 commit into
mainfrom
marina/eager-dijkstra-wlmapg
Nov 10, 2026
Merged

hyperpolymath merged 1 commit into
mainfrom
marina/eager-dijkstra-wlmapg

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

Work order 1.3 of docs/proposals/mathesis-re-anchoring.adoc. scripts/check-proofs.sh passed a Rocq file with Admitted and a Lean file with sorry, because it checked only that the file compiled. Now each gated module that compiles is also audited (PROOF-POLICY §8.4, "Axioms travel with the grade"). Each audit fails closed when it cannot show that it ran.

Changes

  • Rocq: Print Assumptions for each declared Theorem, Lemma, Corollary, Proposition, Fact and Remark must print "Closed under the global context".
  • Lean: every theorem the source declares must depend on no axiom (Lean.collectAxioms, the function behind #print axioms). The lemmas Lean generates for an inductive (injEq, inj, sizeOf_spec) have no declaration range, so they are not checked as witnesses.
  • Agda: --safe already refuses postulate. The januskey postulate scan (scripts/scan-postulates.sh, the reference gate that §8.4 names) now runs over the first-party modules of the import cone that agda --dependency-graph reports.
  • Test: tests/proofs/gate_controls_test.sh <prover> plants an Admitted, a sorry and a postulate. Each one fails the new gate. On the old gate, the Rocq and Lean controls pass, so the test detects the gap. A clean module with a decoy in a comment passes. The Agda lane runs it now; the Rocq and Lean lanes come with WO 1.4.
  • ApiTypes.lean: under Lean 4.29.0 (the version in the pinned Guix), simp brought propext into the two ApiResult laws. Both now hold by rfl after cases.

The gate and ApiTypes.lean are template files, so the same fix belongs in rsr-template-repo.

RSR Quality Checklist

Required

  • Test added, and watched to fail on the old gate
  • No banned language added

Testing

Checked locally with Rocq 8.18.0, Lean 4.29.0 and Agda 2.6.3 (with its distribution stdlib):

  • bash scripts/check-proofs.sh agda|coq|lean4: PASS for every gated module.
  • bash tests/proofs/gate_controls_test.sh agda|coq|lean4: both controls behave for each prover.
  • just validate-repo-map: up to date.

Generated by Claude Code

… 1.3)

scripts/check-proofs.sh passed a Rocq file with Admitted and a Lean file
with sorry, because it checked only that the file compiled. Each gated
module that compiles is now audited as well (PROOF-POLICY 8.4, "Axioms
travel with the grade"), and each audit fails closed when it cannot show
that it ran:

- Rocq: Print Assumptions for every Theorem, Lemma, Corollary, Proposition,
  Fact and Remark the file declares must print "Closed under the global
  context".
- Lean: every theorem the source declares must depend on no axiom
  (Lean.collectAxioms, behind #print axioms). The lemmas Lean generates for
  an inductive (injEq, inj, sizeOf_spec) have no declaration range and are
  not witnesses.
- Agda: --safe already refuses postulate. The comment-aware postulate scan
  of hyperpolymath/januskey (989a747, scripts/scan-postulates.sh, the
  reference gate PROOF-POLICY 8.4 names) now runs over the first-party
  modules of the import cone that agda --dependency-graph reports.

tests/proofs/gate_controls_test.sh plants an Admitted, a sorry and a
postulate. Each fails the new gate, and the Rocq and Lean ones pass the old
gate, so the test detects the gap. A clean module passes. The Agda lane runs
the Agda controls; the Rocq and Lean lanes come with WO 1.4.

Checked locally with Rocq 8.18.0 and Lean 4.29.0 (the versions the pinned
Guix gives) and Agda 2.6.3 with its distribution stdlib: all gated modules
pass. Under Lean 4.29.0, simp brought propext into the two ApiResult laws of
ApiTypes.lean, a template file; both now hold by rfl after cases.

The gate and ApiTypes.lean are template files: the same fix belongs in
rsr-template-repo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0136P7ZnDRsCLfZcFcEzvPcM
@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath marked this pull request as ready for review November 10, 2026 18:29
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-10T18:29:22.276232Z
We couldn’t complete this review. Comment @codex review to try again.
770e565 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@hyperpolymath
hyperpolymath merged commit e438060 into main Nov 10, 2026
41 of 42 checks passed
Repository owner deleted a comment from coderabbitai Bot Nov 10, 2026
@coderabbitai

coderabbitai Bot commented Nov 10, 2026

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

hyperpolymath added a commit that referenced this pull request Dec 1, 2026
…ceipt (#133)

## Summary

Re-pin the nine `hyperpolymath/secret-types` claims (N-1 to N-9, lines
1-9 of `docs/atlas/claims/claims.jsonl`) to the re-issued receipt, and
regenerate `docs/atlas/generated/registry.adoc`.

| Field | Old | New |
|---|---|---|
| `source_commit` | `4ed067220f1357b37f7d54c5ae0690ff35b292bd` |
`0bce5bda840cdbdf91e191608b7aafe38a5f9489` |
| `receipt.sha256` |
`4ed7e550e399074cc8a93bd190f193a0fea78de97d54e27889263b9d386ce9cc` |
`ecbddcdcc7b1be46542567d624ab955ba1407a9ae2a4d38cf1183cca7e0cb122` |

`source_commit` is the home-repo commit at which the receipt is fetched
and hashed (ADR 0004; `loadReceiptBytes` in
`scripts/registry/claims-registry.mjs`). `0bce5bd` is secret-types PR
#58, the commit where `verification/receipts/agda_praxis.deed` last
changed. The receipt is byte-identical at current main `c772168d`.

## Why

The secret-types receipt was re-issued (#57, #58). The reader at
standards 940a27af accepts it and derives PWG-1 for N-1, N-2, N-3, N-7,
N-8 and N-9. N-4, N-5 and N-6 are demonstrations with no claim in the
receipt, so they stay `ungraded` by kind.

The registry view shows those six as `PWG-1` where it showed `ungraded`
before (the old receipt recorded PWG-1 but its legs supported PWG-2ii).

## Changes

- `docs/atlas/claims/claims.jsonl`: only `source_commit` and
`receipt.sha256` on lines 1-9; still JCS-canonical.
- `docs/atlas/generated/registry.adoc`: regenerated with `bun
scripts/registry/claims-registry.mjs build` (not hand-edited).
- Lintel rows are deliberately left alone until lintel records its first
main run (its #31 merged at 434228b with the receipt still `ungraded`).
- The `READER` pin in `claims-registry.mjs` is unchanged (standards
84c2d1c1); it derives PWG-1 for the new receipt, so no bump was needed
here. The 940a27af reader was not run by this PR.

## Testing

Run with Bun, `MATHESIS_STANDARDS` = standards checkout at the pinned
reader commit 84c2d1c1 (receipts and git checks fetched over the
network):

```
bun scripts/registry/claims-registry.mjs check
PASS: claims registry derived from 5 pinned source(s); views match (54 claims, 3 bridges, 1 admissions); the theory ledger is current and append-only (6 entries)
bun scripts/registry/theory-ledger.mjs verify
PASS: the theory ledger matches the admissions and the claim pins
bun test tests/registry/   -> 107 pass, 0 fail
bun scripts/atlas/census-atlas.mjs check
PASS: generated atlas matches census
bun test tests/atlas/census-atlas.test.mjs -> 14 pass, 0 fail
bash scripts/check-ijson-jcs.sh --enforce
ijson-jcs: 26 file(s) checked, 26 canonical, 0 not canonical, 0 invalid; 2 JSONC carve-out(s) skipped
```

Not run: the full `just check` (`just` and the pinned Guix shell are
unavailable here), so `catalogue-check`, `applied-check`,
`ultraplan-check`, `adr-check`, `repo-files-test`, `site-check`,
`check-proofs` and `receipt-check` were not run. This change touches
none of their inputs.

## Checklist

- [x] No banned languages; Bun only
- [x] Generated view regenerated, not hand-edited
- [ ] Full `just check` in the pinned Guix (CI)

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

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Documentation**
* Updated nine claim records to reference a different receipt digest and
source commit. Claim identifiers, statements, and statuses remain
unchanged.
* **No user-facing changes**
  * This update does not change product functionality.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

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.

3 participants