Skip to content

feat(prism-code): LexLean keeps its verification processes, and apps share their foundation modules - #713

Open
humuhumu33 wants to merge 4 commits into
mainfrom
ilya/compounding-proofs
Open

humuhumu33 wants to merge 4 commits into
mainfrom
ilya/compounding-proofs

Conversation

@humuhumu33

@humuhumu33 humuhumu33 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

The first step toward Prism SDK proofs that compound across builds, kept within the line docs/proposals/fast-verified-builds.md draws: processes and artifacts are reused by content address, and a verdict never is.

The first version of this PR skipped lexlean verify and reused the verified record of an unchanged model. That carried a verdict across runs, which the proposal's non-goals and #69 rule out, so it is reverted here (3689e6d).

What it does

  • LexLean's process store on the cache volume. Every container with the per-image cache volume at /tmp gets LEXLEAN_VERIFY_STORE=/tmp/lexlean-verify-store. That is LexLean's process store, SPEC 22.13 in Production build: parallel certificates, a process store by content identity, certificates named by their root's program lexlean#558:
    • elaborations, replays and audit members are kept under a key over the tool, the Lean executable, the toolchain tree, the normalized arguments, and a Merkle content identity of the module and every import it reaches;
    • a stored process is restored only for the same executable and exit 0, with every file digest-checked;
    • its record is judged as the stage judges its own;
    • what verify publishes is byte-identical with or without the store.
  • No store on a tmpfs. A container with a tmpfs at /tmp gets no store, since it would be written and never read.
  • Inert until the SDK image carries the store. The volume is named by the image digest, so each SDK image starts its own store. A LexLean without the store ignores the variable, so nothing changes until the SDK image carries chore(prism-code): release 0.5.0 #558.
  • An addendum to fast-verified-builds.md covering:
    • where the time goes across 11 measured apps;
    • why the foundation modules did not compound (each app wrote them under its own module_prefix, and a module's name is part of its content identity), and the fix below;
    • the design of reuse across machines (the mesh): what a receiver re-checks (it replays every received .olean in its own kernel), trust, privacy, and refusing poisoned records.

One module prefix for every app (8eabde4)

Each app's module prefix and Lake package used to be Prism<App>. So two apps wrote the same foundation modules under different names, and Lake files that named different packages. SPEC 22.13 keys a process by its module's name and text and by the Lake files around it, so nothing two apps verified would have matched, not even the LexLean runtime.

  • What changes. Every app now has module_prefix = "Prism" and a Lake package of that name. Two apps' lakefile.toml, lake-manifest.json and foundation modules are the same bytes. Each app's own modules keep their own names: Prism.PaymentRequestApproved, Prism.DinnerSeats.
  • Proved in the SDK image (payment app 82.2 s, seats app 67.2 s). Both compiled Prism.Foundation.Bytes and Prism.Foundation.View.Text.V1.Model to the same .olean bytes, as they already did for the runtime.
  • Layout. The rendered models' digests moved: the entry root is now Prism.<App>.dispatch. lexlean fmt --check --all in the image found all three pinned specs canonical, and journey-template.test.mjs records the new digests.
  • Existing projects. The next prove re-renders the Lake files and the model under the new prefix and proves it again, as for any re-rendered model.
  • Planted defect F1/F2. A prefix per app fails shared-foundation.test.mjs.

Measured (the addendum has the tables)

Route First proof Unchanged re-proof One-rule edit
Kernel (rule apps) 74–201 ms 2–4 ms 93–201 ms
SDK image 55–89 s 57–75 s, nothing reused 80 s

Of one 54 s verify, 53% is the LexLean runtime, whose .olean bytes are the same in every app. That is what the store pays once per image and machine. #558 measured a warm run at 12 s against 387 s cold.

Verification

  • host.test.mjs: with the cache volume, the store is named on the volume.
  • Planted defect C1: naming the store on a tmpfs fails the test, and restoring the code passes it.
  • host and cli tests pass (31). journey, journey-template and shared-foundation pass (30). In the full local suite the only failure beyond main's 54 was the layout digests, now re-checked and recorded.
  • Not measured here: the store on a Prism app. That needs LexLean built from chore(prism-code): release 0.5.0 #558, which this machine was not allowed to build.
  • Not run: just vv.

🤖 Generated with Claude Code

humuhumu33 and others added 3 commits November 16, 2026 23:29
…gain

A proof in the SDK image is now two runs. The first locks, formats and checks
the model and has LexLean name it (lexlean build --all prints its build ID).
The second is lexlean verify, which runs only when this machine has no
admitted record of that model.

The record verify publishes is kept in ~/.prism/kappa by content address,
under a derivation key over the SDK image, the build ID and the Lake
workspace. It stands in for verify only when reuseAdmits allows it, the rule
Lean proves for every stored result: the same key, image and build, and files
that re-derive to their labels. Its own attestation must name this build and
say verified. Only a verify that exited 0 is kept. A reused record is put back
where verify publishes one, and the answer says it was reused.

Measured in the SDK image: the payment app 83.1 s, then 6.6 s unchanged and
19.1 s as the same model in a new project; the stateful seats app 70.8 s,
then 6.0 s and 16.3 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he volume

Every container with the per-image cache volume at /tmp gets
LEXLEAN_VERIFY_STORE=/tmp/lexlean-verify-store, LexLean's process store (SPEC
22.13, lexlean#558). It reuses elaborations, replays and audit members by the
content identity of their module and imports, the executable and the
toolchain, judges each stored record as its stage does, and publishes the same
bytes with or without it. A verdict is never reused. A container with a tmpfs
gets no store, since it would be written and never read. A LexLean without the
store ignores the variable.

The fast-verified-builds proposal gets an addendum: what compounds across apps,
measured on 11 apps, why the foundation modules do not yet, and the design of
reuse across machines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@humuhumu33 humuhumu33 changed the title feat(prism-code): a model this machine has verified is not verified again feat(prism-code): LexLean keeps its verification processes on the cache volume Nov 16, 2026
…r foundation modules

An app's module prefix and Lake package were Prism<App>, so two apps wrote
the same foundation modules under different names and Lake files that named
different packages. LexLean's process store (SPEC 22.13) keys a process by its
module's name and text and by the Lake files around it, so nothing two apps
verified would have matched, not even the LexLean runtime.

Every app now has the prefix Prism. Two apps' lakefile.toml, lake-manifest.json
and foundation modules are the same bytes, and each app's own modules keep
their own names (Prism.PaymentRequestApproved, Prism.DinnerSeats). Proved in
the SDK image, the payment and seats apps compiled both foundation modules to
the same .olean bytes. The rendered models' layout was checked again with
lexlean fmt --check --all in the image: all canonical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@humuhumu33 humuhumu33 changed the title feat(prism-code): LexLean keeps its verification processes on the cache volume feat(prism-code): LexLean keeps its verification processes, and apps share their foundation modules Nov 16, 2026

This branch has not been deployed

No deployments
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.

1 participant