Skip to content

Prove stateful apps in the tab: Lean's kernel judges the app's own terms - #230

Merged
afflom merged 1 commit into
mainfrom
claude/project-thread-d27980
Nov 16, 2026
Merged

afflom merged 1 commit into
mainfrom
claude/project-thread-d27980

Conversation

@afflom

@afflom afflom commented Nov 16, 2026

Copy link
Copy Markdown
Member

What

Stateful apps are now checked and proved entirely in the browser tab. This removes the last hosted step (mcp.uor.foundation) from the Build and approve flow.

  • Terms in the tab. prism.js moduleTerms writes the app's own data form as Lean kernel terms:
    • structures become nested Prod;
    • guards become ite over Bool;
    • operators map to Nat/Bool functions;
    • text length maps to ByteArray.size (String.toUTF8 s).
  • Proofs. Each proof applies a lemma proved once in studio/proof (PrismLive.Tables: refused, left, right, outside, full, stale), or is by evaluation (Eq.refl).
  • Kernel. The pinned Lean kernel (wasm, in the worker) judges the terms with check_suffix against the shipped library. The library was re-exported with the new roots, and the binding updated to 2113 declarations. The Forge kernel guest then gives the verdict, as it does for rule apps.
  • In-tab check. The check at the end of a Build turn also runs in the tab. It confirms that the module reads, its first frame draws, every named type resolves, and every theorem can be stated.
  • Deleted.
    • the hosted prover (proveFiles, the MCP client);
    • the shell's copy of the hosted checker (live/v2/check.mjs, library.json).
  • FA-85 retired. FA-85 (reuse of hosted proofs) is removed from the register, features, spec, product and tests. There is no hosted proof left to reuse, and the kernel judges a whole app in about 100 ms. The "proof reuse by exact inputs" threat control now cites FA-86.

Evidence

  • Kernel run in node (live_app_prove.test.mjs) on the pinned glue, kernel and library:
    • All 7 notation fixtures have every theorem accepted, on propext/Quot.sound only.
    • Negative controls: a guard that lets an empty name in is refused, and a Clear that keeps the rows is refused.
  • Local end-to-end:
    • Build "guest list": "App · checked".
    • Reply "approve": "Proved by Lean. Lean's kernel, in this browser, accepted 7 theorems … in 1.1 s".
    • No requests to mcp.uor.foundation or lexlean.
  • Tests: every studio/tools/*.test.mjs passes, except telemetry, which fails only on the untracked local bundle.
  • Browser suites: hosted_source_permission_browser, live_main_integration_browser, read_only_chat_execution_browser and build_source_browser pass.
  • audit-prism: non-Prism code shrinks by about 650 lines net.

Follow-up

FA-83 (hosted source permission) still holds, vacuously: no shell code sends source any more. Retiring that module is a separate change.


Generated by Claude Code

The last hosted step is gone. A stateful app's module is written as Lean
kernel terms in the tab (prism.js moduleTerms): structures become nested
Prod, guards become ite over Bool, and each theorem's proof applies a lemma
studio/proof proved once (PrismLive.Tables: refused, left, right, outside,
full, stale) or is by evaluation. The pinned Lean kernel in the worker
judges them against the shipped library, and the Forge kernel guest gives
the verdict, as for rule apps. The check at the end of a Build turn is in
the tab too: the module reads, its first frame draws, every type resolves
and every theorem can be stated.

The hosted prover (proveFiles, the MCP client) and the copy of the hosted
checker are deleted. FA-85 (reuse of hosted proofs) is retired with them:
there is no hosted proof left to reuse, and the kernel judges a whole app
in about 100 ms. Its threat control now points at FA-86.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3LdusN9UGDiUFDM7bZ
@afflom
afflom merged commit 7755331 into main Nov 16, 2026
8 checks passed
afflom pushed a commit that referenced this pull request Nov 16, 2026
Since #230 a stateful app is read, checked and proved in the tab, so no
shell code transfers source to a hosted service. The permission boundary
that guarded those transfers is deleted with its dialog, its unit and
browser gates, its conformance test and feature suite, the CSS for its
"Active" request pill, and its entries in the register, the Features and
FoundrySpecification modules and product.json. The Versions and preview
feature now says a preview sends no source anywhere.

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
#232)

* Retire hosted source permission (FA-83): nothing sends source any more

Since #230 a stateful app is read, checked and proved in the tab, so no
shell code transfers source to a hosted service. The permission boundary
that guarded those transfers is deleted with its dialog, its unit and
browser gates, its conformance test and feature suite, the CSS for its
"Active" request pill, and its entries in the register, the Features and
FoundrySpecification modules and product.json. The Versions and preview
feature now says a preview sends no source anywhere.

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

* Keep FoundrySpecification canonical after the boundary's removal

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

---------

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.

2 participants