Skip to content

Commit 2601673

Browse files
committed
npm bug-hunt run 44
1 parent d3b21cb commit 2601673

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

‎entries/npm/20261016T002320Z.md‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[agent] 2026-10-16: npm bug-hunt run
2+
3+
Run 44. Main `657fce2` (v5.0.1 `latest`), Linux, Node 22.22.0, real npm 7.24.2 / 10.9.4 / 11.21.1 / 12.0.0 / 12.1.0 / 12.2.0. Local Python mock of the public proxy (batch / by-package / view / blob / package / tarball) with patched `esbuild@0.19.12` and `@esbuild/linux-x64@0.19.12` tarballs.
4+
5+
**Filed #1595:** hosted and vendored scans break npm 12 `allowScripts` version pins (`"esbuild@0.19.12": true`, the `npm approve-scripts` default). npm only trusts a registry-shaped `resolved` (`…/-/<leaf>-<ver>.tgz`), so after the rewrite the approved `postinstall` is silently blocked. Under `strict-allow-scripts=true`, every `npm ci` fails. Name-only keys still match. `npm approve-scripts` over a vendored pin writes an absolute, machine-specific `file:` key. Reproduced on npm 12.0.0 / 12.1.0 / 12.2.0, hosted and vendored. npm 11.21.1 / 10.9.4 / 7.24.2 aren't affected.
6+
7+
Re-triage: #1576 (`npm_lock.rs:451` text) and #1554 (`governing_root.rs:493`) are unchanged on `657fce2`. No npm code changed since run 43, so I left no comments.
8+
9+
Cells (all pass unless noted):
10+
- `hasInstallScript` package (esbuild) under hosted and vendored: the postinstall runs on `npm ci` with npm 7.24.2 / 10.9.4 / 11.21.1, the lock keeps `os` / `cpu` / `optional` / `bin`, bin links work, and `vex` / `vendor --check` pass. On npm 12 it fails: #1595.
11+
- A platform-optional dep (`@esbuild/linux-x64`) vendored on Linux, then `npm ci --os=darwin --cpu=arm64`: npm skips it, and `vex` still lists it as a not_affected subcomponent (lock-based, documented).
12+
- A workspace member named `esbuild@0.19.12` (a local fork): hosted skips (`redirect_npm_entry_not_found`, exit 0); vendored refuses `vendor_workspace_member` (exit 1); agent refuses (#626); agent `vex` omits it. All documented in docs/ecosystems.md.
13+
- Mixed state (vendored esbuild + hosted linux-x64): bare `scan` / `get` give `mode_ambiguous` (exit 2); `get --save-only` records vendored state per the contract; `apply` skips the vendored package; `scan --mode agent` warns that it left the hosted wiring live; bare `rollback` unwinds all three stores, and the lock comes back byte-exact.
14+
15+
False positives ruled out: the vendored workspace-member refusal (documented); `vex` attesting a vendored optional dep that this OS skips (lock-based attestation, documented).
16+
17+
Next:
18+
1. #1595 follow-ups: a git / `file:` dep with `allowScripts`, an aliased package (`npm:` keys never match), `deny` (`false`) entries over a pin, and `npm install` (not `ci`).
19+
2. Re-check #1576 / #1554 / #1072 on the next main.
20+
3. #1534 sibling: `scan . tools/x` with a lockless `tools/x`.
21+
4. The npm 12 `allow-git` / `allow-directory` gates against vendored / hosted takeovers.

‎state/npm.md‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[agent] Progress ledger for the scheduled npm bug-hunt routine (label pm:npm).
22

3-
Last updated: 2026-10-15T12Z (run 43), main `e76cb9b` (v5.0.1 `latest`). Run 43 filed **#1576**: vendored npm's lockfileVersion 4 refusal says to remove `patchedDependencies` and re-run `npm install`, but npm 12.1 / 12.2 keep the lock at v4, so the advice loops (`npm install --lockfile-version 3` works). The #1541 LFS fix passes for npm. Open: #1576, #1554, #1072. **Every other issue number marked `fail` in the matrix below is closed** (#356, #403, #433, #434, #464, #554, #588, #659, #665, #687, #688, #711, #725, #732, #753, #798, #812, #828, #852, #879, #899, #1097, #1155, #1196, #1232, #1233, #1266, #1481, #1511, #1534); those marks are historical. Probe branches remain blocked (`git push --delete` refused).
3+
Last updated: 2026-10-16T00Z (run 44), main `657fce2` (v5.0.1 `latest`). Run 44 filed **#1595**: npm 12 `allowScripts` version pins (`pkg@x.y.z`, the `npm approve-scripts` default) stop matching after a hosted or vendored rewrite, so approved install scripts are blocked (or every `npm ci` fails under `strict-allow-scripts`); 12.0.0 / 12.1.0 / 12.2.0. Open: #1595, #1576, #1554, #1072. **Every other issue number marked `fail` in the matrix below is closed** (#356, #403, #433, #434, #464, #554, #588, #659, #665, #687, #688, #711, #725, #732, #753, #798, #812, #828, #852, #879, #899, #1097, #1155, #1196, #1232, #1233, #1266, #1481, #1511, #1534); those marks are historical. Probe branches remain blocked (`git push --delete` refused).
44
## Coverage matrix
55

66
Cells are "pass", "fail #N" or "untested". Every cell uses a real npm install. Hosted cells use a local mock of the patch API with `--patch-server-url` pointed at it. Agent and vendored cells use the same mock or a hand-staged `.socket/`. "Cycle" means scan → fresh `npm ci` → `vex` → `rollback` byte-exact. "Suites" means `e2e_redirect_npm_build` + `e2e_vendor_npm_build` with `SOCKET_PATCH_NPM_E2E_REQUIRED=1`.
@@ -14,13 +14,20 @@ Cells are "pass", "fail #N" or "untested". Every cell uses a real npm install. H
1414
| Linux | 10.9.9 | pass: plain cycle (alias still #356) | fail **#1554** (run 42: as #1534, but the nested project has no lockfile, via `package-lock=false` / `--no-package-lock`; 8.19.4 / 10.9.4 / 12.2.0). fixed #1534 (#1543, run 42: a nested project with a lock or a shrinkwrap gets `nested_project_skipped`, exit 0, and the VEX is written). fixed #1511 (run 41: member `file:` dir copy refuses; scoped and dual-lock variants refuse too). Historical: fail **#1511** (`scan --mode vendored --vex` / `vex` attest beside a member's `file:` directory copy, nested; 10.9.4 / 11.6.2 / 12.2.0). pass: member `file:` tarball / URL copy and `overrides`-forced `file:` tarball refuse (run 40), cycle, `overrides` + `file:` dependent. fail **#1155** (10.9.4 / 8.19.4 / 12.2.0: an npm upgrade or downgrade of a vendored package is drift-kept forever; also when the new version has its own patch) | fixed #1481 (run 40: `file:` tarball / directory / URL member copies refuse; `overrides`-forced `file:` tarball refuses). pass: cycle, `overrides`, shrinkwrapped `file:` tarball dep; `--max-new-patches 0` on fully pinned plain / v1 / alias / nested / dual lock (ALREADY). fixed #1195 (#1211; cap 0 and cap 1 with an unpinned twin pass on `9ab72d4`), pass: #1034 targets (`once` vs `@tootallnate/once`, versionless / encoded purls, alias-installed name), interrupted vendored → hosted takeover (converges; artifact dir orphaned = #1157 wontfix), global npmrc `replace-registry-host`, quoted / commented `.npmrc` values, **#1196** (CRLF `.npmrc` without a final newline) | pass (10.9.4, run 38): `--global-prefix` report-only scan, `scan --mode agent`, `rollback` |
1515
| Linux | 10.8.2 (Node 18) / 10.9.x | fixed #1266 (run 40: linked member alias link patched by `scan --mode agent packages/a`, reverted by `rollback packages/a`). fail **#732** (human `scan --mode agent` / `--sync` after `npm ci`: exit 0, unpatched; `--json` re-applies). pass: Node 18 cycle. fail **#554** (re-checked on `203e092`), **#356** (re-checked on `203e092`; alias-only scan now exits 0). pass: agent vex refuses a reverted nested copy (#516 fixed), bundled copy (both copies patched + vex) | fail **#753** (`hasShrinkwrap` nested copy: `vex` exit 0 not_affected, `vendor --check` passes, npm installs unpatched; 8.19.4 too). pass: CRLF / BOM / tab layout cycle (#324 fixed), `--omit=dev`, agent↔vendored takeovers, rescan after a version bump (#541 fixed), hosted→vendored takeover over a dual lock and an alias. fail **#588** (same-lock unwired copy), **#665** (`npm uninstall` of a vendored dep: rollback exit 1 forever), **#688** (`file:` dir named like the package: refused; the takeover keeps the hosted pin since #963), **#687** (a failed eject rewrites every root file), #798 fixed by #799 (stale twin: `vex` now refuses, 18Z), #725 (`vendor --check` ignores wiring). pass: `peer: true` lock entry. fail **#828** (hosted→vendored takeover over a pin with a bundled copy alongside: restore skipped, ledger records the hosted URL, `.npmrc` kept, revert lands on hosted; 8.19.4 / 12.2.0 too) | fail **#828** (`rollback` / `remove` refuse a pin with a bundled copy alongside, and the remedy loops; 8.19.4 / 12.2.0 too). pass: `peer: true` and `devOptional` lock entries (`--omit=peer/dev/optional`), cycles (plain, alias, nested), `file:` dependency's own dependency (`install-links` true / false), self-referential `file:.` link, rollback → in-place `npm install` / `npm ci` restores upstream, `npm ci --omit=dev` + vex, shrinkwrapped `file:` dep, `JSONStream`, agent↔hosted takeovers, stale tree, lockfile-only, dry-run, rescan no-op, nested project (loud), `registry=` mirror, `.npmrc` variants, `overrides` (incl. `$ref`, nested object), policy (`--package`, `maxNewPatches`, `ignorePackages`, `minSeverity`), CRLF / BOM / tab / no-newline layout cycle. fixed #798 (stale twin), #325 (in-run `--vex` only, reopened), **#588** (`--no-verify` only; default `vex` refuses), **#753** (`hasShrinkwrap` nested copy: `npm ci` unpatched, lockfile-only `vex` attests) | pass: all four, `--global-prefix`, `SOCKET_GLOBAL`, `--mode hosted` refused. fail #464 (report-only hint has no `-g`) |
1616
| Linux | 11.20 / 11.21 / 11.6.2 | pass (v4); linked `.store` scoped transitive (11.21, #359 fixed). fail #403 (v4) | pass (v4). #490 (11.21; closed by #491, not re-checked). fail **#753** (11.6.2: `vex` attests a `hasShrinkwrap` nested copy npm installs unpatched) | pass: scoped, duplicate nested workspace copies, dual-lock drift, `omit-lockfile-registry-resolved`, `overrides`, `install-strategy=linked/nested/shallow`. fail **#753** (11.6.2) | pass: all four (11.6.2, custom prefix) |
17+
| Linux | 12.0.0 / 12.1.0 / 12.2.0 (run 44) | n/a | fail **#1595** (`allowScripts` `pkg@ver` pin blocked after vendoring; strict → `npm ci` exit 1) | fail **#1595** (same, hosted) | untested |
1718
| Linux | 12.1 / 12.2.0 | fail **#1576** (run 43: the v4 refusal's "remove `patchedDependencies` + `npm install`" remedy loops; npm keeps v4; 12.1.0 / 12.2.0). pass (run 43): #1541 LFS `*.tgz` repo (fresh vendor, legacy attrs upgrade, `--renormalize`). fail **#1266** (12.2.0). pass: hosted alias cycle, linked workspace vendored cycle (`a80b89e`). fail #356, **#554** (12.2.0), **#732** (12.2.0). `npm patch` user patch overwritten (documented non-strict fallback; see #711) | fail **#588** (12.2.0), **#665**, **#688** (12.2.0 / Node 24). pass: hosted→vendored takeover + rollback, `--omit=dev`, workspaces, `remove` in a workspace, Node 26, `repair`, BOM+CRLF / tab cycle (12.2.0), `install-strategy=linked`, `overrides`. fail **#711** (lockfileVersion 4 refused with wrong advice), **#659** (takeover over a v4 lock un-hosts, then refuses) | fail **#1511** (vendored `file:` directory member copy, nested, 12.2.0). Fixed #1481. fail **#588** (`--no-verify`, 12.2.0). Fixed: #798 (stale package-lock twin; `vex` refuses since #799). pass: `peer: true` lock entry, `install-strategy=linked`, Node 26, `remove` in a workspace, `allow-remote=all` from env / user config still persisted, BOM+CRLF / tab cycle (12.2.0), workspace + alias cycle, dual-lock, drift, `npm install <pkg>` keeps the pin, path-scoped rollback, remove, `registry=` mirror, CRLF / spaced `.npmrc`, `min-release-age`, `strict-npmrc`, `hasShrinkwrap` nested copy (#753 doesn't apply on npm 12), lockfileVersion 4 + non-overlapping `npm patch`: cycle, `rollback` / `remove` byte-exact, `repair` no-op (12.2.0). fail #433, **#711** (`patchedDependencies` / lockfileVersion 4: exit 0, then EPATCHFAILED or `vex` hash_mismatch; 12.1.0 + 12.2.0) | pass: all four |
1819
| macOS | 10.9.7 | pass: linked `.store` apply/vex/rollback (main, #359 fixed). fail #356, #403 (v4) | pass: cycle + `--omit=dev`, revert (main) | pass: cycle, linked cycle (probe) | pass: all four (custom prefix) |
1920
| macOS | 12.1.0 / 12.2.0 | pass: linked `.store` apply/vex/rollback (main, #359 fixed). fail #356, #403 (v4) | pass: cycle + `--omit=dev`, revert (main) | pass: cycle, linked cycle (probe) | pass: all four (custom prefix) |
2021
| Windows | 10.9.7 | pass: linked `.store` apply/vex/rollback (main). fail #403 (v4) | pass: cycle + `--omit=dev`, revert (main) | pass: cycle, linked cycle (probe) | **fail #434** (default and custom prefix; `--global-prefix` works) |
2122
| Windows | 12.1.0 / 12.2.0 | pass: linked `.store` apply/vex/rollback (main). fail #356, #403 (v4) | pass: cycle + `--omit=dev`, revert (main) | pass: cycle, linked cycle (probe) | **fail #434** |
2223
| Windows 2022 | 10.9.7 / 12.2.0 | pass: linked `.store` apply/vex/rollback (main) | pass: cycle + `--omit=dev`, revert (main) | pass: linked cycle (probe) | **fail #434** |
2324

25+
## Run 44 (2026-10-16T00Z, main `657fce2`)
26+
27+
- Filed #1595. npm 12's `allowScripts` matcher trusts only a registry-shaped `resolved` (`…/-/<leaf>-<ver>.tgz`), so a hosted or vendored rewrite turns a pinned approval (`esbuild@0.19.12`) into "unreviewed". The postinstall is blocked, and `strict-allow-scripts=true` fails `npm ci`. Name-only keys still match. npm 12.0.0 / 12.1.0 / 12.2.0; npm 11.21.1 / 10.9.4 / 7.24.2 run the script.
28+
- pass: `hasInstallScript` + `os` / `cpu` / `optional` / `bin` lock fields kept by hosted and vendored (npm 7 / 10 / 11), `npm ci --os=darwin --cpu=arm64` over a Linux-vendored optional dep, a workspace member named like a patched package (all three modes refuse or skip as documented), mixed vendored + hosted (+ agent) state across `scan` / `get` / `get --save-only` / `apply` / `vex` / `vendor --check` / `rollback` (byte-exact).
29+
- Re-triage: #1576 / #1554 unchanged (no npm code changes since run 43).
30+
2431
## Run 43 (2026-10-15T12Z, main `e76cb9b`)
2532

2633
- Filed #1576. Vendored npm's lockfileVersion 4 refusal advises removing `patchedDependencies` and re-running `npm install`, but npm 12.1.0 / 12.2.0 keep the lock at v4 (after `npm patch rm`, after `npm install`, after a clean reinstall), so vendoring stays refused. `npm install --lockfile-version 3` is the working remedy.
@@ -201,6 +208,7 @@ The same `name@version` gets a new patch UUID with different bytes. Mock: left-p
201208

202209
## Backlog
203210

211+
- **New 2026-10-16T00Z:** #1595 follow-ups (git / `file:` / alias deps with `allowScripts`, `false` deny entries over a pin, `npm install` vs `ci`); re-check #1595 / #1576 / #1554 / #1072 on the next main; npm 12 `allow-git` / `allow-directory` vs takeovers; `scan . tools/x` with a lockless `tools/x`.
204212
- **New 2026-10-15T12Z:** re-check #1576 / #1554 / #1072 on the next main; #1541 follow-ups (a `.gitattributes` inside a vendored dir payload, `.git/info/attributes`, a hosted → vendored takeover in an LFS repo); #1534 siblings (`scan . tools/x` with a lockless `tools/x`).
205213
- **New 2026-10-15T00Z:** re-check #1554 / #1072 on the next main; #1534 siblings (a nested project inside an `ignorePaths`-excluded dir or under a workspace member, `scan . tools/x` with a lockless `tools/x`); hosted `nested_project_skipped` parity; npm 12 `npm patch rm` lock downgrade vs vendored refusal text; #1440 follow-ups.
206214
- **New 2026-10-14T12Z:** re-check #1534 / #1072 on the next main; #1534 siblings (an `ignorePaths`-excluded nested project, a nested project with no lock, a workspace member with a stray own lock under vendored); #1440 follow-ups; npm 12 `npm patch rm` lock downgrade vs vendored refusal text.
@@ -253,6 +261,10 @@ The same `name@version` gets a new patch UUID with different bytes. Mock: left-p
253261

254262
## Known non-bugs
255263

264+
- Mock tip (2026-10-16): the Python mock lives in the run's scratchpad only. Compare purls URL-decoded (`%40` vs `@`), or scoped packages get no patch. The public proxy also POSTs `/patch/telemetry` (a 404 is fine).
265+
- Vendored `scan` refuses (`vendor_workspace_member`, exit 1) a workspace member whose name@version matches a patched package, while hosted only warns (`redirect_npm_entry_not_found`, exit 0). Documented in docs/ecosystems.md (2026-10-16).
266+
- A vendored optional platform dep (`@esbuild/linux-x64`) that `npm ci --os=darwin` skips is still listed as a not_affected subcomponent by `vex` (lock-based attestation, documented) (2026-10-16).
267+
- npm 12 blocks dependency install scripts by default (`allowScripts`); a hosted or vendored package without an approval shows the same warning as the registry copy. Only the approval mismatch is #1595 (2026-10-16).
256268
- Mock tip (2026-10-15): the `tests/prebuilt_common` service fixture publishes bytes per (project root, uuid) per process, so `repair` in a second clone of a vendored project gets `vendor_artifact_redownload_failed` (SHA mismatch). That's a fixture artifact, not a bug.
257269
- A legacy `* -text` uuid `.gitattributes` in an LFS-tracking repo keeps the tarball committed as an LFS pointer until the next vendored run and a `git add --renormalize` (documented in docs/ecosystems.md, #1541) (2026-10-15).
258270
- npm with a member `file:` directory dependency (`install-strategy=nested`, `install-links=false`) installs that directory's own devDependencies into `<dir>/node_modules`, so a root crawl sees them. That's npm's behaviour (2026-10-14).

0 commit comments

Comments
 (0)