Repository navigation
Read esbuild's pin from package.json - #1022
Conversation
notes/guidance-duplication.md lists the rules Leaf's agent-facing guidance states in more than one place: SKILL.md, references/, package guidance and registries, $events handling and answering, agent-facing Python strings, protocol sidecars and hand-copied docs. It gives every site and a proposed single home for each rule. Seven rules already disagree between copies, and in nearly every case the short copy (a CLI help string, a delivered clause, a docs paragraph) is the one that leaves out a case. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The browser framework build installs esbuild through package.json, and scripts/vendor.py pinned the same release again in its PINS table; the two could drift apart. vendor.py now reads the contributor build's pins once and takes esbuild from there, so every bundle runs the release the browser build does. The --pins report keeps esbuild's row, and a moved esbuild now also names the browser build among the bundles to rerun. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
left a comment
There was a problem hiding this comment.
scripts/AGENTS.md still routes a reader to the wrong place for esbuild's pin. Its vendoring paragraph says "Every version it pins sits in one table there", then carves out one exception by name — "The page payload the browser build bundles (Lit and Signals) is pinned in package.json instead, and vendor.py --pins reads it from there". esbuild now belongs in that second sentence and isn't in it, so the only instruction file root AGENTS.md routes a scripts/ change to still says the pin lives in PINS.
That file is the consumer this change owes an update. AGENTS.md's Stage section: "When a change is simpler under a different contract … change the contract and its consumers in the same change. A sentence in a reference saying that something relies on the current shape is a consumer to update". The running-tend weekly step got exactly that treatment here; scripts/AGENTS.md is the other one. Naming esbuild alongside Lit and Signals in that sentence is the whole fix — happy to push it if you'd rather not re-open the branch.
What I verified
spec('esbuild')→[email protected], andbrowser_pins()→{'@preact/signals-core': '1.14.4', 'lit': '3.3.3'}, both unchanged from main.esbuildis the only key in bothPINSandpackage.json'sdevDependencies, so it was the whole of the duplication.- Every key of
{**PINS, **browser_pins()}has aREBUILDSrow and everyHELD_BYvalue is inPINS, so--pinsstill prints a complete report. tests/test_mcp_app.py(importsPINS) andtests/test_interact_layer.py's instruction-placement cases pass.worker/package.jsonpins esbuild at 0.28.1, butscripts/AGENTS.mdcalls that "the website's esbuild dependency" — a separate project bundling a different artifact — so it isn't a third copy of this pin.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… its lock (#1084) JS versions lived in two manifests. `scripts/vendor.py` kept a `PINS` table and installed each bundle's packages into a throwaway npm directory. The browser framework build pinned Lit, Signals and esbuild in `package.json`, and #1011 and #1022 moved rows across one at a time. `plot`, `pierre` and `mcp-app` also took their transitive dependencies from whatever npm resolved on the day, so their bytes weren't reproducible. Now `package.json` pins every package a bundle's own source imports, and `package-lock.json` settles the rest of each closure. `vendor.py` builds every bundle from the root `node_modules` that `npm ci` installs and reads banner versions from there. `PINS`, the throwaway installs, `HELD_BY`, `REBUILDS` and `--pins` are gone. A package that another package depends on is now held by that dependant's range and the lock, which is what `HELD_BY` used to approximate. **Testing the model.** First I added every existing pin to `package.json`, and all of them resolved in one tree without conflict. Nested copies exist (`marked` 11 under Web Awesome, `acorn` under agentic-mermaid, `entities` 6 under parse5), but none of them reaches a bundle differently than it did before. Rebuilding from the root lock reproduced every tracked file byte for byte. The one exception is the Web Awesome shared chunk's name (`chunk-SH2BVOI3.js` → `chunk-DGEFCNBY.js`): esbuild's chunk hash covers input paths, and the content is identical. That new name is stable across runs. Then I trimmed `package.json` to direct imports only, and the lock kept every resolved version. **What moved:** - CI's `test` job runs `uv run scripts/vendor.py` and fails on any diff, now that a rebuild reproduces exactly. Root `AGENTS.md` says `wt merge` doesn't run this check. - Dependabot now watches the root npm manifest, grouped weekly, with esbuild excluded. Its PR stays red until the bundles are rebuilt, and running-tend's weekly section says how. - `browser-runtime.manifest.json` records the lock hash and contributor dependencies, so it was regenerated. - Deleted `test_the_tooling_instructions_place_every_vendored_bundle`, since the reproducible/unreproducible split it enforced no longer exists. The MCP App banner test reads the lock. - Pierre's license walk resolves each package to the copy esbuild actually read, nested or not. **Verification:** `npm ci`; `npm run check:browser && npm run test:browser` (64 pass); `npm run test:runtime` (91 pass); `uv run scripts/vendor.py` twice with a clean tree; `uv run pytest tests` (1353 passed). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
The browser framework build installs esbuild through
package.json, andscripts/vendor.pypinned the same release again inPINS. Two pins for one tool can drift, and nothing checked they agree.vendor.pynow reads the contributor build's pins once (PACKAGE_PINS, whichbrowser_pinsalso uses) and takes esbuild from there.vendor.py --pinskeeps esbuild's row. A moved esbuild now namesbrowseramong the builds to rerun, and the running-tend weekly step says to bump it inpackage.json.Checked:
spec('esbuild')resolves to[email protected],browser_pins()is unchanged,tests/test_mcp_app.pypasses, pre-commit passes.🤖 Generated with Claude Code