LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-ada
createdAtSep 3, 2026, 10:52 AM
updatedAtSep 3, 2026, 11:10 AM
githubUrlhttps://github.com/neomjs/neo/issues/18175
authorneo-opus-ada
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 3, 2026, 11:10 AM

restoreTab reached the dispatch table without a change class, and dev is red

neo-opus-ada
neo-opus-ada commented on Sep 3, 2026, 10:52 AM

Context

dev is red on the unit job and it blocks every open PR. First seen on #18174, which is unrelated to the cause.

The failing arm is mine, from #18152:

DockOperationChangeClass.spec.mjs:47
  every operation in the dispatch table carries a change class
  + Array [ "restoreTab" ]

This is the guard working, not a flake. Its own comment states the contract it just enforced: "a new operation added to dispatch without a class fails here rather than silently degrading." restoreTab landed in operationHandlers via #18164 / PR #18165 (5e67e5e486) while operationChangeClass was written before that operation existed.

The Problem

Operations.operationHandlers and Operations.operationChangeClass are siblings that must stay in step. The dispatch table derives the exported vocabulary from its own keys, so those two "cannot diverge by construction" — but a sibling map cannot inherit that guarantee, which is exactly why #18152 shipped the completeness arm as the enforcement instead.

Without an entry, changeClassFor('restoreTab') falls through to topology — the safe default, so runtime behaviour is correct today. The red is the guard refusing to let the map drift silently, which is the behaviour it was built for.

The Fix

Declare restoreTab: 'topology' beside its reducer.

Verified against the reducer rather than inferred from the name: Operations.restoreTab delegates to addTab when the target node still exists, and otherwise mints a new node — doc.nodes[nodeId] = {activeItemId: itemId, items: [itemId], type: 'tabs'}, with Document.genId when the id collides. Creating a node is a structural change, so topology is correct on both branches; addTab is itself topology.

Acceptance Criteria

  • AC-1 — Operations.changeClassFor('restoreTab') is topology, and the completeness arm is green in both directions.
  • AC-2 — the unit job is green on a PR based on current dev.
  • AC-3 — no behaviour change: restoreTab already fell through to topology, so getRefreshOptions returns the same {} before and after. Asserted, so the fix cannot be mistaken for a refresh-shape change.

Out of Scope

  • Making the two maps structurally inseparable. Merging the class into operationHandlers entries would change the dispatch table's shape and every reader of it — a real design question, and not one to answer while dev is red. See Related.

Avoided Traps

  • Weakening the arm to unblock CI. The arm is the only thing keeping the maps in step; relaxing it would trade a red build for a silent drift, which is the failure it exists to prevent.
  • Guessing the class from the operation's name. restoreTab sounds like a sibling of addTab and is — but only on one of its two branches; the other creates a node, and that is what makes topology right rather than merely plausible.

Related

Origin Session ID: 7596538d-5324-419a-b043-95c585d833ea

Retrieval Hint: restoreTab operationChangeClass completeness arm red dev dispatch table sibling map drift

tobiu referenced in commit 874a392 - "fix(dock): restoreTab declares its change class, so dev goes green (#18175) (#18176) on Sep 3, 2026, 11:10 AM
tobiu closed this issue on Sep 3, 2026, 11:10 AM