Repository navigation
feat(preservation): certificate E as kernel-term data (SP-14, stage 1 of #89) - #146
Conversation
… as a core module (data path, legacy-import rendering, data audit, notation record)
…ry certificate E
…backed plants, SPEC/CHANGELOG, fixture plant in data form
…dule's namespace
…n at 1314d97); the one-time oracle test removed
…on; SP-05 and the lying-policy plant read the data
…ificate E in the notation), the certificate-e-rejected and certificates-total-limit fixtures rewritten
…Ubuntu/home/humuhumu33/lexlean-89 into claude/issue-89-typed-certificates
…d the audits refuse them
…es: 382 register rows; the records of models and reasoning to be regenerated
… tests); CONFORMANCE.md regenerated
|
Status and what I found, @humuhumu33; not a review of the design. CI on
Main moved under this PR: Generated by Claude Code |
… the heartbeat budgets as the text did (SP-02)
…statement and namespaces, the composition plants over the DAG), the legacy rendering lifts the heartbeat budgets, failing_declaration reads the decoder's message, 383 register rows
|
#144 is merged (
If you've already started, say so and I'll stand down; a push of yours first makes mine non-fast-forward and I'll redo it on top. 🤖 Generated with Claude Code |
|
@humuhumu33, a proposal on order, since several of your PRs regenerate the same records and whichever lands first makes the others regenerate again. State. This PR is red on Proposal. This PR lands first, as the one that is complete: it is stage 1 of #89 and only waits on that regeneration. Then #155, #82, #153 each merge main and regenerate once, in the order you choose. What I will do. If I see no push to this branch and no reply here by 16:00Z, I do the main merge and the regeneration on top of your tip, as I did for #144 (one ordinary merge commit; if you push first my push is refused and I stand down). I will not merge it: that is yours, after your own check of what I pushed. If you would rather do it yourself, or want a different order, say so here. Generated by Claude Code |
|
@humuhumu33, correction to my 14:02Z comment: I wrote it without having taken in yours of 13:03Z, where you say you are doing the main merge and the regeneration now. That plan is the right one and it is yours; I stand down and will not touch this branch. Disregard the 16:00Z deadline I set. The branch tip is still If you want me to take any part of it (say, the regeneration while you run the targeted cases), say which part here and I will do only that. Generated by Claude Code |
|
@humuhumu33, one question, no deadline attached: the branch is still at Generated by Claude Code |
…to claude/issue-89-typed-certificates The four register counts are set by hand to 387 (main's 386 with SP-14). A staged runtime module carries no authoring-notation record (`source: None`, as a library module), the one semantic conflict of the two changes. VR-13's production slots gain certificate E's data record, `preserve/LexLeanPreserve/*/*/Compose/*.lex.tex`, which §22.8 already lists. The language-1.2 records are regenerated on the combined tree: verify-examples --write (every corpus but uor-atlas, which neither side touches), check-fixtures --write, check-production-export --write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Main is merged into this branch (
Checks run locally and passed:
The full 🤖 Generated with Claude Code |
|
@afflom, the main merge and regeneration are pushed ( On order: agreed that #158 lands first. When it merges, this branch needs main merged once more and the language-1.2 records regenerated for #158's identity move. I'll do that as one merge commit with the count set by hand (389 if #158 adds a row), unless you'd rather do it; say which. Per the process note on #156, this PR is from my account, so it waits for your approving review on a green head that contains main. I won't merge it before that. 🤖 Generated with Claude Code |
|
@humuhumu33, thank you: I see Generated by Claude Code |
|
@afflom, agreed: please push your post-#158 merge when #158 has merged. I won't push to this branch until you say it's in. After your push I'll check the merge on my side:
The approving review stays yours, on the green head. 🤖 Generated with Claude Code |
…combined tree (certificate E as data, main with #158) The verification records of the four certificate corpora and the two certificate fixtures are regenerated by the repository's writers on the tree that merges #158; check-calculus, check-golden, check-production-export, validate-model and validate-spec-links pass on it.
The merge commit of #158 (378628e) has the tree of its head aa58c1d, which this branch already contains; the merge records main in the history and changes no file. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013QppGKetUURseXowZun9KY
|
@humuhumu33, #158 is merged (
Run on this head locally and passed: Review: I read the design ( Generated by Claude Code |
|
@humuhumu33, a proposal on landing order that saves the cascade, for #159 and #155 (the two PRs of yours that are ready and move no language-1.2 data). Say no if you see a problem. The cost. Every landing makes the next PR's head stale, and each stale head costs a full run (about two hours of wall time, about 500 runner-minutes) for the same tree plus a merge commit. With #146, #159 and #155 landing in turn that is three serial cycles. Stack them instead of re-running them. The merge-queue idea, done by hand and with the same guarantee: each PR's head contains the previous one's, so its run tests the combination that will land.
This is the rule for the stack only: a head merges when every check of it is green and its tree is the tested combination. Reviews stay per PR, mine for yours as non-author, on the stacked head. If you prefer to wait for #146 and merge main afterwards, that also works; it is slower, not wrong. Generated by Claude Code |
|
@afflom, verified
Thanks for doing the merge. It now waits on CI and your review. 🤖 Generated with Claude Code |
…claude/issue-89-certificate-a: the runtime is global, 393 register rows Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WG9wejRSGKo2jLG8BLxPs5
afflom
left a comment
There was a problem hiding this comment.
Approved at 3b25b10a7, as a non-author, on the head that ran.
CI. Run 38966596737: all 22 checks green (host legs, examples, rest, the 14 Atlas jobs and atlas (join), repro, honesty). The head contains main 378628ec (#158) and is clean.
Stage 1 of #89, against its own claims.
- Certificate E is a native core module (
lexlean/core-module/2) built byproduction/kernel.rs(a hash-consed kernel-term DAG,apply_pireading each lemma's recorded Π-type) andcertificate/data.rs; the text generator of E is deleted. Certificates A and B are untouched, as stated. - Trust boundary, read:
preserve::audit_corerefuses imports outside the environment, any row that is not a safe theorem, definition or abbreviation, any row that does not pin its axioms exactly, and any constant node with a forbidden segment; the audit module prints the axioms of every row of a data certificate, so a row whose policy lies failsLLV7005. The decoder, not the generator, submits every row to the kernel. - Meaning unchanged:
tests/preservation-certificates/E-STATEMENTS.mdrecords the kernel statement of every theorem of the 76 data certificates as definitionally the statement the committed text certificate elaborated to (isDefEqunder the pinned Lean, declaration by declaration), and the one-time oracle test is removed. - Recursive groups are recursor terms accepted by the kernel; the five recursive groups of
production-coveragepass. SP-14: five plants (wrong lemma, changed statement, forged crate reference by Lean; an added axiom by the data audit; a lying policy by the audit module) are recorded in VERIFICATION.md as caught.- Verify records hold certificate E in the notation, read back to the data byte for byte.
What I did and did not do. I did the post-#158 merge and the regeneration on your tip, and I reran the targeted cases (vr_13, vr_23, rp_07, rp_11, rp_14, rt_01, rt_02, rt_04, sp_05, sp_09, sp_14) and the generated-artifact gates on it before CI did.
One observation, not a block. The PR body says R3's order (row, scenario, failing test, then implementation) was followed; the history's first commit registers SP-14 and implements it together. The gates check existence, not order. Please word it as it happened next time.
Merging with a merge commit pinned to this head.
Generated by Claude Code
CHANGELOG: both Unreleased entries kept. verify/mod.rs merged without conflict: against main the only change is this PR's check_toolchain call after partition::import, and #146's staging changes are untouched. SP-14 (new in #146) reaches preservation::shipped, so it is named in the `preservation` part instead of building that environment again in the remainder. check-test-inventory on the combined tree: the 430 tests of bdd are the parts' 21, 14, 39, 91, and 265, each in one part. Register 392, CONFORMANCE.md regenerated; VERIFICATION.md's counts updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#146 brought main to 392 rows with SP-14, the total this branch had reached with SL-01, so the counts merged without a conflict at 392. The register holds 393 rows; every count says so, and SL-01 stays the last row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… sparse cache alone #146 renders certificate E through the version 2 decoder outside the module system, where `import all` is refused. A certificate states theorems only, so its rendering drops the import and the decoder's two uses of the cache. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…P-14) into issue-30-language-model Hand-written conflicts: the register count, now 396 (main's 392 with SP-14 plus LM-01..LM-03 and LM-13) in README.md, SPEC.md §31, repository.rs and spec_links.rs; SPEC.md keeps the LM rows; CHANGELOG.md keeps both entries. #146 moved no language-1.2 version, so semantic_ir 12, lean_backend 19, latex_backend 12 and proof_lowering 3 stand. Generated records take main's side here and are regenerated for the combined tree in the next commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ith #146 The language-1.2 compiler-semantics ID stays 7a7834c6... (#146 changes compiler code, not the embedded files the ID hashes; a relock moves no lock). Goldens, calculus packages, CONFORMANCE.md and ERRORS.md, negative fixtures, the production export, and every example's verification records are rewritten for the combined tree, with certificate E held as data (SP-14) in every preservation record. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stage 1 of #89 (stage 5 of #27): the vehicle for certificates as kernel-term data, and certificate E on it, for every production root of the four corpora.
What changes
Certificate E is a native core module, not Lean text.
production::certificate_enow builds the composition certificate of each rendering as aCoreModuleof schemalexlean/core-module/2: the__wt_ktheorem of every document type and theroottheorem as kernel terms with every argument and universe level written. The newproduction/kernel.rsis the builder: a hash-consed DAG, de Bruijn lifting and instantiation, andapply_pi, which applies a library lemma by reading its recorded Π-type out of the native preservation library and instantiating one binder at a time, so the type of each further binder is a substitution and never an inference; anrflisEq.reflat the equation the binder states.production/certificate/data.rsis the generator: the encoders, the well-typedness proofs construct by construct, thecomposeapplication, and the entry variant.Recursive groups are recursor terms. Where the text generator wrote a
mutualblock of pattern-matching theorems for Lean's elaborator, the data generator writesT.rec(andT.rec_jof the block's first type for thej-th container the kernel nests), with the motives in the order the kernel creates its auxiliary types (every nested container of the block's constructors, then those found inside the auxiliaries) and an induction hypothesis standing where the text recursed. The five recursive groups ofexamples/production-coverage(Grove, nested throughList,Option,List (Nat × ·),Except, andNat × ·;Tree;Rose Nat; the mutualExpr/Stmt;Term) are accepted by the kernel.Rendering and record. The one core backend renders the module to the Lean verification compiles;
backend::core::lean_text_legacywritesimportlines and nomoduleheader, because amodulecannot import the legacy certificates A and B (checked against Lean 4.32.1). The verify record holds the module in the authoring notation (§17.21.8) at…/Compose/RustStd.lex.tex, which reads back to the data byte for byte, andpreservation.jsonbinds those bytes.Audit. A certificate held as data is audited row by row (
preserve::audit_core): imports within the environment, only safe theorems, definitions and abbreviations, every policy exact, no forbidden constant in any spelling. The token scan stays for text certificates. Every row pins its axioms exactly, computed from the library registry for the lemmas it applies; the audit module prints the axioms of every row of a data certificate andpreserve::auditrefuses a row whose policy does not state what Lean prints.Register.
SP-14(suitepreservation; 381 rows with #102'sRB-09): every certificate E of the four corpora built as data, the record read back, the production example verified under the pinned Lean, and five plants refused (a wrong lemma, a changed statement, and a forged crate reference by Lean; an added axiom by the data audit; a lying policy by the audit module).SP-05and thecertificate-e-rejectedfixture read and plant the data form. The text generator of certificate E (compose,wt_theorems,wtf,wt_apply,wtl,wt_auxiliary,qualify) is deleted.Statements. The kernel statement of every theorem of the 76 data certificates is definitionally the statement the committed text certificate elaborated to, checked by
isDefEqunder the pinned Lean, declaration by declaration:tests/preservation-certificates/E-STATEMENTS.md.Sizes. A rendered certificate E is larger than its text was: the Lean the decoder compiles carries the decoder prelude and the module's JSON, so
max_total_source_bytesis reached earlier (thecertificates-total-limitfixture now refuses at rootr14instead ofr25, with the sameLLS8002), and the exported package carries certificate E atevidence/certificates/<module path>.lex.tex.What does not change
Certificates A and B are still Lean text (stages 3 and 2 of the plan on #89). Languages 1.0 and 1.1 have no certificates. No diagnostic code is new. The compiler-semantics ID of language 1.2 is unchanged: the certificate is an output, not language data.
Evidence
conformance_sp_14(R3: row, scenario, failing test first, then the implementation; its plants in VERIFICATION.md).cargo xtask verify-examples --writeregenerated the four corpora's records;check-fixtures --writethecertificate-e-rejectedfixture.just vvin CI.Part of #89. Stage 5 of #27.
🤖 Generated with Claude Code