Repository navigation
Decide whether a bundle is CSP-safe in one parser, and write every bundle's notices once - #1245
Merged
Merged
Conversation
…ndle's notices once `scripts/browser/shipped.mjs` now owns what a committed third-party bundle must be and carry. `scripts/browser/build.mjs` and `scripts/vendor.py` both pass every output through it: - **CSP check.** The acorn check that `build.mjs` ran on the framework and `lit.js` now runs on every module `vendor.py` writes, including Pierre (1.7MB, previously unchecked because its grammars carry `import(` as data), the Web Awesome chunks, and the published `marked` and `sortable` copies (previously unchecked). The substring check in `vendor.py` is gone. A static import may name any local path; whether its target exists stays with revision capture. The check also catches `(0, eval)(…)` and `globalThis.eval(…)`, which the substring check partly and the old parser never did. Refusals name the file, line, and reason. - **License notices.** One writer replaces three (`vendor.py`'s `package_notices`, Pierre's `build.mjs`, and the framework build's own format). Each bundle's notices list the packages whose code reached an output, read from esbuild's metafile, so the hand-kept package tuples for Agentic Mermaid, Floating UI, and Web Awesome are gone. A package's NOTICE, THIRD_PARTY_NOTICES, and `LICENSES/` files come with it, which is how Agentic Mermaid's extra notices now arrive. Behaviour that moved: - Every vendored bundle now carries a `<bundle>.LICENSES.txt`: codemirror, highlight, jsdiff, marked, plot, sortable, and the MCP App's `page-app` gain one. Plot's lists the d3 modules it bundles. Page vendoring and exports carry about 65KB more notice text (the export embeds non-script resources). - `browser-runtime.LICENSES.txt` takes the shared format, and the framework manifest's `bundledDependencies` drops `lit`, whose re-export modules contribute no bytes (lit-html and lit-element, which do, remain). - Existing notices change only in their title line and ordering; their package sets are unchanged. No bundle's JavaScript bytes changed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
reviewed
Sep 26, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
The CSP gate accepts string timer callbacks: checkModule('setTimeout("document.body.dataset.ready=1", 0)') returns normally. Leaf's export policy omits unsafe-eval, so the browser blocks that callback; the same applies to setInterval. A dependency update could therefore pass vendoring but fail only in an exported page. The CSP specification lists both string timers as compilation sinks.
A timer given a string compiles it, which the export's CSP refuses as it refuses eval. The gate now refuses a literal, template, or concatenated string as a timer's first argument; a function stays allowed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Sep 27, 2026
max-sixty
added a commit
that referenced
this pull request
Sep 27, 2026
The concept survey's drifted duplicates now each have one owner (#1214–#1221, #1223, #1228, #1231, #1235, #1244, #1245, #1247, #1250, #1251, #1254, #1260), so the survey note never lands. What it found and nobody has taken becomes `TODO.md` entries: - **Shared definitions** (new section under Next): re-addressing resource references in one pass instead of `http.py`'s regex scopers and three head composers; `tests/render_harness.py` `told()` beside `pageReadiness`'s `data` and `log` stages (#1250), which answer the same question; Python still naming a thread's identity a root (`thread_roots`, `FrozenThreadReading.roots`) now that the runtime keys threads on the served `id` (#1260). - **Requests**: the existing "Decide whether requests earn their weight" entry now says kept requests need one owner for seat availability, which four runtime modules restate. - **Implementation candidates**: the unresolved-gesture ledger as one state machine, deferred until a change has to touch it, since nothing there has drifted and it is the hottest race path. The survey's small undrifted items and its list of deliberate splits are dropped: none has drifted, and the splits are intended. 🤖 Generated with [Claude Code](https://claude.com/claude-code) > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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.
scripts/browser/shipped.mjsnow owns what a committed third-party bundle must beand carry.
scripts/browser/build.mjsandscripts/vendor.pyboth pass everyoutput through it:
build.mjsran on the framework andlit.jsnow runs on every module
vendor.pywrites, including Pierre (1.7MB, previouslyunchecked because its grammars carry
import(as data), the Web Awesome chunks,and the published
markedandsortablecopies (previously unchecked). Thesubstring check in
vendor.pyis gone. A static import may name any local path;whether its target exists stays with revision capture. The check also catches
(0, eval)(…),globalThis.eval(…), and a string passed tosetTimeoutorsetInterval, which the substring check partly and theold parser never did. Refusals name the file, line, and reason.
vendor.py'spackage_notices,Pierre's
build.mjs, and the framework build's own format). Each bundle's noticeslist the packages whose code reached an output, read from esbuild's metafile, so
the hand-kept package tuples for Agentic Mermaid, Floating UI, and Web Awesome are
gone. A package's NOTICE, THIRD_PARTY_NOTICES, and
LICENSES/files come with it,which is how Agentic Mermaid's extra notices now arrive.
Behaviour that moved:
<bundle>.LICENSES.txt: codemirror,highlight, jsdiff, marked, plot, sortable, and the MCP App's
page-appgain one.Plot's lists the d3 modules it bundles. Page vendoring and exports carry about
65KB more notice text (the export embeds non-script resources).
browser-runtime.LICENSES.txttakes the shared format, and the frameworkmanifest's
bundledDependenciesdropslit, whose re-export modules contributeno bytes (lit-html and lit-element, which do, remain).
are unchanged. No bundle's JavaScript bytes changed.
🤖 Generated with Claude Code