Context
test/playwright/unit/dashboard/CrossWindowDragTarget.spec.mjs:54 — "an incomplete registry identity never registers (§2.3: sortGroup + windowId are mandatory)" — reds the unit job intermittently, on branches that touch none of the code it exercises. Today alone it has carried a red on #18783 (a menu change), #18773 ×2 (a grid change) and #18784's branch, and a same-SHA rerun on #18773 reproduced it rather than clearing it.
The job is right to go red. test/playwright/playwright.config.unit.mjs:28 sets failOnFlakyTests: isCI beside retries: 2 — a flake that retries green still fails CI, which is the policy that keeps flakes from becoming background noise. Nothing here proposes changing that; the arm is what needs fixing.
Measured while shipping #18781, twelve full-suite runs on one branch and eight on dev source in the same worktree:
| condition |
result |
| the spec alone, either head |
3/3 green |
full suite, dev source |
0 failures in 8 runs |
| full suite, an engine branch |
3 failures in 12 runs, clustered in one window |
Not attributable to any diff. The arm is order- and load-dependent, which is exactly what asserting a shared global under parallel workers produces.
The Problem
const target = Neo.create(CrossWindowDragTarget, {windowId: 3});
expect(DragCoordinator.sortZones.size).toBe(0);DragCoordinator is a singleton and sortZones is its process-global registry. playwright.config.unit.mjs runs fullyParallel: true with workers: 4, so each worker process runs many spec files in one shared module registry — and the arm's claim is not about the component it just created, it is about everything in that process. Any spec sharing the worker that registers a sort zone and has not yet destroyed it makes the assertion false, without either spec being wrong.
The intent is narrow and correct: a target created without sortGroup must not register. The assertion is global, and that is the whole defect.
The Architectural Reality
The same file already shows the shape that survives parallelism, one arm earlier:
| site |
claim |
parallel-safe |
CrossWindowDragTarget.spec.mjs:31 |
sortZones.has('dock-main') is false after destroy |
yes — names the group this arm created |
manager/DragCoordinator.spec.mjs:154, :236 |
sortZones.has('dock') is false |
yes — same shape |
CrossWindowDragTarget.spec.mjs:59 |
sortZones.size is 0 |
no — a claim about every other spec in the worker |
One greppable rule covers it: an arm may assert the groups it created; it may not assert that the map is empty.
src/manager/DragCoordinator.mjs — sortZones, the singleton registry.
src/dashboard/dock/window/DragTarget.mjs:411 — destroy() unregisters only when sortGroup && windowId != null, which is what the arm is really checking.
The Fix
Assert the negative the arm means: after creating a target with windowId and no sortGroup, no group in the registry holds that target. [...sortZones.values()].some(byWindow => [...byWindow.values()].includes(target)) is false — true regardless of what else shares the worker, and still false-able by the defect it guards (a target that registers without a sortGroup appears in exactly one group).
Deliberately not proposed: changing failOnFlakyTests, adding a beforeEach that clears the singleton (it would hide a real leak from a sibling spec and make the suite order-dependent in the other direction), or serialising the unit project.
Acceptance Criteria
Out of Scope
unit/list/animatePlugin.spec.mjs:551, the other arm reddening the same job — @neo-opus-grace's defect-note, hers to file.
failOnFlakyTests and the retry policy — deliberate, and this ticket depends on them staying that way.
unit/main/DomEvents.spec.mjs's namespace restoration — #18776, the same family from the other side (state left behind rather than state assumed absent).
Avoided Traps
- Clearing the singleton in a hook. It would green the arm and hide a sibling's leak in the same motion, which is how a suite stops being able to report contamination at all.
- Blaming the last diff that reddened. Twelve runs against eight say it is neither; a flake that follows the branch you happen to be on is a scheduling artifact, not evidence.
- Serialising the project. The parallelism is the point of a 4200-arm suite finishing in 23 seconds; one arm's global claim does not get to spend that.
Related
- #18776 — the mirror half: a spec that leaves shared namespace state behind.
- #18772 — the same class one tier up: a component arm that measured across two round-trips.
- #18784 / #18781 — where the twelve-run measurement was taken.
Live latest-open sweep: checked the latest 12 open issues at 2026-09-16T11:25:20Z; no equivalent found. A2A in-flight claim sweep: coordinated directly with @neo-opus-grace, who captured the job-level note first and holds the animatePlugin arm; no competing claim on this one. Memory Core rationale sweep on the symptom nouns: returned the #18721 overflow-flake lane and no prior decision on global-state assertions. Own-assignment sweep: no same-surface hit. Structure-map gate: N/A — no .mjs created or relocated, nothing under ai/, Agent OS, MCP, Memory Core, orchestration or .agents/skills.
Decision Record impact: none.
Origin Session ID: cd67869d-cec2-4c36-99a6-aa521a73fddb
Retrieval Hint: "unit arm asserts a process-global registry is empty under parallel workers" · query_raw_memories on "an arm may assert the groups it created, never that the map is empty"
Context
test/playwright/unit/dashboard/CrossWindowDragTarget.spec.mjs:54— "an incomplete registry identity never registers (§2.3: sortGroup + windowId are mandatory)" — reds theunitjob intermittently, on branches that touch none of the code it exercises. Today alone it has carried a red on #18783 (a menu change), #18773 ×2 (a grid change) and #18784's branch, and a same-SHA rerun on #18773 reproduced it rather than clearing it.The job is right to go red.
test/playwright/playwright.config.unit.mjs:28setsfailOnFlakyTests: isCIbesideretries: 2— a flake that retries green still fails CI, which is the policy that keeps flakes from becoming background noise. Nothing here proposes changing that; the arm is what needs fixing.Measured while shipping #18781, twelve full-suite runs on one branch and eight on
devsource in the same worktree:devsourceNot attributable to any diff. The arm is order- and load-dependent, which is exactly what asserting a shared global under parallel workers produces.
The Problem
const target = Neo.create(CrossWindowDragTarget, {windowId: 3}); expect(DragCoordinator.sortZones.size).toBe(0);DragCoordinatoris a singleton andsortZonesis its process-global registry.playwright.config.unit.mjsrunsfullyParallel: truewithworkers: 4, so each worker process runs many spec files in one shared module registry — and the arm's claim is not about the component it just created, it is about everything in that process. Any spec sharing the worker that registers a sort zone and has not yet destroyed it makes the assertion false, without either spec being wrong.The intent is narrow and correct: a target created without
sortGroupmust not register. The assertion is global, and that is the whole defect.The Architectural Reality
The same file already shows the shape that survives parallelism, one arm earlier:
CrossWindowDragTarget.spec.mjs:31sortZones.has('dock-main')is false after destroymanager/DragCoordinator.spec.mjs:154,:236sortZones.has('dock')is falseCrossWindowDragTarget.spec.mjs:59sortZones.sizeis 0One greppable rule covers it: an arm may assert the groups it created; it may not assert that the map is empty.
src/manager/DragCoordinator.mjs—sortZones, the singleton registry.src/dashboard/dock/window/DragTarget.mjs:411—destroy()unregisters only whensortGroup && windowId != null, which is what the arm is really checking.The Fix
Assert the negative the arm means: after creating a target with
windowIdand nosortGroup, no group in the registry holds that target.[...sortZones.values()].some(byWindow => [...byWindow.values()].includes(target))is false — true regardless of what else shares the worker, and still false-able by the defect it guards (a target that registers without asortGroupappears in exactly one group).Deliberately not proposed: changing
failOnFlakyTests, adding abeforeEachthat clears the singleton (it would hide a real leak from a sibling spec and make the suite order-dependent in the other direction), or serialising the unit project.Acceptance Criteria
DragTarget#destroy's registration guard removed (or asortGroupadded to the arm's config), the rewritten arm fails. An arm that cannot fail is what the size assertion degenerated into.sortZones.size/ equivalent global-emptiness assertions acrosstest/playwright/unitis recorded here, and any second instance is fixed with it or filed.Out of Scope
unit/list/animatePlugin.spec.mjs:551, the other arm reddening the same job — @neo-opus-grace'sdefect-note, hers to file.failOnFlakyTestsand the retry policy — deliberate, and this ticket depends on them staying that way.unit/main/DomEvents.spec.mjs's namespace restoration — #18776, the same family from the other side (state left behind rather than state assumed absent).Avoided Traps
Related
Live latest-open sweep: checked the latest 12 open issues at 2026-09-16T11:25:20Z; no equivalent found. A2A in-flight claim sweep: coordinated directly with @neo-opus-grace, who captured the job-level note first and holds the
animatePluginarm; no competing claim on this one. Memory Core rationale sweep on the symptom nouns: returned the #18721 overflow-flake lane and no prior decision on global-state assertions. Own-assignment sweep: no same-surface hit. Structure-map gate: N/A — no.mjscreated or relocated, nothing underai/, Agent OS, MCP, Memory Core, orchestration or.agents/skills.Decision Record impact: none.
Origin Session ID: cd67869d-cec2-4c36-99a6-aa521a73fddb
Retrieval Hint: "unit arm asserts a process-global registry is empty under parallel workers" ·
query_raw_memorieson "an arm may assert the groups it created, never that the map is empty"