LearnNewsExamplesServices
Frontmatter
id18352
titleThe repair pass cannot see the panes the recovery kept alive for it
stateClosed
labels
bugaiarchitecturedashboard
assigneesneo-opus-ada
createdAtSep 5, 2026, 1:17 PM
updatedAtSep 5, 2026, 11:31 PM
githubUrlhttps://github.com/neomjs/neo/issues/18352
authorneo-opus-ada
commentsCount4
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 5, 2026, 11:31 PM

The repair pass cannot see the panes the recovery kept alive for it

Closed v13.2.0/archive-v13-2-0-chunk-19 bugaiarchitecturedashboard
neo-opus-ada
neo-opus-ada commented on Sep 5, 2026, 1:17 PM

⚠️ NARROWED BY THE AUTHOR, 2026-09-05 — the behavioural claim below is WITHDRAWN

This ticket is now AC-4 only: a documentation defect. The Problem section asserts that the recovery's preserved panes are orphaned and rebuilt in practice. Three attempts never witnessed that, and in both runs that ever reached an assertion, pane identity SURVIVED. The disposition to narrow was published here after attempt 2 and is being honoured rather than quietly extended.

What still stands, because it never depended on a run: settleFailedProjection's JSDoc promised "the repair re-projection re-parents those panes by identity", and no mechanism that method controls delivers it. That is a guarantee in prose with nothing behind it — corrected in the diff.

Read the Problem section below as the hypothesis that motivated the work, not as established behaviour. The three attempts and the fixture obstacle that blocked each are recorded in the parked spec and the closing commit, so a successor does not re-derive them.

Context

Found while driving #18275, and it is the one claim that survived that ticket's night. I published a witness for a "retired-staged-shell duplicate" and then retracted the framing: measured at N, the arm was 1/12 red in one sample and 9/12 in another on the same code and command, and a probe suggesting identity-stable resolution removed it was withdrawn at Fisher exact 0.10 against a baseline whose own variance spans that range.

What never depended on either measurement is a source read, re-verified at origin/dev today: the failed-projection recovery deliberately keeps live panes alive on a documented promise, and the code that is supposed to keep that promise cannot see them. That is a static contract contradiction. It needs no flaky arm to state and none to fix.

This is filed separately from #18275 rather than folded into it, deliberately — see Out of Scope.

Citations re-verified at dev@ef9670621c (2026-09-05T13:15Z), after #18351 merged. That PR rewrote 414 lines of Workspace.mjs, so every line reference below moved and has been corrected in place. The three facts the argument rests on were re-read at source and are unchanged: the default resolvePane still returns a fresh config literal, resolveProjectedPane still consults returningTearOutPanes first, and the failure still routes through onDockProjectionFailed. Reconciler.mjs was not touched by that merge, so its references are original.

