Skip to content

Remove the protocol check's unused overlay branch and the kernel bundler's old-runtime file check - #5419

Merged
leaf-agent merged 2 commits into
mainfrom
nightly/protocol-bundler-dead-branches
Nov 5, 2026
Merged

leaf-agent merged 2 commits into
mainfrom
nightly/protocol-bundler-dead-branches

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

Two pieces of build code handle cases no caller produces any more. This PR removes them. Nothing any current caller sees changes.

  • Protocol check (build/browser/protocol.mjs): diff kept a branch for side.overlay, a mode for schemas that narrow a record declared elsewhere. Compose each page's layer from the Leaf reading it, so only the log and records bump the protocol #4551 removed its last caller (the ...SENT, overlay: kinds[kind].record side), and protocolBreaks now passes only SENT, OLDER_READS and READ, none of which has an overlay. The branch, its doc sentence and nested's fourth parameter are removed. baselineSchemas' doc now also names the widget declaration schema, which it drops along with the served state and the x-state verb.
  • Kernel bundler (build/runtime-bundle.mjs): before compiling runtime/annotation-overlay/check-api.js, kernelOutputs checked that the file exists, so that comparison arms whose runtime predates it would still build. Its only caller, leaf-dev's distribution prepare, compiles this checkout's own payload, which always has the file. AGENTS.md ("Stage") rules out code kept for earlier runtimes. The kernel now compiles its diagnostic entries unconditionally. I also removed the test case that built a kernel from a layer missing the file, since no caller builds one. A site's layer is still bundled from runtimeEntries alone (worker/bundle-runtime.mjs, bundleLayer), as before.

node --test build/runtime-bundle.test.mjs build/browser/protocol.test.mjs passes (7 tests). ESLint and Prettier aren't installed in this sandbox, so I'm leaving the lint check to CI.

…r's old-runtime check

`diff` in build/browser/protocol.mjs still handled `side.overlay`, a mode for
schemas that narrow a record declared elsewhere. Its last caller went with
#4551; SENT, OLDER_READS and READ, the only sides `protocolBreaks` passes,
carry no overlay. The branch, its comment and `nested`'s fourth parameter go,
and `baselineSchemas`' doc now names the widget declaration schema it drops
alongside the served state and the x-state verb.

`kernelOutputs` stat-ed `runtime/annotation-overlay/check-api.js` before
compiling it, for comparison arms whose runtime predates that file. Its one
caller, `leaf-dev`'s distribution `prepare`, compiles this checkout, which
always has it, and AGENTS.md ("Stage") rules out code for earlier runtimes.
The kernel now compiles its diagnostic entries unconditionally, and the test
that built a kernel without the file is removed with it: no caller builds one.

No behavior changes for any current caller.
@leaf-agent
leaf-agent merged commit ce728fe into main Nov 5, 2026
5 checks passed
@leaf-agent
leaf-agent deleted the nightly/protocol-bundler-dead-branches branch November 5, 2026 07:29
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.

1 participant