From 6958b9b8a466fa16a638955cbaf88fbe861d142e Mon Sep 17 00:00:00 2001 From: HomeLab Agent Date: Thu, 5 Nov 2026 03:04:24 -0500 Subject: [PATCH] chore(deps): unblock the npm audit gate (zod, body-parser; triage nodejs-whisper and vite) `npm audit (high/critical)` went red on main with no commit, as four new advisories published: - zod GHSA-mrhx-c7xc-m3w5: fixed, zod ^4.6.6 (deduped to 4.6.7). - body-parser GHSA-27r3-jxmh-p828: fixed, 2.4.0 in the lockfile (MCP SDK -> express 5). - nodejs-whisper GHSA-2f48-3555-fpx6: exception. Optional, dictation `local` only, and the only path it is given is a server-built mkdtemp audio.wav. The fix is 0.4, a major that adds a native addon. - vite GHSA-587h-7wmj-h5pm: exception. Dev server only, Windows only. The braces exception no longer matches anything and is removed. Also ports paddock#992: the fake claude's sleep() was a busy-wait that pegged a core for the length of every hold, the cause of Paddock's long-standing E2E flake (edspencer/paddock#947). Managers' copy had the same spin. Co-Authored-By: Claude Opus 5.5 --- .changeset/zod-body-parser-audit.md | 5 + docs/security/npm-audit-exceptions.json | 5 +- docs/security/npm-audit.md | 9 +- package-lock.json | 220 +++++++++++------------- packages/server/package.json | 2 +- test/bin/claude | 35 +++- 6 files changed, 142 insertions(+), 134 deletions(-) create mode 100644 .changeset/zod-body-parser-audit.md diff --git a/.changeset/zod-body-parser-audit.md b/.changeset/zod-body-parser-audit.md new file mode 100644 index 0000000..4de0e1a --- /dev/null +++ b/.changeset/zod-body-parser-audit.md @@ -0,0 +1,5 @@ +--- +"@managers/server": patch +--- + +Dependency security updates: `zod` goes to ^4.6.6 (GHSA-mrhx-c7xc-m3w5, memory exhaustion when validating oversized constrained collections; every state write is validated by a strict zod schema) and `body-parser` to 2.4.0 (GHSA-27r3-jxmh-p828, via the MCP SDK's express). diff --git a/docs/security/npm-audit-exceptions.json b/docs/security/npm-audit-exceptions.json index 172afce..5c69193 100644 --- a/docs/security/npm-audit-exceptions.json +++ b/docs/security/npm-audit-exceptions.json @@ -8,10 +8,11 @@ { "id": "GHSA-p68q-wchp-6fh7", "package": "fastify", "reason": "One root not-found handler, no encapsulated ones and no preHandler; auth is a global onRequest hook. Fix needs fastify 5." }, { "id": "GHSA-c96f-x56v-gq3h", "package": "find-my-way", "reason": "HTTP/2 is never enabled. Fix needs fastify 5." }, { "id": "GHSA-83w8-p2f5-377r", "package": "@fastify/static", "reason": "No route guard protects static files; it serves only the public web bundle (wildcard: false). Fix needs fastify 5." }, - { "id": "GHSA-vfj7-8cjw-p6xm", "package": "braces", "reason": "Optional nodejs-whisper -> shelljs -> fast-glob chain (patterns are server-built temp paths), and dev-only @changesets/cli (globs this repo's own files). No fixed braces release." }, + { "id": "GHSA-2f48-3555-fpx6", "package": "nodejs-whisper", "reason": "Optional dependency, used only with dictation set to local (default off). The one path it is given is server-built (mkdtemp dir + audio.wav, already WAV), never user text. Fix is 0.4, a major that adds a native addon." }, { "id": "GHSA-5gmw-xhrv-c9v3", "package": "tinypool", "reason": "Dev-only (vitest 2 worker pool). Needs a polluted prototype inside the test process, which only runs this repo's tests. Fix needs vitest 5." }, { "id": "GHSA-85c8-ppgw-ccpr", "package": "tinypool", "reason": "Dev-only (vitest 2 worker pool), as GHSA-5gmw-xhrv-c9v3. Fix needs vitest 5." }, { "id": "GHSA-5xrq-8626-4rwp", "package": "vitest", "reason": "Dev-only; needs the Vitest UI server (`vitest --ui`), which no script or CI job starts. Fix needs vitest 3.2.6+." }, - { "id": "GHSA-fx2h-pf6j-xcff", "package": "vite", "reason": "Dev-only and Windows-only (vite dev server fs.deny bypass); production serves the built bundle through Fastify. Fix needs vite 6." } + { "id": "GHSA-fx2h-pf6j-xcff", "package": "vite", "reason": "Dev-only and Windows-only (vite dev server fs.deny bypass); production serves the built bundle through Fastify. Fix needs vite 6." }, + { "id": "GHSA-587h-7wmj-h5pm", "package": "vite", "reason": "Dev-only and Windows-only (launch-editor existence check in the vite dev server); production serves the built bundle through Fastify. Fix needs vite 6." } ] } diff --git a/docs/security/npm-audit.md b/docs/security/npm-audit.md index b0c294c..4d7a91c 100644 --- a/docs/security/npm-audit.md +++ b/docs/security/npm-audit.md @@ -13,7 +13,7 @@ to the exceptions file AND a row to the table below, with the reason it cannot be reached. An exception the check reports as unmatched should be removed from both. -Last triaged: 2026-10-17 (task t-260930-a6xx). +Last triaged: 2026-11-05. On 2026-11-05 `zod` went to ^4.6.6 (GHSA-mrhx-c7xc-m3w5, memory exhaustion validating oversized constrained collections — reachable, since every state write goes through a strict zod schema) and `body-parser` to 2.4.0 in the lockfile (GHSA-27r3-jxmh-p828, via the MCP SDK's express); nodejs-whisper and one more vite advisory were triaged below, and the braces exception, which no longer matches anything, was removed. Before that: 2026-10-17 (task t-260930-a6xx). **Audit with dev dependencies included.** `npm audit` omits devDependencies when `NODE_ENV=production` is set (as it is on some dev boxes), which silently @@ -43,7 +43,7 @@ two hardenings marked with a test. | `overrides: dockerode → uuid ^11.1.1` | GHSA-w5hq-g745-h8pq (and with it the dockerode / `@herdctl/core` / `@herdctl/chat` entries, which only carried it). Unreachable anyway: dockerode only calls `uuid.v4()` with no buffer. Root `overrides` apply to this lockfile, not to the published `@edspencer/managers` npm package, whose installs resolve dockerode's own `uuid` ^10. | | `tsx` 4.19.1 → 4.23.15 (dev) | GHSA-67mh-4wv8-2f99 for tsx's own esbuild (vite 5's copy remains, below) | | `vite` 5.4.6 → 5.4.21 (dev) | the vite advisories fixed within 5.4 (`server.fs` bypasses, `launch-editor` injection) | -| `npm audit fix` (lockfile only), dev | `@changesets/*` chain (`@changesets/pre`, `read-yaml-file`, `js-yaml`, `argparse`), which closed every advisory of the `@changesets` packages' own. They stay listed only as dependents of `braces` and `sprintf-js`, below | +| `npm audit fix` (lockfile only), dev | `@changesets/*` chain (`@changesets/pre`, `read-yaml-file`, `js-yaml`, `argparse`), which closed every advisory of the `@changesets` packages' own. They stay listed only as dependents of `sprintf-js`, below | | `npm audit fix` (lockfile only) | `@fastify/busboy`, `@grpc/grpc-js`, `@hono/node-server`, `hono`, `@modelcontextprotocol/sdk`, `brace-expansion`, `dompurify`, `fast-uri` (both lines), `ip-address`, `qs` | ## Still open @@ -64,7 +64,7 @@ left as a follow-up; it would close every fastify row below. | [GHSA-p68q-wchp-6fh7](https://github.com/advisories/GHSA-p68q-wchp-6fh7) | fastify 4.28.1 | high | Accept (fastify 5) | Needs encapsulated `setNotFoundHandler`s with their own `preHandler`. There is one root not-found handler (SPA shell / 404) and auth is a global `onRequest` hook, so no guard can be skipped. | | [GHSA-c96f-x56v-gq3h](https://github.com/advisories/GHSA-c96f-x56v-gq3h) | find-my-way 8.2.2 | high | Accept (fastify 5) | HTTP/2 only; the server never sets `http2`. | | [GHSA-83w8-p2f5-377r](https://github.com/advisories/GHSA-83w8-p2f5-377r) | @fastify/static 7.0.4 | high | Accept (fastify 5) | A bypass of route guards in front of static files. Nothing guards a static route specifically (auth is global), it is registered with `wildcard: false`, and it serves only the compiled web bundle, which holds no secrets (`/assets/` is already auth-exempt). | -| [GHSA-vfj7-8cjw-p6xm](https://github.com/advisories/GHSA-vfj7-8cjw-p6xm) | braces 3.0.3 (via micromatch, fast-glob, shelljs, nodejs-whisper; and dev-only via `@changesets/cli`) | high | Accept (no fix) | No fixed braces release exists. The chain is the OPTIONAL `nodejs-whisper` dependency, used only when dictation is set to `local` (default `off`), and the paths it handles are server-built (`mkdtemp` dir + `audio.wav`), never user text. The dev-only path is `@changesets/cli` globbing this repo's own package files in the release workflow. Also flags micromatch, fast-glob, shelljs and nodejs-whisper themselves, which carry only this advisory. | +| [GHSA-2f48-3555-fpx6](https://github.com/advisories/GHSA-2f48-3555-fpx6) | nodejs-whisper 0.2.9 | critical | Accept (fix is 0.4, a major) | Command injection through a crafted audio file PATH interpolated into a shell `ffmpeg` call. The dependency is OPTIONAL and used only when dictation is set to `local` (default `off`). The only path it is ever given is server-built: `whisper-local.ts` writes `/paddock-whisper-XXXXXX/audio.wav` (an `mkdtemp` dir), never anything from the upload's name, and transcodes to WAV with ffmpeg itself first. 0.4 adds a native addon (`node-addon-api`) and is a separate change. | | [GHSA-w2qp-rph6-63g4](https://github.com/advisories/GHSA-w2qp-rph6-63g4) | fastify 4.28.1 | moderate | Accept (fastify 5) | Needs a root-level primitive body schema on a Fastify route; the only ones are MCP tool input schemas, which Fastify never compiles. | | [GHSA-444r-cwp2-x5xf](https://github.com/advisories/GHSA-444r-cwp2-x5xf) | fastify 4.28.1 | moderate | Accept (fastify 5) | Needs `trustProxy` set; it never is. The `/mcp` guard reads the socket, not `req.protocol` (`routes/mcp.ts`). | | [GHSA-4mh8-r7rc-xpvc](https://github.com/advisories/GHSA-4mh8-r7rc-xpvc) | fastify 4.28.1 | moderate | Accept (fastify 5) | HTTP/2 plus `reply.trailer()`; neither is used. | @@ -77,6 +77,7 @@ left as a follow-up; it would close every fastify row below. | [GHSA-5gmw-xhrv-c9v3](https://github.com/advisories/GHSA-5gmw-xhrv-c9v3) | tinypool 1.1.1 (via vitest) | critical | Accept, dev-only (vitest 5) | A prototype-pollution gadget: needs attacker-controlled data polluting `Object.prototype` inside the test process, which only runs this repo's own tests. No tinypool 1.x fix; vitest 2–4 require 1.x. | | [GHSA-85c8-ppgw-ccpr](https://github.com/advisories/GHSA-85c8-ppgw-ccpr) | tinypool 1.1.1 (via vitest) | critical | Accept, dev-only (vitest 5) | As GHSA-5gmw-xhrv-c9v3. | | [GHSA-fx2h-pf6j-xcff](https://github.com/advisories/GHSA-fx2h-pf6j-xcff) | vite 5.4.21 | high | Accept, dev-only (vite 6) | Windows-only `server.fs.deny` bypass in the vite DEV server. Production serves the built bundle through Fastify; vite never runs there. | +| [GHSA-587h-7wmj-h5pm](https://github.com/advisories/GHSA-587h-7wmj-h5pm) | vite 5.4.21 | high | Accept, dev-only (vite 6) | Windows-only `launch-editor` existence-check bypass in the vite DEV server. Production serves the built bundle through Fastify; vite never runs there. Vite 5's other new advisories (GHSA-r825-w8mm-5pxw, GHSA-698v-4r3x-3vcv, GHSA-9jrq-w75r-8gcw, GHSA-rq7h-c2jc-7f22) are dev-server only too and don't gate CI. | | [GHSA-4w7w-66w2-5vf9](https://github.com/advisories/GHSA-4w7w-66w2-5vf9) | vite 5.4.21 | moderate | Accept, dev-only (vite 6) | Dev-server path traversal in optimized-deps `.map` handling; the dev server binds loopback by default and never runs in production. | | [GHSA-v6wh-96g9-6wx3](https://github.com/advisories/GHSA-v6wh-96g9-6wx3) | vite 5.4.21 | moderate | Accept, dev-only (vite 6) | Windows-only (`launch-editor` UNC paths), dev server only. | | [GHSA-67mh-4wv8-2f99](https://github.com/advisories/GHSA-67mh-4wv8-2f99) | esbuild 0.21.5 (via vite 5) | moderate | Accept, dev-only (vite 6) | esbuild's own serve mode accepting cross-origin requests; vite uses esbuild as a transformer, and the dev server never runs in production. | @@ -85,5 +86,5 @@ left as a follow-up; it would close every fastify row below. npm's "vulnerable packages" count is larger than the number of distinct problems: `@fastify/swagger-ui`, `mermaid`, `react-router-dom`, `micromatch`, -`fast-glob`, `shelljs`, `nodejs-whisper`, `@vitest/coverage-v8`, `@vitejs/plugin-react`, `vite-node`, `@changesets/*`, `@manypkg/get-packages`, `globby`, `argparse`, `js-yaml` and `read-yaml-file` are listed only because they depend +`fast-glob`, `shelljs`, `@vitest/coverage-v8`, `@vitejs/plugin-react`, `vite-node`, `@changesets/*`, `@manypkg/get-packages`, `globby`, `argparse`, `js-yaml` and `read-yaml-file` are listed only because they depend on a package above. diff --git a/package-lock.json b/package-lock.json index e16defe..ad752fe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -559,9 +559,9 @@ } }, "node_modules/@changesets/apply-release-plan/node_modules/semver": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", "dev": true, "license": "ISC", "bin": { @@ -587,9 +587,9 @@ } }, "node_modules/@changesets/assemble-release-plan/node_modules/semver": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", "dev": true, "license": "ISC", "bin": { @@ -680,9 +680,9 @@ } }, "node_modules/@changesets/cli/node_modules/semver": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", "dev": true, "license": "ISC", "bin": { @@ -733,9 +733,9 @@ } }, "node_modules/@changesets/get-dependents-graph/node_modules/semver": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", "dev": true, "license": "ISC", "bin": { @@ -1457,9 +1457,9 @@ } }, "node_modules/@fastify/ajv-compiler/node_modules/fast-uri": { - "version": "2.4.7", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-2.4.7.tgz", - "integrity": "sha512-b8mggfg2R+m2OAb3Z+2HcJxUgU+2cY1JQondBDyXLdrEKNPxd96MvnB5yWKZdupsuX6GdBaAZHZo9msHX/Bb7A==", + "version": "2.4.8", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-2.4.8.tgz", + "integrity": "sha512-knw8ym69bDOF980l2z0tDKh7XB9zfsUmpMmoQUx9KskazmddvnhNntiTzen4VsiW7qVWiVZkrcd5Pj2bziC3gA==", "license": "MIT" }, "node_modules/@fastify/busboy": { @@ -1485,9 +1485,9 @@ "license": "MIT" }, "node_modules/@fastify/error": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@fastify/error/-/error-4.2.0.tgz", - "integrity": "sha512-RSo3sVDXfHskiBZKBPRgnQTtIqpi/7zhJOEmAxCiBcM7d0uwdGdxLlsCaLzGs8v8NnxIRlfG0N51p5yFaOentQ==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@fastify/error/-/error-4.2.1.tgz", + "integrity": "sha512-MYBumuIwP+5MIpXSyKm6/o1Eigcoij186lWUssX3LH5U8KWqU0ktZhzC4CErIX9EJeQeRGI+zJZQWakBlFbUcg==", "funding": [ { "type": "github", @@ -1805,9 +1805,9 @@ } }, "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", - "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.5.0.tgz", + "integrity": "sha512-zhvbbbdt1kbw7EJ9OQoxmQcuaNR9P5kTj7e/YdmOSU10aHWbycofJxA6jKfoEy3vlLdctOF9ZHaxLtmSm998wQ==", "license": "MIT", "engines": { "node": ">=12" @@ -3325,12 +3325,12 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "26.0.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-26.0.0.tgz", - "integrity": "sha512-vf2YFi1iY9lHGwNJMs01biZFbKJkrZR1T6/MlzjhJLPdntOHLhTrDSnSVcdtvjihi4VQNlrFRIxLsDBlQpAipA==", + "version": "26.6.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.6.tgz", + "integrity": "sha512-MzQj+8Kx3XI40OmUAE6Qoh58ZMNstNNMwn2nfd3qWsfe7nDNSqJNzes4njhz6AHwrSHOffSLwXU6yb474Q4aog==", "license": "MIT", "dependencies": { - "undici-types": "~8.3.0" + "undici-types": "~8.9.0" } }, "node_modules/@types/prop-types": { @@ -3860,18 +3860,18 @@ } }, "node_modules/body-parser": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.3.0.tgz", - "integrity": "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.4.0.tgz", + "integrity": "sha512-Ifk1KcLrxaGt1occQagQNFNNOqRt1LFuehEnHHzB8Z6cRgIxRU1TBaiIsUiCdA+gy5PL7Y1IX31DNKkRmxtXjQ==", "license": "MIT", "dependencies": { "bytes": "^3.1.2", - "content-type": "^2.0.0", + "content-type": "^2.1.0", "debug": "^4.4.3", "http-errors": "^2.0.1", - "iconv-lite": "^0.7.2", + "iconv-lite": "^0.7.3", "on-finished": "^2.4.1", - "qs": "^6.15.2", + "qs": "^6.16.1", "raw-body": "^3.0.2", "type-is": "^2.1.0" }, @@ -3884,9 +3884,9 @@ } }, "node_modules/body-parser/node_modules/content-type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz", - "integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.1.0.tgz", + "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==", "license": "MIT", "engines": { "node": ">=18" @@ -4219,6 +4219,15 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "license": "MIT", + "engines": { + "node": ">= 10" + } + }, "node_modules/content-disposition": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.1.0.tgz", @@ -4456,9 +4465,9 @@ } }, "node_modules/d3-array": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz", - "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.5.tgz", + "integrity": "sha512-Th8qGXoBalmWsstpkuhmBuTsBQIFqYOJtjlBvNVvBfJ8E3uYusBUwUR8HU20U0qKKQkgCvKyR1YjiozWadk5QA==", "license": "ISC", "dependencies": { "internmap": "1 - 2" @@ -4584,15 +4593,6 @@ "node": ">=12" } }, - "node_modules/d3-dsv/node_modules/commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", - "license": "MIT", - "engines": { - "node": ">= 10" - } - }, "node_modules/d3-ease": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz", @@ -4671,9 +4671,9 @@ } }, "node_modules/d3-path": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.0.tgz", - "integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.1.tgz", + "integrity": "sha512-jsbgV8zIT38ReB9O7X7gcLndTQRONSqNNd+oGIaTBdUug4r5jFmp0N6RY9R5GWbdUDucn0qoTGyfjapT4tDhcg==", "license": "ISC", "engines": { "node": ">=12" @@ -4740,12 +4740,6 @@ "d3-path": "1" } }, - "node_modules/d3-sankey/node_modules/internmap": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/internmap/-/internmap-1.0.1.tgz", - "integrity": "sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw==", - "license": "ISC" - }, "node_modules/d3-scale": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz", @@ -4785,12 +4779,12 @@ } }, "node_modules/d3-shape": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz", - "integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.1.tgz", + "integrity": "sha512-dm2o+lbKdzg9tY7GEag/dB9hcbodLfwkE/DkvqbELJXaMz0yKzWWhZqhbI7CKubukA7HnRyz0avdtvi7EPxPvw==", "license": "ISC", "dependencies": { - "d3-path": "^3.1.0" + "d3-path": "^3.1.1" }, "engines": { "node": ">=12" @@ -5597,9 +5591,9 @@ } }, "node_modules/fast-json-stringify/node_modules/fast-uri": { - "version": "2.4.7", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-2.4.7.tgz", - "integrity": "sha512-b8mggfg2R+m2OAb3Z+2HcJxUgU+2cY1JQondBDyXLdrEKNPxd96MvnB5yWKZdupsuX6GdBaAZHZo9msHX/Bb7A==", + "version": "2.4.8", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-2.4.8.tgz", + "integrity": "sha512-knw8ym69bDOF980l2z0tDKh7XB9zfsUmpMmoQUx9KskazmddvnhNntiTzen4VsiW7qVWiVZkrcd5Pj2bziC3gA==", "license": "MIT" }, "node_modules/fast-querystring": { @@ -5619,9 +5613,9 @@ "peer": true }, "node_modules/fast-uri": { - "version": "3.1.8", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.8.tgz", - "integrity": "sha512-GZMtZUTNRpOVIECoXwLNZS5xUGE+mVNbTB8h/7Rwh2TFWcBQiPzTgyZi05BF9UMZKkLJv8XBRJTlU7zg8+ZfMg==", + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.9.tgz", + "integrity": "sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==", "funding": [ { "type": "github", @@ -5690,9 +5684,9 @@ "license": "MIT" }, "node_modules/fastify/node_modules/semver": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -6332,13 +6326,10 @@ "license": "MIT" }, "node_modules/internmap": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz", - "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==", - "license": "ISC", - "engines": { - "node": ">=12" - } + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/internmap/-/internmap-1.0.1.tgz", + "integrity": "sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw==", + "license": "ISC" }, "node_modules/ip-address": { "version": "10.7.4", @@ -7195,9 +7186,9 @@ } }, "node_modules/make-dir/node_modules/semver": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", "dev": true, "license": "ISC", "bin": { @@ -8209,13 +8200,13 @@ } }, "node_modules/minimatch": { - "version": "10.2.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", - "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { - "brace-expansion": "^5.0.5" + "brace-expansion": "^5.0.8" }, "engines": { "node": "18 || 20 || >=22" @@ -8544,9 +8535,9 @@ "license": "BlueOak-1.0.0" }, "node_modules/package-manager-detector": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/package-manager-detector/-/package-manager-detector-1.6.0.tgz", - "integrity": "sha512-61A5ThoTiDG/C8s8UMZwSorAGwMJ0ERVGj2OjoW5pAalsNOg15+iQiPzrLJ4jhZ1HJzmC2PIHT2oEiH3R5fzNA==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/package-manager-detector/-/package-manager-detector-1.9.0.tgz", + "integrity": "sha512-zAMfbta9nPA8AKkA4WdmNAT8R8s6Dk0/xwPsqNnRidMFcLo1YkLuPDTgs2f64XdzS8vbLNnoJ+uUIkgbz7oRHA==", "license": "MIT" }, "node_modules/parse-entities": { @@ -9612,9 +9603,9 @@ "license": "BSD-3-Clause" }, "node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "version": "6.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.2.tgz", + "integrity": "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ==", "dev": true, "license": "ISC", "bin": { @@ -10307,9 +10298,9 @@ "license": "MIT" }, "node_modules/tinyexec": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.2.4.tgz", - "integrity": "sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.1.tgz", + "integrity": "sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==", "license": "MIT", "engines": { "node": ">=18" @@ -10483,9 +10474,9 @@ } }, "node_modules/type-is/node_modules/content-type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz", - "integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.1.0.tgz", + "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==", "license": "MIT", "engines": { "node": ">=18" @@ -10535,9 +10526,9 @@ } }, "node_modules/undici-types": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz", - "integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==", + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz", + "integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==", "license": "MIT" }, "node_modules/unicorn-magic": { @@ -10705,9 +10696,9 @@ "license": "MIT" }, "node_modules/uuid": { - "version": "14.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-14.0.1.tgz", - "integrity": "sha512-6ZxzVpzDXDa3bJWaHilVayA+BH/1zmxCJoVgvmqJnid/gPoKHxUrS/aC/T6LGQtNHT+XHG9fXPJB4d+IrU30Ew==", + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-14.0.3.tgz", + "integrity": "sha512-Sc5u1VVln93y1Xnz4R+CunOZc7R9LUcTmhj7Rc7Eg3HVcf7rVn2FOoa812fe0W8p3jD7xeoGSYbfqCGGH2B6xw==", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" @@ -11099,9 +11090,9 @@ "license": "ISC" }, "node_modules/yaml": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", - "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.1.tgz", + "integrity": "sha512-3NxN8+78OdzbT7C/WjGsyfPAtJaN3FNDsWxv7Y7mcDsT/oOmgW8BpyQQFFBnvZE3j9Y2Sdz1ULFLezL7Eb2yFw==", "license": "ISC", "bin": { "yaml": "bin.mjs" @@ -11153,9 +11144,9 @@ } }, "node_modules/zod": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", - "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", + "version": "4.6.7", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.7.tgz", + "integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" @@ -11197,7 +11188,7 @@ "jose": "^6.2.3", "proxy-addr": "^2.0.8", "yaml": "2.9.1", - "zod": "^4.4.3" + "zod": "^4.6.6" }, "bin": { "managers": "dist/cli/managers.js" @@ -11751,21 +11742,6 @@ "dev": true, "license": "MIT" }, - "packages/server/node_modules/yaml": { - "version": "2.9.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.1.tgz", - "integrity": "sha512-3NxN8+78OdzbT7C/WjGsyfPAtJaN3FNDsWxv7Y7mcDsT/oOmgW8BpyQQFFBnvZE3j9Y2Sdz1ULFLezL7Eb2yFw==", - "license": "ISC", - "bin": { - "yaml": "bin.mjs" - }, - "engines": { - "node": ">= 14.6" - }, - "funding": { - "url": "https://github.com/sponsors/eemeli" - } - }, "packages/web": { "name": "@managers/web", "version": "0.3.1", diff --git a/packages/server/package.json b/packages/server/package.json index 351c925..5a294f3 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -33,7 +33,7 @@ "jose": "^6.2.3", "proxy-addr": "^2.0.8", "yaml": "2.9.1", - "zod": "^4.4.3" + "zod": "^4.6.6" }, "devDependencies": { "@types/node": "22.5.4", diff --git a/test/bin/claude b/test/bin/claude index 8bbf9f3..4724f33 100755 --- a/test/bin/claude +++ b/test/bin/claude @@ -602,12 +602,37 @@ function nowIso() { return new Date().toISOString(); } +/** + * One never-notified word, so `Atomics.wait` below always runs its timeout out. + * Hoisted because a fresh `SharedArrayBuffer` per call would allocate once per + * streamed delta. + */ +const SLEEP_WORD = new Int32Array(new SharedArrayBuffer(4)); + +/** + * Block this process for `ms`, WITHOUT burning a CPU core. + * + * Synchronous is load-bearing: this script is straight-line, and the delays are + * what make the watcher see transcript lines arrive incrementally rather than + * all at once. `Atomics.wait` on a word nothing ever notifies is the only + * synchronous sleep Node has that actually parks the thread — which is the whole + * point here. + * + * It used to be `while (Date.now() < end) {}`, and that spin was the cause of a + * long-standing E2E flake (edspencer/paddock#947). The windows these delays hold are not small: + * `[[SLOWTOOL]]` is 12s, `[[BGTASK]]` 30s and `[[BGSUBAGENT]]` 150s in + * `playwright.config.ts`, all of them deliberately outliving the spec that + * started them so the NEXT specs run while the fake is still inside its hold. + * One spin is a pegged core for that whole window; two or three at once, next to + * Chromium and the server, is more than a 4-vCPU CI runner has. The server's + * event loop then starves, a turn that normally completes in under a second + * takes 30-45, and the assertions time out looking exactly like the + * background-work bugs they exist to detect. + * + * Anything added here must stay off the CPU for the same reason. + */ function sleep(ms) { - // Synchronous-ish small delay so the watcher sees lines arrive incrementally. - const end = Date.now() + ms; - while (Date.now() < end) { - /* spin briefly */ - } + if (ms > 0) Atomics.wait(SLEEP_WORD, 0, 0, ms); } /**