Skip to content

Move the annotation overlay into the kernel, and hold the default package to widget-api - #2517

Merged
max-sixty merged 2 commits into
mainfrom
f87-overlay-into-kernel
Oct 12, 2026
Merged

max-sixty merged 2 commits into
mainfrom
f87-overlay-into-kernel

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Survey item F87. The physical annotation overlay moves from skills/leaf/packages/default/runtime/annotation-overlay/ into the kernel at skills/leaf/assets/runtime/annotation-overlay/ (a git mv; index.js shows as delete+add because its header grew). It keeps its /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 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-overlay alias, .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, and core-independent-of-overlay still keeps other owners from reaching it (checked with a deliberate violating import).
  • dev/leaf_dev/distribution.py no longer deletes a second runtime tree, and build/runtime-bundle.mjs no 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.
  • eslint and the pre-commit depcruise hook drop their packages/*/runtime globs.

With the default package's exemption removed, the check also caught its vendored Sortable importing /runtime/dom-move.js. It now gets the same move from /runtime/widget-api.js, which already exported it (build/vendor.mjs and the committed bundle; check:browser reproduces 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.js for layerLanding, which widget-api stopped exporting in #2475. It now names layerLanding as kernel-only and says a package gets closeLayer and handBack from widget-api.js.

Checks: pre-commit (eslint, depcruise, prettier, ruff), check:browser, test:browser, test:runtime, a real prepare() of the install tree, and focused pytest for distribution, revision delivery, and layer composition.

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 2 commits October 11, 2026 23:36
…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]>
@max-sixty
max-sixty merged commit a4abe90 into main Oct 12, 2026
3 checks passed
@max-sixty
max-sixty deleted the f87-overlay-into-kernel branch October 12, 2026 06:53
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