Repository navigation
Build the leaf.page container from a prepared installation - #2143
Merged
Merged
Conversation
leaf.page's container ran Leaf from the checkout's source tree, and the site build vendored every page from it too, so a revision a hosted session wrote captured the framework and runtime as separate source modules rather than the compiled kernel consumer installs carry. `leaf-dev site` now prepares an installation (`.tmp/site-install`, with `leaf_website` beside it) and runs every `leaf` command from it; Dockerfile.website, `journey local` and `verify-site wrangler` install the same tree. The website adapter now refuses a page another Leaf's runtime vendored, as every other page server does. The suite and refresh-previews build with the checkout's Leaf, since they serve with the checkout's adapter and the suite's probes import source runtime modules. On alert-review a hosted revision now loads 71 modules (2.2 MB) at startup, down from 256 (3.9 MB); the edge documents are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 9, 2026
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.
leaf.page's container ran Leaf from the checkout's source tree, and the site build vendored every page from it too. A revision a hosted session wrote therefore captured the framework and runtime as separate source modules, which the browser fetched one by one through the Worker from the user's container, while consumer installs carry the compiled kernel.
leaf-dev sitenow prepares an installation first, with the sameleaf_dev.distribution.preparethat builds thepreparedbranch. It writes it to.tmp/site-installwithleaf_websitebeside it and runs everyleafcommand of the build from it.Dockerfile.websiteinstalls that tree instead of copyingskills/leaf, so the container serves pages vendored by the Leaf it runs.leaf-dev journey localserves the site withleaf_websitefrom the same installation, andverify-site wranglerbuilds its container context from it.The Leaf that serves a page has to be the one whose runtime vendored it:
layer.foreign_runtimerefuses any other, andleaf page checkalready did. The website adapter skipped that check, so it now refuses such a page with a 500 that names the mismatch. The suite andrefresh-previewsbuild the site with the checkout's own Leaf, because they serve it with the checkout's adapter and the suite's browser probes import runtime modules a compiled kernel no longer has.site.buildtakes the Leaf to run as an argument for that reason.The edge bundle now compiles a prepared kernel again with the widgets. Its Lit import stays rooted (
/vendor/lit.js), and the revision's import map sends that to the release's own copy.bundle-runtime.test.tsbuilds its production layer from a prepared installation, and its website fixture no longer carries a framework the website never sees.On
alert-review, a revision a hosted session writes now loads 71 modules (2.2 MB) at startup, down from 256 (3.9 MB), counting the static import closure ofleaf.jsand the page's widgets. The edge documents are unchanged: 36 modulepreloads against 37, with the same bytes to within 2 KB. A site build spends about 10 s more on the preparation.publish-sitenow also runs on changes todev/leaf_dev/distribution.pyandbuild/browser/build.mjs, which the site build depends on.