LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-ada
createdAtNov 9, 2026, 3:11 PM
updatedAtNov 9, 2026, 4:14 PM
githubUrlhttps://github.com/neomjs/neo/issues/20661
authorneo-opus-ada
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 9, 2026, 4:14 PM

Workstation boot and Reset to default ignore perspectives.shipped

neo-opus-ada
neo-opus-ada commented on Nov 9, 2026, 3:11 PM

Context

The Workstation declares its shipped arrangement as perspectives: {shipped: initialDocument} (apps/workstation/view/Workspace.mjs:81, from #18612 and #18641). Its cold boot and its Reset to default don't read that declaration. They read the module constant initialDocument from apps/workstation/tour/denseWorkstation.mjs.

Inside Engine the two are the same object, so nothing shows. A subclass that declares its own shipped arrangement does see it:

  • On a fresh profile, it boots to Engine's document.
  • It loses its own panes on the first Reset to default, or on Start tour, which runs the same reset (#19442).
  • The reset is saved, so the loss survives a reload.

Measured 2026-11-08 around 04:00Z, headless, on Engine dev d2aaa58e09. I used a Workspace subclass whose shipped document adds one tab to Engine's. As a stopgap, it also supplied that document as the cold-boot initialTopology. Before resetTopology(), main held the extra tab. The call returned {errors: [], reset: true}, and afterwards the tab was gone. I found this while building a Workstation subclass, and held it until the 13.4 cut under the release gate. I re-read the code at a4e508d25e (13.4.0): all three reads below are unchanged.

The Problem

apps/workstation/view/Workspace.mjs at a4e508d25e reads the module constant in three places:

  • construct (:262): WorkspaceDocument.clone(me.initialTopology?.workspaces[MAIN] ?? initialDocument). With no saved topology, a cold boot starts from the module document.
  • resetTopology (:200): the panes to reclaim from other workspaces are initialDocument.items.
  • resetTopology (:201): main's next document is initialDocument.

The Topology toolbar's Reset to default (TopologyToolbar.mjs:62) and the visible tour's entry (TourController.mjs:892) both call resetTopology().

Meanwhile dock.perspective.modified compares the live document with the captured shipped baseline (src/dashboard/dock/projection/PerspectiveState.mjs:68). So, inferred from the code and not run: a subclass reads modified: true right after a cold boot, and still reads modified: true after Reset to default. The readout and the reset disagree about what was shipped.

The Architectural Reality

  • The engine dock Workspace captures perspectives once, after construction, in PerspectiveSelection#capture() (src/dashboard/dock/interaction/PerspectiveSelection.mjs:82). A lowered document is a valid value (#18641). PerspectiveSelection#document(name) (:110) returns a fresh copy of a captured baseline, and PerspectiveState reads the same copy for modified.
  • The Workstation supplies its document in construct, before onAfterConstructed creates the selection. So the boot can only read the raw declaration, me.perspectives.shipped. A saved main document keeps precedence, as #18612 requires ("supplied-document precedence").
  • resetTopology runs after construction, so it can read the captured baseline.
  • TourController#runSpecTour (TourController.mjs:771) also stages initialDocument, as the precondition of the script it imports beside it. #19442 left runSpecTour out of scope, and so does this ticket.

Design authority: apps/workstation/README.md:107: "Reset to default restores the shipped arrangement." And :27–28: "[view/Workspace.mjs] is the composition entrypoint. It declares the shipped perspective". The shipped arrangement is the declared one. initialDocument is only its default value.

The Fix

In apps/workstation/view/Workspace.mjs:

  1. construct falls back to me.perspectives.shipped instead of initialDocument.
  2. resetTopology reads the shipped document once, with me.perspectiveSelection.document('shipped'), and uses that for both the reclaim set and main's next document.
  3. The resetTopology JSDoc names the declared shipped perspective wherever it now says initialDocument. initialDocument stays imported only as the perspectives default.

In test/playwright/unit/apps/workstation/Workspace.spec.mjs: a subclass that declares its own shipped document (Engine's plus one tab) boots to it with no saved topology and reads unmodified. After a change, resetTopology() restores it. These rows are red on the base and green with the fix. The statusModule seam rows (#20264) are the pattern.

Contract Ledger

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
Workstation.view.Workspace perspectives.shipped README.md:107 A cold boot with no saved main, and resetTopology(), both use the declared shipped document A saved main document still wins at boot (#18612) resetTopology JSDoc the unit rows above

Acceptance Criteria

  • A Workspace subclass that declares its own perspectives.shipped boots to that document when no saved topology exists, and dock.perspective reads {active: 'shipped', modified: false}.
  • After a change, resetTopology() restores the subclass's shipped document for main and reclaims its panes from the other workspaces, in one undoable write.
  • A saved main document still wins over the declared one at boot.
  • The Workspace, WorkspacePerspective and TourController unit specs stay green.

Out of Scope

  • runSpecTour's staging document. See above, and #19442.
  • Booting to a non-shipped activePerspective. The engine's own boot without a supplied document uses the active declaration. In the Workstation, both the cold boot and Reset to default mean the shipped arrangement (README.md:107).
  • A shipped declared as zones rather than as a lowered document. The Workstation authors documents (#18641).

Avoided Traps

  • Supplying the shipped document at construct when a saved topology exists. The single-owner check refuses it once the saved topology holds a pane outside main (#18641's measured throw). The fix changes only the fallback for when there is no saved topology.
  • Re-reading me.perspectives in resetTopology. The engine captures perspectives once at construction, so the reset restores what was captured, as resetPerspective() does.

Related

#18612 · #18641 · #18553 · #19442 · #20264 (the subclass seam pattern) · #20660 (filed with this one, unrelated surface)

Live latest-open + closed sweep: checked the latest 20 open plus a closed search (perspectives shipped, resetTopology, Workstation reset default, initialDocument), and read the Out of Scope and Avoided Traps of #18612, #18641, #18553 and #19442, at 2026-11-09T14:10Z. No equivalent or prior exclusion found. Backlog band: 7 open (green). MC sweep: "Workstation boots and Reset to default restore the module initialDocument instead of the declared perspectives shipped document; subclass arrangement lost on reset", 6 results, no prior decision found. Own-assignment sweep: 1 open (#20660, another surface). A2A sweep: the latest 30 messages, no overlapping claim.

Ownership: self-assigned. I've held this since the 13.4 gate (2026-11-08). It goes after #20660.

Origin Session ID: b73b26a6-280c-4dc2-a4d1-c1d482593aa1 Retrieval Hint: "Workstation perspectives shipped cold boot resetTopology initialDocument subclass"

tobiu referenced in commit c441684 - "fix(workstation): boot and reset use perspectives.shipped (#20661) (#20663) on Nov 9, 2026, 4:14 PM
tobiu closed this issue on Nov 9, 2026, 4:14 PM