Repository navigation
proof: trusted base read by the standard's shared gate, not a lexical scan (§8.4) - #62
hyperpolymath wants to merge 1 commit into
Conversation
… scan (§8.4) scripts/scan-agda-postulates.awk listed the prover's postulates by lexing Agda source, and stopped at the first colon of a declaration. Agda 2.6.4.3 accepts `postulate Level : LevelUniv; Hidden : Level`, so the scan reported Level and passed Hidden. Verified on main (c772168): with Agda.Primitive altered that way (Agda_datadir), check-trusted-base.sh printed PASS and exited 0. check-trusted-base.sh now runs the standard's shared gate, scripts/check-agda-trusted-base.sh with scripts/agda-postulates.js, pinned with the receipt tools. It reads the postulates Agda itself reports for the cone (--html: each name's kind and definition site), refuses any postulate in a module under src/, and requires the prover's list to equal `grade-receipt.sh --trusted-base`, the list the receipt writes. The input-set check (§8.5.1) stays here, on the cone that gate reports. The local awk scanner, its fixtures and their .gitattributes line go; the controls, including the semicolon case and an altered prover, live with the shared gate in the standard. The standard is repinned to 5addf98 (six files), the commit that adds the gate. It is on standards branch claude/agda-trusted-base-scan, not yet on main: repin to its merge commit before this leaves draft. The receipt changes in one header line, the standards commit its reader is pinned at; its claims and grades are unchanged (N-1, N-2, N-3, N-7, N-8, N-9 at PWG-1; grade-receipt.sh --check passes). The proofs job sets up Bun, as the receipt job does, for the reader. The "PASS: trusted base" line the ledger row quotes keeps its prefix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J4QvDiCdcxv9pYqAo4kGLg
|
Review these changes at https://app.gitnotebooks.com/hyperpolymath/secret-types/pull/62 |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks 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: 23 finding(s)
panic-attack assail: 16 finding(s)
pons asinorum: 9 finding(s)
finishingbot (release readiness): 174 finding(s)
glambot (presentation quality): 95 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. |
…t (§8.4) (#1726) ## Summary This adds one shared, tested scan for the prover-supplied postulates of an Agda import cone (PROOF-POLICY §8.4). It replaces each home repository's own lexical scanner, which closes a class of bypasses at the source. ## The hole, confirmed The hole was reported by the CodeRabbit review on metadatastician/lintel#31, at `scan-agda-postulates.awk` line 145. - Agda 2.6.4.3 accepts `postulate Level : LevelUniv; Hidden : Level`, with two postulates on one line separated by a semicolon. - The awk scanner stops at the first colon, so it reports `Level` and never sees `Hidden`. I copied the prover's data directory, edited `Agda.Primitive` that way, and pointed Agda at the copy with `Agda_datadir`. Then: - lintel `main` (`434228b`): `scripts/check-trusted-base.sh` prints PASS on every step and exits 0; - secret-types `main` (`c772168`): same, PASS and exit 0; - a `--safe --without-K --cubical-compatible` module that uses `Hidden` type-checks. ## What this adds - **`scripts/agda-postulates.js`** (Bun or Node, plain JavaScript). It lexes no Agda source; instead it reads the pages `agda --html` writes for the cone. - A postulate is an anchor that Agda marks `Postulate` at its own definition site. - A binding is a `{-# BUILTIN … #-}` pragma whose name links to that site. It is matched by position, not by short name. - It refuses (exit 3) a page it cannot read, a cone module with no page, a page outside the cone, an unknown entity, and two postulates with one name in one module. - **`scripts/check-agda-trusted-base.sh`**, the gate: 1. runs a live semicolon control on the prover in use; 2. type-checks the root under the home gate's flags with `--dependency-graph --html`; 3. sorts each cone module as development (`--include`) or prover-supplied (`lib/prim`); 4. refuses any postulate in a development module; 5. requires the prover's postulates to equal `--expect`. `--cone-out` hands the cone to the home repository's input-set check. - **`proof-receipt.sh --trusted-base`** prints `receipt_trusted_base` unchanged. The gate's `--expect` is then the list the receipt records. - **`scripts/tests/agda-trusted-base-test.sh`** plus fixtures, run in CI by a new job in `proof-receipt-tools.yml`. The job uses the digest-pinned `debian:13-slim` image with `agda-bin=2.6.4.3-1+b2`, the homes' pin. - **PROOF-POLICY §8.4** names the shared implementation and the semicolon case. ## Testing Run with Agda 2.6.4.3 built from Hackage (the Debian mirror was blocked in that container) and Bun 1.4.4. **`agda-trusted-base-test.sh`: 24 passed, 0 failed.** - Reader: - one postulate per line, and several on one line split by semicolons; - `where` blocks, nested modules, `mutual`, `private` and `instance` blocks; - the word `postulate` in a line comment, a block comment, a nested comment, a pragma and a string literal, none of which may be reported; - BUILTIN-bound postulates, an unbound one, and a `primitive`, which must not be reported; - names that HTML escapes (`_<&>_`, `a'b`). - Reader refusals: missing page, extra page, unknown attribute, unknown entity, torn anchor, duplicate name, and a usage error (exit 2). - Gate: - passes on the declared list; - fails on an undeclared postulate, a declared one the cone lacks, a changed binding, a declared unbound line, and a postulate in a development module; - reads the declared list from stdin; - fails on the altered prover. **Mutation check.** Three broken readers each fail the suite: - matching the class exactly, which drops operators: 8 failures; - keeping only the first postulate per module: 14 failures; - binding by short name: 9 failures. **Other checks.** - `proof-receipt-test.sh`: 198 passed, 0 failed, including 3 new `--trusted-base` cases. - actionlint 1.7.12, the build pinned by `scripts/actionlint-1.7.12.sha256`, is clean. - shellcheck 0.9.0 is clean apart from SC2015 on the test's `ok`/`bad` idiom, which this repo's other tests also use. - `check-pipe-grep-q`, `check-workflow-duplicate-keys` and `check-inline-python` pass. **Observed on 2.6.4.3 while building the fixtures.** - Explicit braces after `postulate` (`postulate { A : Set ; B : Set }`) are a parse error. - A form feed after `postulate` makes the next name a bare signature, which is an error. Neither is a route to an unseen postulate on this prover. **Verified in the home repositories' CI.** The shared gate runs and passes on Debian `agda-bin` 2.6.4.3 in both home PRs' proofs jobs (live control PASS, trusted base PASS). **Not verified yet.** - This PR's own CI job has not run. - The tampered-prover control needs Debian's `agda-bin` to honour `Agda_datadir`. If it does not, the test fails loudly ("does not honour Agda_datadir") and does not skip. ## Home repositories (draft PRs, pinned to `5addf98`) - metadatastician/lintel#37 - hyperpolymath/secret-types#62 Each repins to this PR's merge commit before leaving draft. The commit is signed with the session's SSH signing key and committed as noreply@anthropic.com, not with the owner's `id_ed25519_signing`. The owner chose to remake it at repin time. --- _Generated by [Claude Code](https://claude.ai/code)_ --------- Co-authored-by: Claude <noreply@anthropic.com>



Summary
This PR moves secret-types' §8.4 trusted-base gate onto the shared scan added in the standard, and removes the local lexical awk scanner.
Status: draft. It pins standards
5addf98, which sits on the standards branchclaude/agda-trusted-base-scanand is not yet merged. Once that standards PR merges, repin to its merge commit, then take this out of draft. The repin rewrites one receipt header line again.The hole this closes (confirmed). It reproduces on
main(c772168):postulate Level : LevelUniv; Hidden : Level.scan-agda-postulates.awkstops at the first colon, so it reportsLeveland never seesHidden.Agda.Primitiveedited that way (copied data directory,Agda_datadir),scripts/check-trusted-base.shprinted PASS on every step and exited 0.The same hole was reported on metadatastician/lintel#31; lintel moves in metadatastician/lintel#37.
Changes
scripts/check-trusted-base.shnow runs the standard'sscripts/check-agda-trusted-base.sh, which usesscripts/agda-postulates.js.--html), and lexes no Agda source.src/.grade-receipt.sh --trusted-base, the list the receipt writes.scripts/scan-agda-postulates.awk,tests/trusted-base/and their.gitattributesline. Their controls now live with the shared gate.scripts/grade-receipt.shpins six standards files at5addf98. This also takes in the upstream changes toproof-receipt.shanddeed_lint.jssince940a27a.verification/receipts/agda_praxis.deedchanges in one header line only: the standards commit its reader is pinned at. Claims and grades are unchanged (N-1, N-2, N-3, N-7, N-8 and N-9 at PWG-1).proofs.ymlsets up Bun in the proofs job, with the same pinned action and version as the receipt job, and installsunzip. ThePASS: trusted baseline the ledger row quotes keeps its prefix.PROOF-STATUS.adocnow describes the new mechanism.RSR Quality Checklist
Required
just testor equivalent). Partly. See Testing: three test scripts fail here exactly as they do onmain, for reasons this PR does not touch.proofs.yml.unsafeblocks without// SAFETY:comments (none touched)..envfiles included.As Applicable
PROOF-STATUS.adoc.Testing
All runs used Agda 2.6.4.3, built from Hackage because the Debian mirror is blocked in this container, and Bun 1.4.4.
Agda.Primitivealtered (Level : LevelUniv; Hidden : Level)scripts/check-trusted-base.shonmain(awk scanner)scripts/check-trusted-base.shon this branch+Agda.Primitive|Hidden|-These also passed:
grade-receipt.sh --writethen--check: the only change is the one header line, and the grades are identical tomain.scripts/check.sh.tests/aspect_tests.sh,tests/e2e.shandtests/invisible-characters-test.sh.These fail here, and fail identically on
main, so they are unrelated:tests/ffi_strings_test.sh: "Zig is required".tests/proven_suite_test.shandtests/run_proven_suite_test.sh: "runner leaked its temporary benchmark report".Not verified here:
agda-binbuild has not been exercised; this PR's CI run will be the first.Commits are signed with this session's SSH signing key. The owner's
id_ed25519_signingkey was not available in this container.Generated by Claude Code