Filed unassigned by the os-dev seat while verifying objectui#8344 (session session_01CZY49skxUBYyJcdnTcYPrE). Grading and domain:* are the triage seat's.
The defect
FAIL |unit| scripts/__tests__/network-escape-ledger.test.ts
> the STANDING guard survived the retirement (objectui#6640)
> still wraps the global fetch to record escapes
AssertionError: expected 'Mock' to be 'guardedFetch'
scripts/__tests__/network-escape-ledger.test.ts:122
expect(globalThis.fetch.name).toBe('guardedFetch');
globalThis.fetch.name reads Mock, so some other file in the same worker replaced the global with a vi.fn() and did not put it back. The unit project runs isolate: false — one module graph and one global object per worker — which vitest.config.mts documents as deliberate, with the invariant it depends on written out beside it.
Measured, on a clean baseline — this is NOT caused by any branch
A detached worktree at origin/main 61e649ab1, fresh pnpm install, nothing else:
pnpm exec vitest run --project unit --maxWorkers=2
Test Files 1 failed | 974 passed (975)
Tests 1 failed | 16572 passed | 2 skipped (16575)
FAIL scripts/__tests__/network-escape-ledger.test.ts (the case above)
Controls, same tree, same session:
- Alone it passes:
pnpm exec vitest run --project unit scripts/__tests__/network-escape-ledger.test.ts — 5 passed.
- Its own directory passes:
--project unit scripts/__tests__ — 121 files, 3630 tests, all green. So the writer is outside scripts/__tests__.
- It reproduces: two consecutive full runs on a feature branch failed identically before the baseline was taken, which is what prompted taking one.
Why it is worth a card rather than a shrug
The failure lands on a file that did nothing wrong and says nothing about the code under test — the exact shape vitest.config.mts names when it explains why the isolate: false invariant is ENFORCED by scripts/__tests__/unit-registry-absence-collision.test.ts rather than left written down. That gate covers ComponentRegistry keys only; the global fetch is the same class of shared state with no gate behind it.
⚠️ It also silently taxes every branch: a dev seat that runs the full unit project sees one red file it has to rule out by hand before it can trust its own result.
Two directions a repair could take
- Find the writer and make it restore (
vi.unstubAllGlobals / an afterEach), then extend the collision gate to cover globals the setup files install, so the next writer is caught rather than discovered.
- Have the ledger read the guard through the setup file's own handle instead of
globalThis.fetch, and pin the wrapper separately — narrower, and it stops reporting the leak rather than stopping the leak.
Generated by Claude Code
Filed unassigned by the
os-devseat while verifying objectui#8344 (sessionsession_01CZY49skxUBYyJcdnTcYPrE). Grading anddomain:*are the triage seat's.The defect
globalThis.fetch.namereadsMock, so some other file in the same worker replaced the global with avi.fn()and did not put it back. Theunitproject runsisolate: false— one module graph and one global object per worker — whichvitest.config.mtsdocuments as deliberate, with the invariant it depends on written out beside it.Measured, on a clean baseline — this is NOT caused by any branch
A detached worktree at
origin/main61e649ab1, freshpnpm install, nothing else:Controls, same tree, same session:
pnpm exec vitest run --project unit scripts/__tests__/network-escape-ledger.test.ts— 5 passed.--project unit scripts/__tests__— 121 files, 3630 tests, all green. So the writer is outsidescripts/__tests__.Why it is worth a card rather than a shrug
The failure lands on a file that did nothing wrong and says nothing about the code under test — the exact shape
vitest.config.mtsnames when it explains why theisolate: falseinvariant is ENFORCED byscripts/__tests__/unit-registry-absence-collision.test.tsrather than left written down. That gate coversComponentRegistrykeys only; the globalfetchis the same class of shared state with no gate behind it.unitproject sees one red file it has to rule out by hand before it can trust its own result.Two directions a repair could take
vi.unstubAllGlobals/ anafterEach), then extend the collision gate to cover globals the setup files install, so the next writer is caught rather than discovered.globalThis.fetch, and pin the wrapper separately — narrower, and it stops reporting the leak rather than stopping the leak.Generated by Claude Code