Repository navigation
Prove rule apps in the tab with Lean's kernel, no server - #227
Merged
Merged
Conversation
A rule app's guarantees are now proved in the browser tab. Lean's kernel, compiled to WebAssembly (the kernel from #196), runs in a worker with a library exported from studio/proof resident, and judges one suffix per guarantee. The Forge kernel guest gives the verdict (InTabKernel). Nothing is sent to mcp.uor.foundation for a rule app any more. The theorem is about what the published app runs. Regions.lean now holds RuleJudge's definitions exactly as LexLean writes them in Lean, and proves ruleJudge_sound: if wordsCheck holds on an app's words, ruleOutcome answers no in-bounds request that breaks the guarantee. `is not` conditions in rules are split into below/above boxes, with the first match unchanged. Axioms: propext, Quot.sound. CI checks, each keyed by its inputs: - every copied RuleJudge definition equals `lexlean build` output (SDK) - the shipped library is studio/proof's export, byte for byte - the pinned kernel judges the library whole (the binding) To pay the Prism-only ratchet, the hosted rule-proof wrapper goes, and so do the v2/in-tab-check scripts (their report stays). Non-Prism lines shrink by 683. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3MM6ryyrahRTAs9z3M
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3MM6ryyrahRTAs9z3M
…pps moved in-tab Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3MM6ryyrahRTAs9z3M
…ow proves on Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3MM6ryyrahRTAs9z3M
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3MM6ryyrahRTAs9z3M
afflom
pushed a commit
that referenced
this pull request
Nov 16, 2026
The idea box goes from idea to running app without leaving the browser. The app's data form (lexlean/semantic-module/2) is now read in the tab by semanticData(), held to LexLean 0.4's own output by digest on seven fixtures and to the hosted service's guests reading. The chat turn no longer opens a hosted session, so a Build turn shows no hosted-source dialog and sends nothing to mcp.uor.foundation. The browser suites now assert that no hosted dialog opens and no request reaches the service. Checking and proving a stateful app still uses the hosted elaborator, and only when the person approves the app; rule apps prove in the tab (#227). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3LdusN9UGDiUFDM7bZ
afflom
added a commit
that referenced
this pull request
Nov 16, 2026
…#228) The idea box goes from idea to running app without leaving the browser. The app's data form (lexlean/semantic-module/2) is now read in the tab by semanticData(), held to LexLean 0.4's own output by digest on seven fixtures and to the hosted service's guests reading. The chat turn no longer opens a hosted session, so a Build turn shows no hosted-source dialog and sends nothing to mcp.uor.foundation. The browser suites now assert that no hosted dialog opens and no request reaches the service. Checking and proving a stateful app still uses the hosted elaborator, and only when the person approves the app; rule apps prove in the tab (#227). Claude-Session: https://claude.ai/code/session_013Asa3LdusN9UGDiUFDM7bZ Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Alex · project thread
Step 3 of the publish-without-GitHub plan. When you approve a rule app, Lean now proves its guarantees in the browser tab, and no server takes part. Before this, the rules went to
mcp.uor.foundation.What changes
studio/proof/PrismLive/Regions.leannow holds RuleJudge's definitions (ruleOpHolds,ruleCondsHold,ruleSpan,rulesEnd,ruleOutcome,ruleInBounds,WorkProtocol.word) exactly as LexLean writes them in Lean. It provesruleJudge_sound: ifwordsCheckholds on an app's words, thenruleOutcomenever gives an in-bounds request an answer that breaks the guarantee. It rests onpropextandQuot.soundonly. This closes the gap In-tab kernel: prove an app with no server, work kept by address, Firefox and WebKit #196 left open (its theorem was aboutPrismLive.Kernel.judge, not what the app runs). Rules withis notare split into "below" and "above" boxes, and the first-match answer stays the same (judge_expand). So every ruleruleWordscan publish is covered.studio/shell/prism.jsprove):shell/kernel/lean/.manifest.jsonpins them by SHA-256, and so does the binding that records that this kernel judged this library whole.wordsCheck … = true := Eq.refl true, andruleJudge_soundapplied to it. Lean's kernel judges the suffix.InTabKernel, FA-86) from the addresses the tab derived. The proof record names the kernel, library, statement and bundle addresses.prism.ruleWordsOfnow builds the words for both the proof and the published holo (host.jsruleWordscalls it), so both use the same bytes.proveFileson the hosted verifier. Proving those needs an elaborator, which this PR does not touch.CI (studio.yml), each step keyed by its inputs
lexlean build, line for line, in the locked SDK image. The cache key covers the five modules that build reads, the lexicons,lexlean.lock,prismpm.lockand Regions.lean. Path filters now include those files.lean4exportexport, byte for byte. The pinned wasm kernel then runscheck_wholeon it again, and the result must match the binding. The exporter is cached by its commit and the toolchain.Checks run locally
lake buildin studio/proof: all three theorems depend on[propext, Quot.sound].is notproves.proved.node --test tools/*.test.mjshas the same failures as main (4 tests that already fail there), and no new ones. I updated the tests that readproveRules(they now passkernelReady) and removed the hosted rule-proof reuse tests.xtask audit-prism: non-Prism code drops from 476,891 to 476,208 lines.audit-reusepasses.audit-bootstrapneeds the SDK container; CI runs it.What a reviewer should know
.mjs. It is generated code, not code anyone writes by hand. Rebuilding the wasm in CI (emsdk plus Lean's C++) is not done here: the binding check proves these bytes judge this library, not that they come from Lean's source.LexLeanRuntime.indexandmultiply. Regions.lean states them the way LexLean's runtime states them for lists of numbers (listIndex,*). Lean cannot import the runtime directly, becauselexlean verifydeletes its.olean.serverfiles (upstream request 2 in v2/serverless-prove/UPSTREAM.md). Once LexLean publishes them, the copy becomes an import.checkin the tab with a patched LexLean, which no build reads. Its REPORT.md stays and points at commit d2a1a71.ruleWordspublishes, now includingis not. In-tab kernel: prove an app with no server, work kept by address, Firefox and WebKit #196's fact reuse, image snapshot and zones remain available to extend this.Generated by Claude Code