Skip to content

Read esbuild's pin from package.json - #1022

Merged
max-sixty merged 7 commits into
mainfrom
esbuild-one-pin
Sep 24, 2026
Merged

max-sixty merged 7 commits into
mainfrom
esbuild-one-pin

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

The browser framework build installs esbuild through package.json, and scripts/vendor.py pinned the same release again in PINS. Two pins for one tool can drift, and nothing checked they agree. vendor.py now reads the contributor build's pins once (PACKAGE_PINS, which browser_pins also uses) and takes esbuild from there.

vendor.py --pins keeps esbuild's row. A moved esbuild now names browser among the builds to rerun, and the running-tend weekly step says to bump it in package.json.

Checked: spec('esbuild') resolves to [email protected], browser_pins() is unchanged, tests/test_mcp_app.py passes, pre-commit passes.

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

🤖 Generated with Claude Code

max-sixty and others added 6 commits September 23, 2026 10:19
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 leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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], and browser_pins() → {'@preact/signals-core': '1.14.4', 'lit': '3.3.3'}, both unchanged from main.
  • esbuild is the only key in both PINS and package.json's devDependencies, so it was the whole of the duplication.
  • Every key of {**PINS, **browser_pins()} has a REBUILDS row and every HELD_BY value is in PINS, so --pins still prints a complete report.
  • tests/test_mcp_app.py (imports PINS) and tests/test_interact_layer.py's instruction-placement cases pass.
  • worker/package.json pins esbuild at 0.28.1, but scripts/AGENTS.md calls that "the website's esbuild dependency" — a separate project bundling a different artifact — so it isn't a third copy of this pin.

@max-sixty
max-sixty merged commit 9b4bd61 into main Sep 24, 2026
5 checks passed
@max-sixty
max-sixty deleted the esbuild-one-pin branch September 24, 2026 03:14
max-sixty added a commit that referenced this pull request Sep 24, 2026
… 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]>
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