Repository navigation
Layout-owner build: main answers terminal questions from its own layout (A1, dark) - #31187
Conversation
…efuses a taken one
… starts them, window or none (dark; twin e)
… starts them, window or none (dark; twin e)
…nt fails to start; no window takes over (dark)
…ne; a terminal close stands after a failed write (dark)
…te; switch off still refuses
…abs start once; a tab's last pane keeps its card (dark)
…l; main starts it whatever failed
…so a closed tab stays closed (dark)
…ives (both builds)
… reads a shared import (dark)
…ts old terminal (dark)
…back a closed pane by design
…build, and main's switch-on proofs
…g live; remote host answers pass through (dark)
…e copy's last pane; the window's terminal claim is not consulted (L127, dark)
…terminals; a starting pane is never exited on the inventory alone; terminal.list lists every saved pane main owns; the pane claim lookup leaves the output path (dark)
…ayout switch on An exited pane closes through the legacy retirement unless the keep rule holds; the default tab's title and color still reach the window and the phone's live tabs.
…vouched -1 Main's taken and closed-id guard now runs where every pane write goes, so a runtime create replayed after its tab closed is refused before it spawns. An exit code nothing vouches for keeps the pane, as the window does; a kept pane sends the phone no retirement. Converts the switch-on tests that asserted the deleted window hand-off and title bridge.
… checks on client commands A paired host starts each pane of a client's tab as a create under the tab's id, so a held tab id is refused only for a client's own layout command.
Only a requested stop or a host-confirmed death closes a pane on a negative exit code. Pins that the closed-tab guard never fires in the shipped build.
…itions hold, the fence reads ownership once, a legacy pane keeps its claim; switch-on tests assert main's answers after a window closes (dark)
…ged to its own module, for the file's line cap
… does, re-reading routing only on a write or a terminal registration; a worktree stop names every terminal main binds; a starting pane is unverifiable (dark)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: 🔵 Low · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
100e303d-91ba-4686-ab0f-ca665007eea4
📒 Files selected for processing: 114
config/scripts/check-id-only-store-write-ratchet.mjsconfig/scripts/check-id-only-store-write-ratchet.test.mjssrc/main/ipc/pty/provider/bind-listeners.tssrc/main/ipc/pty/provider/local-configure.tssrc/main/persistence/loading-store/store-domain-composition.tssrc/main/persistence/loading-store/terminal-close-async-durability.test.tssrc/main/persistence/terminal-topology/layout-command-persistence.tssrc/main/persistence/terminal-topology/terminal-close-write-failure-store.test.tssrc/main/persistence/terminal-topology/terminal-close-write-failure-switch-off.test.tssrc/main/persistence/terminal-topology/terminal-close-write-failure.test.tssrc/main/persistence/terminal-topology/terminal-close-write-failure.tssrc/main/persistence/terminal-topology/terminal-layout-create-resend.test.tssrc/main/persistence/terminal-topology/terminal-layout-create.test.tssrc/main/persistence/terminal-topology/terminal-pane-admission-taken-ids-switch-off.test.tssrc/main/persistence/terminal-topology/terminal-pane-admission-taken-ids.test.tssrc/main/persistence/terminal-topology/terminal-pane-admission.tssrc/main/persistence/terminal-topology/terminal-window-pane-detach.test.tssrc/main/persistence/terminal-topology/window-pane-detach.tssrc/main/runtime/construction/runtime-service-state.tssrc/main/runtime/exited-split-pane-layout-close.test.tssrc/main/runtime/exited-split-pane-layout-close.tssrc/main/runtime/orca-runtime-cold-restore-terminal-membership-layout-owner.test.tssrc/main/runtime/orca-runtime-create-terminal-dependencies.tssrc/main/runtime/orca-runtime-default-tab-agent-status.test.tssrc/main/runtime/orca-runtime-default-tabs-layout-owner.test.tssrc/main/runtime/orca-runtime-exited-split-pane-close.test.tssrc/main/runtime/orca-runtime-failed-start-pane-layout-owner.test.tssrc/main/runtime/orca-runtime-layout-owner-start-fixture.tssrc/main/runtime/orca-runtime-terminal-create-replay-after-close.test.tssrc/main/runtime/orca-runtime-tests/mobile-session-tabs-part-03.spec.tssrc/main/runtime/orca-runtime-tests/mobile-session-tabs-part-06.spec.tssrc/main/runtime/orca-runtime-tests/window-authority.spec.tssrc/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.tssrc/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-04.spec.tssrc/main/runtime/orca-runtime-tests/worktree-setup-single-creator.spec.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/orchestration/terminal-authority/write-orchestration-pointer-pty.tssrc/main/runtime/pane-start-statuses.test.tssrc/main/runtime/pane-start-statuses.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-observation-layout-owner.test.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-observation.tssrc/main/runtime/runtime-folder-worktree-create-layout-owner.test.tssrc/main/runtime/runtime-folder-worktree-create.tssrc/main/runtime/runtime-layout-apply.test.tssrc/main/runtime/runtime-layout-apply.tssrc/main/runtime/runtime-leaf-record-projection.tssrc/main/runtime/runtime-local-worktree-terminal-startup-layout-owner.test.tssrc/main/runtime/runtime-local-worktree-terminal-startup.test.tssrc/main/runtime/runtime-local-worktree-terminal-startup.tssrc/main/runtime/runtime-pane-admission.tssrc/main/runtime/runtime-terminal-contracts.tssrc/main/runtime/runtime-terminal-list.tssrc/main/runtime/runtime-worktree-default-tabs-layout-owner.test.tssrc/main/runtime/runtime-worktree-terminal-provisioning.tssrc/main/runtime/session-graph/session-graph-authority.tssrc/main/runtime/session-graph/session-graph-reload-lifecycle.tssrc/main/runtime/session-graph/session-window-graph.tssrc/main/runtime/session-lifecycle/close/close-by-split-handle-layout-owner.test.tssrc/main/runtime/session-tabs/explicit-terminal-close-pty-stops.tssrc/main/runtime/session-tabs/explicit-terminal-close-stops.tssrc/main/runtime/session-tabs/main-handle-close.tssrc/main/runtime/session-tabs/mobile-session-membership.tssrc/main/runtime/session-tabs/session-tabs-inventory.tssrc/main/runtime/session-tabs/terminal-surface-retirements.tssrc/main/runtime/terminal-intentional-stop-exit.test.tssrc/main/runtime/terminal/identity/pty-worktree-record.tssrc/main/runtime/terminal/launch/failed-start-pane.tssrc/main/runtime/terminal/launch/mobile-terminal-create.tssrc/main/runtime/terminal/launch/terminal-create.tssrc/main/runtime/terminal/lifecycle/exited-split-pane-rule.test.tssrc/main/runtime/terminal/lifecycle/exited-split-pane-rule.tssrc/main/runtime/terminal/lifecycle/pty-exit-lifecycle.tssrc/main/runtime/terminal/lifecycle/pty-registration.tssrc/main/runtime/terminal/stop/worktree-pty-collection.tssrc/main/runtime/terminal/stop/worktree-terminal-stop.tssrc/main/runtime/terminal/surface/__fixtures__/terminal-surface-replies-desktop.jsonsrc/main/runtime/terminal/surface/__fixtures__/terminal-surface-replies-headless.jsonsrc/main/runtime/terminal/surface/main-pane-verdict.test.tssrc/main/runtime/terminal/surface/main-pane-verdict.tssrc/main/runtime/terminal/surface/main-terminal-surfaces.tssrc/main/runtime/terminal/surface/terminal-surface-index.tssrc/main/runtime/terminal/surface/terminal-surface-replies-main.test.tssrc/main/runtime/terminal/surface/terminal-surface-replies-window.test.tssrc/main/runtime/terminal/surface/terminal-surface-replies.test-fixture.tssrc/main/runtime/terminal/surface/terminal-surface-verdict-main.test.tssrc/main/runtime/terminal/view/layout-owner-close-relisting.tssrc/main/runtime/terminal/view/mobile-terminal-surface.tssrc/main/runtime/workspace-layout-stream.tssrc/main/runtime/workspaces/startup/workspace-terminal-provisioning.tssrc/renderer/src/components/terminal-pane/layout-owner-pane-close-command.tssrc/renderer/src/components/terminal-pane/pending-pane-close-confirmation.test.tssrc/renderer/src/components/terminal-pane/pending-split-close-test-fixture.tssrc/renderer/src/components/terminal-pane/pending-split-close.test.tssrc/renderer/src/components/terminal-pane/pty-connection/exited-split-pane-close.test.tssrc/renderer/src/components/terminal-pane/pty-connection/exited-split-pane-close.tssrc/renderer/src/components/terminal-pane/pty-connection/pty-exit-hibernate.tssrc/renderer/src/runtime/layout-apply-send.tssrc/renderer/src/runtime/sync-runtime-graph-automation-leaf.test.tssrc/renderer/src/runtime/sync-runtime-graph-main-listed-panes.test.tssrc/renderer/src/runtime/sync-runtime-graph-parked-leaf.test.tssrc/renderer/src/runtime/sync-runtime-graph/graph-publication.tssrc/renderer/src/runtime/sync-runtime-graph/main-owned-terminal-list.tssrc/renderer/src/store/terminals/terminal-tab-close-intent.test.tssrc/shared/rpc-contract/workspace-layout-params.tssrc/shared/rpc-contract/workspace-layout-terminal-tab-params.tssrc/shared/runtime-session-contracts.tssrc/shared/runtime-terminal-contracts.tssrc/shared/runtime-types.tssrc/shared/workspace-layout/workspace-layout-command-types.tssrc/shared/workspace-layout/workspace-layout-commands.tssrc/shared/workspace-layout/workspace-layout-default-tabs.test.tssrc/shared/workspace-layout/workspace-layout-default-tabs.tssrc/shared/workspace-layout/workspace-layout-published.tssrc/shared/workspace-layout/workspace-layout-records.ts
💤 Files with no reviewable changes: 3
- src/main/runtime/runtime-layout-apply.test.ts
- src/main/runtime/terminal/view/layout-owner-close-relisting.ts
- src/main/runtime/terminal/view/mobile-terminal-surface.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
| if ( | ||
| !pane.leafId || | ||
| runtimeEnvironmentIdUnlessTwin(useAppStore.getState(), pane.worktreeId) !== null | ||
| ) { |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
rg -n 'export function runtimeEnvironmentIdUnlessTwin' -A 30 src/renderer
sed -n '1,70p' src/renderer/src/runtime/sync-runtime-graph/main-owned-terminal-list.ts
sed -n '1,30p' src/renderer/src/components/terminal-pane/pty-connection/exited-split-pane-close.ts
sed -n '340,380p' src/renderer/src/components/terminal-pane/pty-connection/pty-exit-hibernate.tsRepository: stablyai/orca
Length of output: 7530
🏁 Script executed:
set -e
printf '%s\n' '--- retirement logic ---'
rg -n -F --glob '*.ts' -e 'terminal-surface-retirements' -e 'runtime:' -e 'mainListsWorkspaceTerminals' -e 'expectExitedSplitPaneClose' src/renderer/src src/main 2>/dev/null || true
printf '%s\n' '--- retirement file candidates ---'
rg --files | rg 'terminal-surface-retirements|pty-exit-hibernate|resolve-owner|runtime.*graph|terminal-surface'
printf '%s\n' '--- owner resolution declarations and state fields ---'
rg -n -F --glob '*.ts' -e 'runtimeEnvironmentIdForWorkspaceOwner' -e 'kind: .resolved' -e 'kind: .unresolved' -e 'ownerHydrat' -e 'hydrated' src/renderer/src | head -240
printf '%s\n' '--- relevant tests ---'
rg -n -F --glob '*.{ts,tsx}' -e 'expectExitedSplitPaneClose' -e 'unclear owner' -e 'unresolved' -e 'runtime:' -e 'PTY exit' src/renderer/src | head -300Repository: stablyai/orca
Length of output: 45667
🏁 Script executed:
set -e
printf '%s\n' '--- exact files ---'
find src -type f \( -name '*terminal-surface-retirements*' -o -name '*pty-exit-hibernate*' \) -print
printf '%s\n' '--- retirement references ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -- 'terminal-surface-retirements' src || true
rg -n -F --glob '*.ts' --glob '*.tsx' -- 'partition' src/renderer/src/runtime src/renderer/src/main 2>/dev/null | rg 'terminal|retire|surface|runtime:' | head -100 || true
printf '%s\n' '--- owner resolver and unresolved-state tests ---'
rg -n -F --glob '*.ts' -- 'function runtimeEnvironmentIdForWorkspaceOwner' src/renderer/src/lib/resolve-owner.ts
rg -n -F --glob '*.{ts,tsx}' -e 'owner.kind === .unresolved.' -e 'kind: .unresolved.' -e 'runtimeEnvironmentIdUnlessTwin' -e 'owner hydration' -e 'hydration' src/renderer/src/lib src/renderer/src/runtime src/renderer/src/components/terminal-pane | head -220
printf '%s\n' '--- exit-close tests and lifecycle callers ---'
rg -n -F --glob '*.{ts,tsx}' -e 'expectExitedSplitPaneClose' -e 'onPtyExitRef' -e 'pty-exit-hibernate' src/renderer/src | head -180Repository: stablyai/orca
Length of output: 38982
🏁 Script executed:
set -e
printf '%s\n' '--- main retirement implementation ---'
nl -ba src/main/runtime/session-tabs/terminal-surface-retirements.ts | sed -n '1,260p'
printf '%s\n' '--- owner resolver ---'
nl -ba src/renderer/src/lib/resolve-owner.ts | sed -n '150,235p'
printf '%s\n' '--- owner-resolution tests around unresolved/pre-hydration cases ---'
nl -ba src/renderer/src/lib/workspace-terminal-host-authority.test.ts | sed -n '260,335p'
nl -ba src/renderer/src/lib/resolve-owner.test.ts | sed -n '350,390p'
printf '%s\n' '--- exit helper tests ---'
nl -ba src/renderer/src/components/terminal-pane/pty-connection/exited-split-pane-close.test.ts | sed -n '1,120p'
printf '%s\n' '--- PTY exit control flow ---'
nl -ba src/renderer/src/components/terminal-pane/pty-connection/pty-exit-hibernate.ts | sed -n '300,380p'Repository: stablyai/orca
Length of output: 24874
🏁 Script executed:
set -e
printf '%s\n' '--- owner resolution and ambiguity construction ---'
nl -ba src/renderer/src/lib/resolve-owner.ts | sed -n '1,155p'
rg -n -F --glob '*.ts' --glob '*.tsx' -e "kind: 'ambiguous'" -e "owner.kind === 'ambiguous'" -e 'resolveOwner(' src/renderer/src/lib/resolve-owner.ts src/renderer/src/lib/*test.ts | head -160
printf '%s\n' '--- exit rule ---'
nl -ba src/main/runtime/exited-split-pane-layout-close.ts | sed -n '1,220p'
nl -ba src/main/runtime/terminal/lifecycle/exited-split-pane-rule.ts | sed -n '1,220p'
printf '%s\n' '--- retirement caller and frame publication ---'
rg -n -F --glob '*.ts' -e 'retireMobileSessionSurfacesForPty' -e 'stageTerminalSurfaceRetirements' -e 'keepsExitedPane' src/main | head -160Repository: stablyai/orca
Length of output: 16604
🏁 Script executed:
set -e
printf '%s\n' '--- PTY ownership acceptance ---'
nl -ba src/renderer/src/lib/terminal-pty-owner-acceptance.ts | sed -n '1,220p'
nl -ba src/renderer/src/lib/terminal-pty-owner-acceptance.test.ts | sed -n '1,125p'
printf '%s\n' '--- PTY bind/exit ownership callers ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -e 'resolveTerminalPtyOwner' -e 'terminalPtyOwner' -e 'ownerAcceptance' -e 'isTwinWorkspace' src/renderer/src/components/terminal-pane src/renderer/src/lib | head -180
printf '%s\n' '--- main PTY exit lifecycle around retirement ---'
nl -ba src/main/runtime/terminal/lifecycle/pty-exit-lifecycle.ts | sed -n '220,290p'Repository: stablyai/orca
Length of output: 12996
🏁 Script executed:
set -e
printf '%s\n' '--- terminal owner resolver and route guards ---'
nl -ba src/renderer/src/lib/terminal-worktree-route.ts | sed -n '120,190p'
rg -n -F --glob '*.ts' --glob '*.tsx' -e 'resolveTerminalPtyOwner(' -e 'resolveTerminalHostOwnership(' -e 'owner changes' -e 'ownership changes' -e 'ambiguous.*exit' -e 'exit.*ambiguous' -e 'twin.*pty' -e 'pty.*twin' src/renderer/src | head -220
printf '%s\n' '--- workspace owner state transitions relevant to hydration ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -e 'runtimeEnvironmentCatalogHydrated' -e 'worktreesByRepo' -e 'folderWorkspaces' src/renderer/src/store src/renderer/src/lib | head -220
printf '%s\n' '--- PTY connect path ---'
rg -n -F --glob '*.ts' --glob '*.tsx' -e 'connectPanePty' -e 'runtimeEnvironmentId' src/renderer/src/components/terminal-pane/pty-connection | head -160Repository: stablyai/orca
Length of output: 41846
🏁 Script executed:
set -e
printf '%s\n' '--- teardown behavior for owner changes ---'
nl -ba src/renderer/src/lib/terminal-worktree-route.test.ts | sed -n '70,115p'
nl -ba src/renderer/src/components/dashboard/dashboard-card-terminal-input.test.ts | sed -n '170,215p'
printf '%s\n' '--- terminal retirement ownership decisions ---'
nl -ba src/renderer/src/store/slices/terminal-tab-retirement.ts | sed -n '45,90p'
nl -ba src/renderer/src/store/slices/terminal-tab-retirement.ts | sed -n '195,235p'
printf '%s\n' '--- close admission ownership transition tests ---'
nl -ba src/renderer/src/components/terminal-pane/terminal-pane-close-admission.ts | sed -n '1,85p'
rg -n -F --glob '*.test.ts' --glob '*.test.tsx' -e 'live.*owner changes' -e 'owner changes.*live' -e 'twin' src/renderer/src/components/terminal-pane src/renderer/src/store | head -100Repository: stablyai/orca
Length of output: 26524
Use the graph publication ownership rule for exit handling.
runtimeEnvironmentIdUnlessTwin returns null for an ambiguous owner, but mainListsWorkspaceTerminals returns false. The exit helper therefore records an 'exit' intent and skips the renderer close when ownership is ambiguous.
Use mainListsWorkspaceTerminals for this check. This keeps ambiguous ownership with the window, as the graph publication does.
🐛 Suggested fix
-import { runtimeEnvironmentIdUnlessTwin } from '@/lib/resolve-owner'
+import { mainListsWorkspaceTerminals } from '@/runtime/sync-runtime-graph/main-owned-terminal-list'
import { expectPaneToClose } from '@/runtime/layout-owner-pane-intents'
import { useAppStore } from '@/store'
@@
- if (
- !pane.leafId ||
- runtimeEnvironmentIdUnlessTwin(useAppStore.getState(), pane.worktreeId) !== null
- ) {
+ if (!pane.leafId || !mainListsWorkspaceTerminals(useAppStore.getState(), pane.worktreeId)) {
return false
}…ng live; a resuming pane is unverifiable like a starting one (dark)
Main's layout-owner groundwork (#31130, #31171, #31187, dark) and the binding fast lane (#31033) touched the same files. Binding retirement keeps this branch's incarnation fence and uses main's dirty marking; a failed start keeps its pane for main's keep-on-failure starts and for owner contention; the fresh launch path takes main's pane start status arguments.
ELI5
In the new layout build (still switched off in every shipped build), Orca's main process holds the one copy of every workspace's tabs and panes. Until now it still answered questions about terminals ("which terminals exist?", "close this one") from a list the window sent it. This PR makes main answer from its own copy, so the answers are right even when no window is open or when the window has not drawn a pane yet.
What Changed
All behaviour changes are behind the
ORCA_LAYOUT_OWNERbuild switch, which is off in shipped builds. With the switch off, every reply is byte-identical (see Testing).With the switch on, for workspaces main owns (local and SSH; paired-server
runtime:workspaces are still mirrored from the window as before):mountedLeaves: which panes are mounted, their on-screen id and title).terminal close/ close tab from the CLI or a phone) closes the pane in main's layout, records the close and stops the terminals it ends. Before, main asked the window to re-list panes at close time; that relist (layout-owner-close-relisting.tsand its branch inresolvePtyTabCloseSurfaceAuthority) is deleted.terminal.listlists every saved pane of a workspace main owns, including a pane whose terminal has not started, even when the workspace has other live terminals. Before, such a pane was hidden while its workspace had a live terminal.verdictfield on eachterminal.listrow (live/unverifiable/exited, the existing liveness words).connectedkeeps its old meaning for older readers. A pane with a status (a start in flight or failed, or a sleeping agent) is reportedconnected: falseand is neverlive.exitedneeds the host's own answer (its inventory, or an exit the host reported); losing contact isunverifiable. Orca's worker observation now readsverdictinstead of treatingconnected: falseas exited. CLI text output is unchanged.Why
Main is now the only writer of the layout (D1a), but it still trusted the window's view of terminals. That view lags (a pane split by the CLI before any window draws it, a window that closed, a respawn), which is why the close-time relist and the window's terminal override existed. Answering from main's own copy removes those patches instead of adding more. Alternatives considered: keeping the window's list and widening the relist (more round trips, still wrong with no window), or a second index of panes kept in main (a second copy that can drift); this PR reads the one projection main already publishes (E1's
readPartitionandonLayoutOperationCommitted).Not in this PR (by plan): the full deletion of the terminal record's tab/pane copies and their freshness stamp (L80) and main-side adoption of live terminals (L113) are A1b, stacked on this PR. L31 and L58 are untouched (annotated in the ledger).
Linked Issue
Part of the terminal layout final design (A1). No separate issue.
Visual Proof
N/A: no UI change in shipped builds (the switch is off); with the switch on the window draws the same panes. Behaviour is proven by the reply tests below.
Testing
Reply shapes:
terminal-surface-replies-window.test.tsrecords the CLI / paired-desktop / orcad replies (list, show, status) from today's window-owned build;terminal-surface-replies-main.test.tsproves the switch-on build gives the same bytes (with the new optionalverdictignored, and asserted separately).Switch-on proofs: listing saved panes with no window and after the window closes; a split made before any window shows it; close tab / close one pane by handle with no session row from the window; close a tab by a starting pane's handle stops the tab's other terminals; a stale pane claim is overridden; every pane status (starting, failed, sleeping) never lists live; a remote host's exited / unverifiable / live answers pass through; the drag-out cases above.
Converted (not dropped) switch-on tests:
sync-runtime-graph-parked-leaf,sync-runtime-graph-automation-leaf,close-by-split-handle-layout-owner, the cold-restore membership table (runs in both builds), and the two drag-out tests interminal-window-pane-detach.test.ts.Pure move:
stopExplicitlyClosedTabPtysmoved unchanged toexplicit-terminal-close-pty-stops.ts(its own commit) to keepexplicit-terminal-close-stops.tsunder the line cap.Pure move: a worktree stop's terminal collection moved unchanged to
terminal/stop/worktree-pty-collection.ts(its own commit) to keepworktree-terminal-stop.tsunder the line cap; the switch-on call sites then add main's bound terminals.Gates: ci-static-gate (every static step of pr.yml) passes. Switch-off: the related unit set (603 files) passes except two folder-import tests in
orca-runtime.test.tsthat fail the same way on the D1a base. Switch-onsrc/main/runtime+src/main/persistencein clean worktrees, D1a head 6b8c37f vs this head: 25 failing tests at both, the same 25; no test fails only at this head. Tests converted for this:window-authority.spec.ts(main keeps answering after the window closes),mobile-session-tabs-part-03.spec.ts(a create after the window closes starts in main and sends nothing to the closed window),mobile-session-tabs-part-06.spec.ts(session reads stay per sync, not per workspace),orca-runtime-terminal-retirement-host-partition.spec.ts(the right pane's terminal registers as the window's attach registers it).Latency (oracle latency spec, 40 samples x 3 runs per build, hidden windows, in-app drawn p95, switch on minus off): split +2/+0/+3 ms, rename +4/+5/+2 ms, new tab -30/-70/-42 ms (idle/output flood/title flood). Rename under output flood is AT THE LIMIT (+5 ms); it is re-measured at A2. Against D1a's own on-vs-off runs, A1 adds no measurable cost; close pane p95 is noisy in both builds (off 76-132 ms).
Switch-off bundle (unminified main and renderer, D1a head vs this head): the renderer is identical apart from chunk hashes. Main differs only by code the switch-off build does not reach or that gives the same result:
terminal/surface/*,pane-start-statusesbindingOf, theprojectRuntimeSurfacessplit); the only code they run at load is oneWeakMapconstruction;withMainSurfacesexists on the runtime class but is only called behind the switch;graph = graph(the folded switch point insyncWindowGraph) and&& truein the terminal list skip (folded switch);hostIdand pane count, and look up the home holder; the switch-off choice of terminal and refusals are unchanged;Platforms: macOS locally (unit, e2e latency with hidden windows). SSH covered by unit tests of the two-partition and remote-verdict cases.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
verdictfield is optional and emitted only with the switch on; old CLIs, paired desktops and orcad ignore it.mountedLeavestravels window to main only.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)