Context
dev is red. components fails on DockReload.spec.mjs with a Playwright strict-mode violation, resolved to 2 elements — one tab-bar toolbar holding a duplicated tab button and a duplicated engine action set, both duplicates carrying the same DOM id. It moves between arms (:181 on run 33440382357, :250 on 33444096674), so it is a race reachable from any activation-plus-write path rather than one bad assertion.
#17980 owns the engine-layer collision. @neo-opus-ada measured that her escalation fix (PR #17991) does not cure the symptom — her own CI reproduced the identical duplicate with it in — and handed the consumer-side production repair back to this ticket's family. This is that repair: the successor to #17948, whose surface the red sits on.
The Problem
src/dashboard/dock/Workspace.mjs#onDockActiveIndexChange already knows this hazard and already defends against it — for exactly one of the three engine actions.
onDockActiveIndexChange({dockNodeId, item, tabContainer}={}) {
let me = this, container = …, itemId = …, committed = …;
me.syncDockCloseAction(container);
me.syncDockPinAction(container);
if (!me.dockModel || !itemId || committed === itemId) {
me.syncDockReloadAction(container);
return null
}
…applyDockZoneOperation / onDockZoneDocumentChange…
}The comment is correct and the reasoning is already written down. It simply does not cover syncDockCloseAction and syncDockPinAction, which run above the gate and therefore write on every activation — including the commit-follows path, microseconds before onDockZoneDocumentChange opens the reconcile they are racing.
Reload's deferral was added by PR #17974 in response to this exact race. Close and pin predate that lesson and never received it.
Why these two writes are structural, not cosmetic. Both end in:
action && action.hidden !== hidden && (action.hidden = hidden)
hidden on a component whose hideMode is removeDom is a DOM insert/remove, not an attribute flip. So the unguarded path is not merely queuing a style update beside a reconcile — it is queuing a structural child mutation of the tab bar beside a reconcile that is re-projecting the same subtree.
Why that duplicates rather than converges. @neo-opus-ada located the executor: src/main/DeltaUpdates.mjs#insertNode resolves its parent through DomAccess.getElement(parentId) and then unconditionally createDomTree(...) + insertBefore(...). There is no getElement(vnode.id) existence check on any insert path — verified: getElement appears in that file for parent resolution, focus, updateNode and removeNode, never for insert idempotence. Two batches that each legitimately compute an insert for the same subtree therefore produce two nodes with one id, which is precisely the captured snapshot.
That delta-layer guard is #17980's, is explicitly not being shipped tonight (it sits on every insert in the framework and needs its own red-first arms at three tiers), and is not claimed here.
The Architectural Reality
- The engine action set is
close / pin / maximize / reload, each behind its own opt-in. syncDockHeaderActions() sweeps all of them and is already called on the post-reconcile path (Workspace.mjs refresh tail), so the commit-follows branch has a correct, already-wired place for these writes to land.
- Deferring is what reload already does, so this is not a new policy — it is the existing policy applied to its remaining two members. The behavioural cost is identical and already accepted: on a committing activation, close/pin state lands one reconcile later instead of one tick earlier.
- The no-commit branch (a reconciliation re-emit, or no model) has no follow-up sweep, so it must keep syncing inline. That is why the fix moves the two calls rather than deleting them.
maximize is a pure presentation toggle with no per-item sync method and is unaffected.
The Fix
src/dashboard/dock/Workspace.mjs#onDockActiveIndexChange only. Move syncDockCloseAction and syncDockPinAction inside the existing no-commit branch, beside syncDockReloadAction, so all three engine actions obey one rule: write inline only when no commit follows; otherwise let the post-reconcile sweep own it. Extend the existing comment to name all three rather than reload alone.
Contract Ledger
| Target Surface |
Source of Authority |
Behavior |
Fallback |
Docs |
Evidence |
Workspace#onDockActiveIndexChange activation sync |
the post-reconcile syncDockHeaderActions() sweep |
close/pin/reload all sync inline only on the no-commit branch |
the committing branch's existing post-reconcile sweep, already wired |
the in-method comment names all three engine actions |
red-first arm asserting zero bar writes on a committing activation, plus correct action state after the reconcile |
No public API change; onDockActiveIndexChange keeps its signature and return contract.
Decision Record impact
aligned-with ADR 0029. Lifecycle write-ordering inside the dock workspace.
Acceptance Criteria
Out of Scope
- The
DeltaUpdates.insertNode idempotence guard. It is the other half and it is #17980's, deliberately not shipped tonight. Removing a writer reduces the opportunities for a double-insert; it does not make a double-insert converge, and this ticket must not be read as closing that.
- Claiming this cures
dev. CI is the only instrument that reproduces the race — it does not occur locally across 12 isolated runs, a full --workers=1 suite, or 6 full DockReload+DockMaximize sequences. This removes two of three writers on the hot path; whether that is sufficient is a CI observation to report honestly, not a claim to make up front.
- The boot-path sweep — that is #17992 / PR #17993, a different unserialized write in the same class.
maximize, which has no per-item sync method.
Avoided Traps
- Deleting the close/pin syncs outright. The no-commit branch has no post-reconcile sweep behind it; deleting rather than moving would leave a reconciliation re-emit with permanently stale action state.
- Guarding with a new flag. The commit-follows condition already exists in this method and already gates reload. A second, nearly-identical predicate is how two ways to be correct become zero.
- Asserting the fix by reading the source. A "no write happens" claim verified by grep is not verified. The arm must observe the action instances across a committing activation.
- Reporting a green CI as proof of cure. The race is intermittent by construction; one green run is not a control. Any cure claim needs repeated runs, and absent that the honest report is "writer removed, symptom not yet re-observed".
Related
Successor to #17948 (whose DockReload.spec.mjs carries the red). Engine-layer half: #17980, with @neo-opus-ada's partial seam in PR #17991 and the located DeltaUpdates.insertNode gap. Sibling unserialized write in the same class: #17992 / PR #17993. Reload's original deferral: PR #17974. Parent: #13158.
Live latest-open sweep: latest 20 open issues checked 2026-08-31T22:30:39Z; no equivalent — #17980 is the engine half and #17992 is the boot path. A2A in-flight claim sweep: newest 2026-08-31T22:25:58Z (@neo-opus-ada handing this scope over explicitly); no competing claim. Filed inside the operator's 21:28Z topic freeze (docklayout / tab header actions / styling).
Origin Session ID: a4fa24e6-b983-4ecd-81a2-8b98baef9cfc
Retrieval Hint: "onDockActiveIndexChange close and pin sync unconditionally before the commit while reload defers duplicate retained chrome"
— Vega (Opus 5, Claude Code) 🌿
Context
devis red.componentsfails onDockReload.spec.mjswith a Playwright strict-mode violation,resolved to 2 elements— one tab-bar toolbar holding a duplicated tab button and a duplicated engine action set, both duplicates carrying the same DOM id. It moves between arms (:181on run33440382357,:250on33444096674), so it is a race reachable from any activation-plus-write path rather than one bad assertion.#17980 owns the engine-layer collision. @neo-opus-ada measured that her escalation fix (PR #17991) does not cure the symptom — her own CI reproduced the identical duplicate with it in — and handed the consumer-side production repair back to this ticket's family. This is that repair: the successor to #17948, whose surface the red sits on.
The Problem
src/dashboard/dock/Workspace.mjs#onDockActiveIndexChangealready knows this hazard and already defends against it — for exactly one of the three engine actions.onDockActiveIndexChange({dockNodeId, item, tabContainer}={}) { let me = this, container = …, itemId = …, committed = …; me.syncDockCloseAction(container); // <- unconditional me.syncDockPinAction(container); // <- unconditional if (!me.dockModel || !itemId || committed === itemId) { me.syncDockReloadAction(container); // no commit follows: safe to write here return null } // A commit follows, and with it the post-reconcile header-action sync on settled chrome. // Reload's sync WRITES on every contract boundary (hidden/disabled flip), so running it // here too would put a vdom update in flight against the reconcile's own updates on the // same subtree — the race that intermittently dropped retained tab chrome. …applyDockZoneOperation / onDockZoneDocumentChange… }The comment is correct and the reasoning is already written down. It simply does not cover
syncDockCloseActionandsyncDockPinAction, which run above the gate and therefore write on every activation — including the commit-follows path, microseconds beforeonDockZoneDocumentChangeopens the reconcile they are racing.Reload's deferral was added by PR #17974 in response to this exact race. Close and pin predate that lesson and never received it.
Why these two writes are structural, not cosmetic. Both end in:
action && action.hidden !== hidden && (action.hidden = hidden)hiddenon a component whosehideModeisremoveDomis a DOM insert/remove, not an attribute flip. So the unguarded path is not merely queuing a style update beside a reconcile — it is queuing a structural child mutation of the tab bar beside a reconcile that is re-projecting the same subtree.Why that duplicates rather than converges. @neo-opus-ada located the executor:
src/main/DeltaUpdates.mjs#insertNoderesolves its parent throughDomAccess.getElement(parentId)and then unconditionallycreateDomTree(...)+insertBefore(...). There is nogetElement(vnode.id)existence check on any insert path — verified:getElementappears in that file for parent resolution, focus,updateNodeandremoveNode, never for insert idempotence. Two batches that each legitimately compute an insert for the same subtree therefore produce two nodes with one id, which is precisely the captured snapshot.That delta-layer guard is #17980's, is explicitly not being shipped tonight (it sits on every insert in the framework and needs its own red-first arms at three tiers), and is not claimed here.
The Architectural Reality
close/pin/maximize/reload, each behind its own opt-in.syncDockHeaderActions()sweeps all of them and is already called on the post-reconcile path (Workspace.mjsrefresh tail), so the commit-follows branch has a correct, already-wired place for these writes to land.maximizeis a pure presentation toggle with no per-item sync method and is unaffected.The Fix
src/dashboard/dock/Workspace.mjs#onDockActiveIndexChangeonly. MovesyncDockCloseActionandsyncDockPinActioninside the existing no-commit branch, besidesyncDockReloadAction, so all three engine actions obey one rule: write inline only when no commit follows; otherwise let the post-reconcile sweep own it. Extend the existing comment to name all three rather than reload alone.Contract Ledger
Workspace#onDockActiveIndexChangeactivation syncsyncDockHeaderActions()sweepNo public API change;
onDockActiveIndexChangekeeps its signature and return contract.Decision Record impact
aligned-with ADR 0029. Lifecycle write-ordering inside the dock workspace.Acceptance Criteria
syncDockCloseActionnorsyncDockPinActionwrites before the commit — asserted by observing the action instances, not by reading the source.onDockActiveIndexChangeand passes with the repair.DockReload,DockMaximizeanddashboard/component arms stay green; they are the control that the engine set still behaves.Out of Scope
DeltaUpdates.insertNodeidempotence guard. It is the other half and it is #17980's, deliberately not shipped tonight. Removing a writer reduces the opportunities for a double-insert; it does not make a double-insert converge, and this ticket must not be read as closing that.dev. CI is the only instrument that reproduces the race — it does not occur locally across 12 isolated runs, a full--workers=1suite, or 6 fullDockReload+DockMaximizesequences. This removes two of three writers on the hot path; whether that is sufficient is a CI observation to report honestly, not a claim to make up front.maximize, which has no per-item sync method.Avoided Traps
Related
Successor to #17948 (whose
DockReload.spec.mjscarries the red). Engine-layer half: #17980, with @neo-opus-ada's partial seam in PR #17991 and the locatedDeltaUpdates.insertNodegap. Sibling unserialized write in the same class: #17992 / PR #17993. Reload's original deferral: PR #17974. Parent: #13158.Live latest-open sweep: latest 20 open issues checked 2026-08-31T22:30:39Z; no equivalent — #17980 is the engine half and #17992 is the boot path. A2A in-flight claim sweep: newest 2026-08-31T22:25:58Z (@neo-opus-ada handing this scope over explicitly); no competing claim. Filed inside the operator's 21:28Z topic freeze (docklayout / tab header actions / styling).
Origin Session ID: a4fa24e6-b983-4ecd-81a2-8b98baef9cfc
Retrieval Hint: "onDockActiveIndexChange close and pin sync unconditionally before the commit while reload defers duplicate retained chrome"
— Vega (Opus 5, Claude Code) 🌿