Repository navigation
Move the annotation overlay into the kernel, and hold the default package to widget-api - #2517
Merged
Merged
Conversation
…kage to widget-api The physical annotation overlay moves from the default package's `runtime/annotation-overlay/` to the kernel's `skills/leaf/assets/runtime/annotation-overlay/`. It is served at the same `/runtime/annotation-overlay/*` URLs, and `leaf.js` still imports it dynamically only for overlay presentation, so a `data-annotations=page` page loads none of it. This reverses #1652's placement. Every overlay module reads private runtime owners (126 imports of 60 kernel modules), which no package may import, so the package boundary held only by exempting the default package, and each tool carried a special case for the directory: - `layer.py` added the default package's runtime to the protected kernel paths and skipped its private-import check; - `.dependency-cruiser.mjs` resolved `/runtime/annotation-overlay` through an alias, a resolver file and a per-name directory fallback; - `distribution.py` deleted a second runtime tree, and `runtime-bundle.mjs` named the overlay as an extra install entry; - eslint and pre-commit globbed `packages/*/runtime` for it alone. All of these are deleted. The overlay's imports become relative, as every other kernel owner's are, and `core-independent-of-overlay` still keeps other owners from reaching it. In a prepared install the overlay is now an ordinary lazily loaded chunk, as it already was on the website. With the exemption gone, the default package's vendored Sortable was the one other module importing a private owner (`/runtime/dom-move.js`); it now takes the same `move` from `/runtime/widget-api.js`. The default package now holds only widgets, their initial drawing, styles, theme, registry and vendored libraries, and every bundled package passes the private-import check. The layer-returns lint message no longer sends packages to `runtime/focus.js` for `layerLanding`, which widget-api stopped exporting in #2475: it names `layerLanding` as the kernel's and `widget-api.js` as where a package gets `closeLayer` and `handBack`. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 12, 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.
Survey item F87. The physical annotation overlay moves from
skills/leaf/packages/default/runtime/annotation-overlay/into the kernel atskills/leaf/assets/runtime/annotation-overlay/(agit mv;index.jsshows as delete+add because its header grew). It keeps its/runtime/annotation-overlay/*URLs, andleaf.jsstill imports it dynamically only for overlay presentation, so adata-annotations=pagepage loads none of it.This reverses #1652's placement. Every overlay module imports private runtime owners (126 imports of 60 kernel modules), which no package may do, so the package boundary held only through exemptions. All of them are deleted:
layer.py: the default package's runtime is no longer a protected kernel path, and the default package is no longer skipped by the private-import check..dependency-cruiser.mjs: the/runtime/annotation-overlayalias,.dependency-cruiser-resolve.mjs, and the per-name directory fallback are gone. The overlay's imports are now relative, like every other kernel owner's, andcore-independent-of-overlaystill keeps other owners from reaching it (checked with a deliberate violating import).dev/leaf_dev/distribution.pyno longer deletes a second runtime tree, andbuild/runtime-bundle.mjsno longer names the overlay as an extra install entry. In a prepared install the overlay is now a lazily loaded chunk, as it already was on the website.packages/*/runtimeglobs.With the default package's exemption removed, the check also caught its vendored Sortable importing
/runtime/dom-move.js. It now gets the samemovefrom/runtime/widget-api.js, which already exported it (build/vendor.mjsand the committed bundle;check:browserreproduces the bytes). The default package now holds only widgets, their initial drawing, styles, theme, registry, and vendored libraries, and every bundled package passes the private-import check.The layer-returns lint message also changes. It sent packages to
runtime/focus.jsforlayerLanding, which widget-api stopped exporting in #2475. It now nameslayerLandingas kernel-only and says a package getscloseLayerandhandBackfromwidget-api.js.Checks: pre-commit (eslint, depcruise, prettier, ruff),
check:browser,test:browser,test:runtime, a realprepare()of the install tree, and focused pytest for distribution, revision delivery, and layer composition.