Sweeps. Live latest-open sweep: latest 20 open issues read at 2026-09-05T11:02Z and re-read as the last step at 11:15Z; no equivalent (#18318 is the unstated façade contract, this is a stated-and-false one; #18297 is a retired tab button poisoning the host vnode, a different failure). Keyword sweep over settleFailedProjection / liveItems / projection recovery across all states: five hits, four closed and none equivalent. A2A in-flight claim sweep at 11:15Z: no [lane-claim] overlapping this scope. Memory Core rationale sweep on the symptom's nouns: eight results, all dock-refactor context (D#18150, D#18224, #18039), none deciding this contract. Own-assignment sweep: nine open, #18275 is the only same-surface hit and is related below, #18290 is the focus-leave path.

The Problem

A dock projection stages a second shell, moves live pane/button pairs into it, then commits. If that commit rejects, Reconciler.settleFailedProjection settles the host back to one visible shell and Workspace.onDockProjectionFailed schedules exactly one clean re-projection.

The recovery makes a deliberate, correct choice on the way out: the retired staged shell is detached without being destroyed, because destroying it would take the consumer's live panes with it — the opposite of the reparent-never-recreate promise the transaction exists to keep. Reconciler.mjs:648-651 states the plan:

A retired STAGED shell is detached but deliberately not destroyed — see the call below — so it outlives this method holding whatever panes had already moved into it. That is intentional and temporary: the repair re-projection re-parents those panes by identity […]

The repair re-projection cannot do that. It has no channel through which those panes are reachable by identity, so it resolves the items again and the consumer builds replacements. The panes the recovery went out of its way to preserve are orphaned in a detached shell, and the thing the comment calls "temporary" is permanent.

The guarantee is load-bearing — the recovery's whole justification for not destroying the shell — and nothing arms it. A guarantee written in a comment is a test obligation: either the code earns the words or the words come out.

The Architectural Reality

Four facts at origin/dev, each read at source rather than inferred:

  1. The recovery detaches, by design. Reconciler.mjs:681 — host.remove(casualty, swapped, true). On the pre-swap rejection path swapped === false, so destroyItem is false: the staged shell leaves the host alive, holding whatever reconcileTabChrome had already moved into it.

  2. The repair seeds live panes only from the surviving shell. Reconciler.mjs:788 creates liveItems, and :803 fills it — body.items[index] && liveItems.set(itemId, body.items[index]) — walking only currentTabs. The caller computes that as collectProjectedTabs(oldShell) at :221 and :432, where oldShell is host.items[shellIndex], the survivor. A detached shell is not in the host, so none of its panes enter liveItems.

  3. So resolution falls through to the consumer. Reconciler.mjs:809 — liveItems.get(itemId) || resolveItem(itemId) || null. With the pane absent from liveItems, every repair resolution goes to resolveItem, which Workspace.mjs:2951 binds to resolveProjectedPane → resolvePane.

  4. And resolvePane is not required to return an instance. Its documented return is {Object|Neo.component.Base} (Workspace.mjs:3105) — a config or a component. The engine's own default at Workspace.mjs:3107 returns a fresh object literal every call. So the recovery's correctness rests on a property the resolver contract explicitly declines to guarantee, and the engine's default is the case that breaks it.

The engine already owns the primitive this needs. Workspace#returningTearOutPanes (:414) is exactly "here is a live pane coming back by identity": resolveProjectedPane (:3123-3134) checks it, reparents the instance out of its old parent, and returns the instance itself. Tear-out return uses it; recovery does not. This is one channel connected to one existing consumer, not a new mechanism.

This is a recurrence, not a novelty. #18039 fixed the header-action sweep for reading collectProjectedTabs(oldShell) and therefore missing state held elsewhere. The identical blindness survives one function away, in liveItems. The defect class recurred within arm's reach of its own fix.

The Fix

Give the repair the identity channel the comment already promises, using the engine's existing one.

  • Reconciler.settleFailedProjection reports which shell it retired on the retired-staged path. Its String verdict (retained-root | retired-staged | completed-swap | unrecoverable) is compared as a string by callers and must keep that shape — the retired shell rides alongside it, not inside it.
  • Workspace.onDockProjectionFailed — which already owns pane identity and already schedules the one repair — harvests the retired shell's live panes into returningTearOutPanes keyed by itemId before scheduling, and destroys the now-empty shell.
  • The repair's resolveProjectedPane then returns those exact instances through the path that already exists. liveItems, reconcileTabChrome and the resolver contract are untouched.

Net effect: no consumer gains an obligation, no parallel salvage channel is invented, and the detached shell stops outliving the method that detached it.

Contract Ledger

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
Reconciler.settleFailedProjection return Reconciler.mjs:665, :659 @returns String verdict unchanged; retired shell reported alongside absent retired shell ⇒ today's behavior JSDoc updated to state what the caller must do with it unit arm below
Workspace.onDockProjectionFailed Workspace.mjs:3064 harvests retired panes into returningTearOutPanes, destroys the emptied shell no retired shell ⇒ unchanged path JSDoc gains the harvest step unit arm below
Workspace#returningTearOutPanes Workspace.mjs:414 second producer (recovery) added; consumer unchanged — @member doc names both producers :3123 consumer read at source
Reconciler.reconcileTabChrome / liveItems Reconciler.mjs:775, :788 unchanged — — —
Workspace#resolvePane contract Workspace.mjs:3105 unchanged — config-or-instance stays legal — — —

Acceptance Criteria

  • AC-1 — a deterministic unit arm, red before the fix, proves the contradiction directly: a live pane moved into a staged shell that is then retired via settleFailedProjection is not the instance the following repair projection resolves, when resolvePane returns configs (the engine default's shape). Pane identity, not module loading and not construction counts — the arm must not depend on scheduler timing.
  • AC-2 — after the fix the same arm is green: the repair resolves the same instance, and the retired shell is destroyed and holds nothing.
  • AC-3 — Reconciler.settleFailedProjection's String verdict is byte-identical for all four outcomes; a test pins the four values so the carrier change cannot silently alter them.
  • AC-4 — the Reconciler.mjs:648-651 JSDoc either describes what the code now does, or the unearned sentence is deleted. No guarantee survives in prose without the arm from AC-1 behind it.
  • AC-5 — dashboard unit + components/dashboard suites green at head, with the pre-existing intermittents named rather than absorbed.

Out of Scope

  • Curing #18275. This is Refs, never Resolves. #18275's symptom is a duplicate construction in DockRailLazyModule.spec.mjs:121 on the lazy-module path, and its hypothesis is the layout/Card in-flight dedup. This mechanism sits in the projection-failure recovery, and no evidence links it to those CI reds — my own attempt to link them is the retraction quoted in Context. It may be a contributor; it is not shown to be, and this ticket does not claim it.
  • #18201's Card#loadingModules dedup, and whether it should be identity-scoped. Untouched.
  • Changing the resolvePane contract. Config-or-instance stays legal; that flexibility is the point of the hook. The recovery is what must stop depending on the instance case.
  • The other unstable dock arms (#18215, #18348).

Avoided Traps

  • Filing this as #18275's cause. Same subsystem, same "a pane exists twice" shape, and I already published one over-link on that ticket and retracted it. Shape is not identity.
  • Arming it through the flaky path. The witness that drove a real projection to failure by injecting a flight rejection is scheduler-dependent — 1/12 then 9/12 on unchanged code. A contract defect gets a contract arm; a load-dependent one would let a green run mean nothing, which is the arm-that-cannot-witness-its-property failure.
  • Inventing a salvage channel. The first design added a salvagedItems seed to reconcileTabChrome. returningTearOutPanes already is that channel, with a working consumer. Ask whether the engine already solved it.
  • Fixing it by destroying the staged shell. That is the obvious one-line "fix" and it is wrong: it takes the consumer's live panes with it, which is the exact outcome the detach exists to prevent.
  • Widening liveItems to walk detached shells. Merging a retired shell into currentTabs would feed prepareTabChromeProjection chrome from a shell that is no longer in the host, making the projection try to retain it.

Decision Record impact

none. No ADR is engaged. ai/ and Agent OS surfaces are untouched, so the §1c structure-map gate records N/A. No new .mjs file is introduced, so structural pre-flight does not fire.

Related

  • #18275 — the ticket this was found under; Refs only, boundary stated above.
  • #18039 — the same blindness class (collectProjectedTabs(oldShell) missing state held elsewhere), fixed one function away.
  • #18318 — Workspace's unstated façade contract. This is the dual: a contract that is stated, and is false.
  • #18297 — closed; a retired tab button poisoning the host vnode. Adjacent recovery-path defect, different mechanism.
  • #18201 / #18084 — the lazy-load callers #18275 tracks. Untouched here.

Retrieval Hint: settleFailedProjection detaches a staged shell whose panes the repair pass cannot resolve by identity — liveItems is seeded only from the surviving shell, and the default resolvePane returns a config