LearnNewsExamplesServices
Frontmatter
id15003
titleDemo B: consume topology capture/reconciliation and render restore remainder
stateClosed
labels
enhancementdeveloper-experienceai
assigneesneo-gpt
createdAt1:12 AM
updatedAt3:32 AM
githubUrlhttps://github.com/neomjs/neo/issues/15003
authorneo-gpt
commentsCount0
parentIssue14590
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAt3:32 AM
milestonev13.2

Demo B: consume topology capture/reconciliation and render restore remainder

Closed Backlog/active-chunk-5 enhancementdeveloper-experienceai
neo-gpt
neo-gpt commented on 1:12 AM

Context

PR #14999 delivers the two independently valuable halves of Demo B: named single-workspace perspective morphing and a live pane moving to a real OS window without remounting. Exact-head review found that its S4 narration calls a single-workspace saved-layout replay “cross-topology fail-closed,” but the demo never invokes the already-landed topology APIs.

This successor keeps #14999 mergeable without teaching the wrong semantics, while preserving #14590’s remaining acceptance criterion as an owned v13.2 lane.

The Problem

The current Demo B code:

  • captures every perspective with DockZoneModel.createSavedLayout() (window scope);
  • reloads through DockPerspectiveStore.loadPerspective() followed by a direct primary-document swap;
  • never calls DockZoneModel.captureTopologyPerspective() or DockTopologyReconciler.reconcile();
  • has no visible unrestored / displaced report surface.

Therefore a pane being absent from the primary tree after loading “Detached” is not changed-topology reconciliation and is not fail-closed validation behavior. It is a valid detached-item single-workspace state, but the topology consumer promised by #14590 remains missing.

The Architectural Reality

  • ADR 0029 §2.2 is authoritative: topology capture is explicit; changed-topology restore validates before mutation, restores worker-owned truth, does not auto-spawn windows, and reports applied/recovered remainder.
  • The required substrate is already merged:
    • DockZoneModel.captureTopologyPerspective();
    • DockTopologyReconciler.reconcile();
    • DockZoneModel.transferItem() for honest two-document ownership;
    • DockPerspectiveStore for persisted named records.
  • The popup is a render target. To demonstrate a two-workspace topology honestly, the worker must own both workspace documents; component reparenting remains an orthogonal live-instance operation.
  • The demo is small (two slots), so #14945’s dense assignment-performance gate remains complementary, not blocking.

The Fix

Extend Demo B in one coherent PR:

  1. Give the popup a real valid dockZone.v1 workspace document.
  2. Pop out / reattach through atomic transferItem() between main and popup documents while keeping the cached pane instance and current SharedWorker reparenting behavior.
  3. Capture “Detached” with captureTopologyPerspective([mainDocument, popupDocument], metadata); keep ordinary named views window-scoped.
  4. On topology load, call DockTopologyReconciler.reconcile(savedLayout, liveDocuments) instead of direct-swapping the primary document.
  5. Persist and visibly render a plain restore report derived from unrestored, displaced, and unmatchedLive; explicitly say that no window was spawned.
  6. Keep validation failure semantically distinct: invalid input leaves the active perspective untouched and surfaces errors.

Acceptance Criteria

  • Popup ownership is represented by a second valid worker-owned workspace document; pop-out and reattach transfer the item commit-or-neither.
  • “Detached” is stored with captureScope: 'topology' and one additional window document.
  • Loading “Detached” into the one-window topology goes through DockTopologyReconciler.reconcile().
  • The live result visibly reports the missing popup slot / unrestored item and any displaced item; no popup is auto-opened.
  • A validation-failure probe proves fail-closed behavior leaves both live documents untouched.
  • The final “Focus” restore returns the exact same cached CounterPane instance; the counter never resets.
  • Focused unit coverage pins transfer, topology capture, reconciliation report, no-spawn behavior, and object identity.
  • Live tour runs twice deterministically with one real popup round-trip and no page errors.
  • Cross-family review before merge.

Out of Scope

  • Changing DockTopologyReconciler semantics.
  • Scaling dense slot assignment (#14945).
  • General Fleet cockpit topology UI.
  • New persistence schemas or another collection shape.

Evidence

Exact-head #14999 review at f727708eee928c49647b8bdae6dbad06eaddfa72:

  • focused unit: 9/9 green;
  • hosted CI: all checks green;
  • real popup and shared-heap counter continuity verified;
  • direct source trace proves no topology capture or reconciler call;
  • pure API chain (transfer → topology capture → reverse transfer → reconcile) succeeds and yields the expected no-live-window/unrestored report without spawning.

Related

Parent remainder: #14590
Origin PR: #14999
Authority: ADR 0029 §2.2
Substrate: #14668 / PR #14925
Performance complement: #14945

Origin Session ID: 019f484c-662f-7f31-969a-cbde373efd4a

tobiu referenced in commit 8f801ce - "feat(agentos): restore Demo B topology perspectives (#15003) (#15024) on 3:32 AM
tobiu closed this issue on 3:32 AM