diff --git a/config/flaky-test-pattern-baseline.txt b/config/flaky-test-pattern-baseline.txt index e5529f42df0..6af959f41e0 100644 --- a/config/flaky-test-pattern-baseline.txt +++ b/config/flaky-test-pattern-baseline.txt @@ -717,7 +717,6 @@ 1 test-no-wall-clock:src/renderer/src/components/sidebar/workspace-card/surface/WorktreeCard.single-reference-details.test.tsx 1 test-no-wall-clock:src/renderer/src/components/sidebar/worktree-list/listing/WorktreeList.lineage-agent-expansion-coupling.test.tsx 2 test-no-wall-clock:src/renderer/src/components/task-page/jira/task-page-jira-cache-selectors.test.ts -1 test-no-wall-clock:src/renderer/src/components/terminal-pane/titles/cache-timer-seeding.test.ts 2 test-no-wall-clock:src/renderer/src/components/terminal-pane/pty-connection/emulation/fish-color-scheme-child-stdin.node-pty.test.ts 2 test-no-wall-clock:src/renderer/src/components/terminal-pane/snapshots/remote-snapshot-alt-screen-host-chain.test.ts 1 test-no-wall-clock:src/renderer/src/components/terminal/initial-terminal-structured-launch.test.tsx diff --git a/config/reliability-gates.jsonc b/config/reliability-gates.jsonc index 06f2ab1a7db..ddef38e51c4 100644 --- a/config/reliability-gates.jsonc +++ b/config/reliability-gates.jsonc @@ -4089,7 +4089,8 @@ "Audit2020: Retire CLI supervisor outcome, local-open promotion and paired-open projection alarms; launch retains only the two referenced stream-framing cases. Remaining CLI refusal/timeout cases do not replace headless-promotion coverage. Preserve both independent dated receipts at their original commands. Reduced selectors have no fresh result or equivalent replacement claim.", "Audit2020 historical original assertionRefs object, preserved verbatim; retired objects are not active evidence:\n{\n \"file\": \"src/cli/runtime/launch.test.ts\",\n \"assertions\": [\n \"waits past startup status lines for valid recipe JSON\",\n \"preserves UTF-8 recipe JSON split across Buffer chunks\",\n \"rejects when the server exits without valid recipe JSON\",\n \"accepts valid recipe JSON at exit without a trailing newline\"\n ]\n }", "Audit2020 historical original assertionRefs object, preserved verbatim; retired objects are not active evidence:\n{\n \"file\": \"src/cli/runtime-client.test.ts\",\n \"assertions\": [\n \"local open activates a reachable headless owner and waits for a desktop window\",\n \"unsafe promotion returns an explicit blocked error instead of launching a second owner\"\n ]\n }", - "Audit2020 historical original assertionRefs object, preserved verbatim; retired objects are not active evidence:\n{\n \"file\": \"src/cli/runtime/websocket-transport.test.ts\",\n \"assertions\": [\n \"remote-paired open reports remote desktop state without launching a local app\"\n ]\n }" + "Audit2020 historical original assertionRefs object, preserved verbatim; retired objects are not active evidence:\n{\n \"file\": \"src/cli/runtime/websocket-transport.test.ts\",\n \"assertions\": [\n \"remote-paired open reports remote desktop state without launching a local app\"\n ]\n }", + "Audit2052 (source2049): The ordinary orca-runtime.test.ts registrar drops seven imports of deliberately deleted low-value runtime suites. Their mock capability/agent-presence/environment/title/deduplication and batching alarms are intentionally lost without replacement; remaining imports retain their original order. The runtime handle-contract registrar separately drops the deleted tab-collision registration. Unrelated dated evidenceRuns remain unchanged and do not validate reduced-source bytes or selectors. No fresh gate execution or historical import-closure equivalence is claimed." ], "demotionRule": "Quarantine the Electron journey only with a linked product or harness defect; demote if activation changes the owner/runtime/daemon/PTY identity, loses prior output, opens before provider readiness, or fails to honor a committed quit." }, @@ -4245,7 +4246,8 @@ "Retired during audit1312 aggregate-driver import cleanup; original complete execution receipt (unchanged): {\"date\":\"2026-08-14\",\"runner\":\"local\",\"platform\":\"macos\",\"command\":\"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/runtime-graph-reload-lifecycle.test.ts src/main/window/runtime-renderer-notification-sender.test.ts src/main/window/renderer-document-navigation.test.ts src/main/ipc/runtime.test.ts src/main/window/attach-main-window-services.test.ts src/main/runtime/orca-runtime.test.ts src/renderer/src/runtime/sync-runtime-graph-scheduling.test.ts src/renderer/src/runtime/sync-runtime-graph-payload-partition.test.ts\",\"result\":\"passed\",\"durationSeconds\":12,\"summary\":\"Eight focused files passed with 1,175 tests and one pre-existing skip after the merge from latest main. The suite covers exact reload settlement, timeout replacement, cancelled-navigation recovery, concurrent provisional starts, document and window authority, notification containment, preload IPC, and renderer publication scheduling.\",\"currentCommand\":\"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/runtime-graph-reload-lifecycle.test.ts src/main/window/runtime-renderer-notification-sender.test.ts src/main/window/renderer-document-navigation.test.ts src/main/ipc/runtime.test.ts src/main/window/attach-main-window-services.test.ts src/main/runtime/orca-runtime.test.ts src/renderer/src/runtime/sync-runtime-graph-scheduling.test.ts src/renderer/src/runtime/sync-runtime-graph-payload-partition.test.ts\"}", "Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed.", "Audit1400: src/renderer/src/runtime/sync-runtime-graph-scheduling.test.ts removed. Removes whole coalescing call-count suite; no newest-state delivery or replacement claim. No equivalent replacement coverage is claimed. Historical removed assertion inventory: []", - "Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Historical removed assertion inventory: [{\"file\":\"src/main/runtime/orca-runtime.test.ts\",\"assertions\":[\"only the newest reload owns the terminal timeout\",\"a superseded renderer-document generation cannot settle a reload\",\"cancelled navigation restores only the renderer or headless authority that actually survived\",\"cancellation after an earlier document commit stays fenced until its restarted timeout\",\"failed headless promotion remains pinned to its originating window\",\"successful desktop publication retires headless fallback\"]}]" + "Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Historical removed assertion inventory: [{\"file\":\"src/main/runtime/orca-runtime.test.ts\",\"assertions\":[\"only the newest reload owns the terminal timeout\",\"a superseded renderer-document generation cannot settle a reload\",\"cancelled navigation restores only the renderer or headless authority that actually survived\",\"cancellation after an earlier document commit stays fenced until its restarted timeout\",\"failed headless promotion remains pinned to its originating window\",\"successful desktop publication retires headless fallback\"]}]", + "Audit2052 (source2049): The ordinary orca-runtime.test.ts registrar drops seven imports of deliberately deleted low-value runtime suites. Their mock capability/agent-presence/environment/title/deduplication and batching alarms are intentionally lost without replacement; remaining imports retain their original order. The runtime handle-contract registrar separately drops the deleted tab-collision registration. Unrelated dated evidenceRuns remain unchanged and do not validate reduced-source bytes or selectors. No fresh gate execution or historical import-closure equivalence is claimed." ], "demotionRule": "Demote if a reload revision settles more than once, a stale document or competing window can publish, a timer survives settlement, desktop failure stays indefinitely reloading, headless fallback returns after successful promotion, or either isolated Electron journey loses runtime or PTY identity." }, @@ -5078,7 +5080,8 @@ "Audit2043: Remove the registration-wait, webview-security, preview-authorization, guest-lifecycle and grant-IPC unit suites and the sibling-directory assertion reference. Runtime and browser capability consumers also lose removed imported examples. Remaining document-policy, file-reader and grant-registry assertions do not replace those alarms. Preserve the 27 independent dated receipts at their original unchanged selectors; reduced prospective unit selectors have no fresh result or equivalent replacement claim.", "Audit2043 historical original assertionRefs object, preserved verbatim; retired objects are not active evidence:\n{\n \"file\": \"src/main/browser/document-preview/doc-preview-grant-registry.test.ts\",\n \"assertions\": [\n \"keeps silent authority over a document directory strictly inside the workspace, and only there\",\n \"authorizes only the requested sibling directory\",\n \"uses Windows semantics when authorizing a sibling directory\",\n \"keeps an approved SSH directory inside the canonical workspace boundary\"\n ]\n }", "Audit2043 historical original assertionRefs object, preserved verbatim; retired objects are not active evidence:\n{\n \"file\": \"src/main/window/main-window-webview-security.test.ts\",\n \"assertions\": [\n \"an orca-preview src is admitted only on the preview partition with a live grant\",\n \"preview guests receive their own policy instead of the browser guest policies\",\n \"a preview attach is pinned to the preview preload over any renderer-supplied value, and a browsing attach never receives it\",\n \"grants a renderer can no longer release are cleared at window creation and on reload, and survive an in-document navigation\"\n ]\n }", - "Audit2043 historical original assertionRefs object, preserved verbatim; retired objects are not active evidence:\n{\n \"file\": \"src/main/ipc/doc-preview-grant-ipc.test.ts\",\n \"assertions\": [\n \"a sender that is not the trusted renderer mints no grant and revokes none\",\n \"a reported link click reaches the guest policy with its own sender, and a non-string report reaches nothing\"\n ]\n }" + "Audit2043 historical original assertionRefs object, preserved verbatim; retired objects are not active evidence:\n{\n \"file\": \"src/main/ipc/doc-preview-grant-ipc.test.ts\",\n \"assertions\": [\n \"a sender that is not the trusted renderer mints no grant and revokes none\",\n \"a reported link click reaches the guest policy with its own sender, and a non-string report reaches nothing\"\n ]\n }", + "Audit2052 (source2049): The ordinary orca-runtime.test.ts registrar drops seven imports of deliberately deleted low-value runtime suites. Their mock capability/agent-presence/environment/title/deduplication and batching alarms are intentionally lost without replacement; remaining imports retain their original order. The runtime handle-contract registrar separately drops the deleted tab-collision registration. Unrelated dated evidenceRuns remain unchanged and do not validate reduced-source bytes or selectors. No fresh gate execution or historical import-closure equivalence is claimed." ], "demotionRule": "Demote if a paired HTML preview creates a browser workspace on either side, renders from anything other than the orca-preview scheme, serves a read the host reported as truncated or over-cap, serves a document without the self-only content security policy, lets the preview session carry an off-machine request, reads an SSH path that canonicalizes outside its grant root, steals focus from the source editor when it opens, removes unrelated editor or terminal state on close, hides a document that rendered because one subresource was refused, leaves a grant readable after the tab or renderer that owns it is gone, mints one for a sender that is not the trusted renderer, opens a browser tab for a navigation the document started with no one at the keyboard, or lets the guest gather an ICE candidate; or if a paired browser creation this gate still owns produces duplicate client or host identities or loses its requested split." }, @@ -6257,7 +6260,8 @@ "Audit1412: src/main/daemon/terminal-host-concurrent-create.test.ts reduced. Loses race deduplication, attach during unsettled ownership proof, retry after failed spawn, distinct-session parallelism, disposal waiting and shutdown retry-fencing alarms bundled with removed internal-call counts or real-time waits. No replacement-equivalence claim. src/main/daemon/terminal-checkpoint-serializer.test.ts reduced. Loses bounded native conversion/no-whole-candidate materialization and snapshot getter single-read alarms. Retained byte-size outcomes do not establish CPU/allocation bounds. No equivalent replacement coverage is claimed. Historical removed assertion inventory: []", "Audit1417 intentionally deletes src/renderer/src/components/terminal-pane/pty-connection-hidden-tui-snapshot-replay.spec.ts: Loses rich hidden snapshot sequence replay/grid resize and forced repaint after hidden snapshot alarms, including live-trigger deduplication. No equivalent replacement coverage or fresh result is claimed.", "Audit1878 removes only the direct over-cap abandonment example from terminal-partial-escape-tail.test.ts. The unchanged fixed-sequence split/fold sweep is retained; it is not an independent parser oracle or a new execution of the historical 25.6M-case sweep. Its current seventeen sequences do not substantiate the full alphabet inventory described by the older assertion reference. No equivalent replacement coverage or fresh whole-gate execution is claimed.", - "Audit1931 (sources1928/1929): Partial mobile-presence suite retains only five authored callbacks: admitted preview-paste completion across phone takeover, desktop take-back superseding mobile input, desktop viewport write/restore geometry, and held-fit reclaim convergence. Other supplied floor/rollback/selection/viewport/grace/disconnect/reconnect/orphan-state alarms are lost. No per-source assertion object exists to reassign. The one affected dated mobile-view-authority receipt is retired whole into historical notes with its full original/currentCommand/raw data preserved; it is not active corroboration for reduced candidate bytes. Imported mobile-subscribe registrations and retained callbacks remain bounded to their actual source obligations, without equivalent replacement or physical-phone/native-PTY claims. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Exact retired authored alarms: 'starts idle for unknown PTY'; 'handleMobileSubscribe in auto mode transitions idle → mobile{clientId}'; 'handleMobileSubscribe in desktop mode is passive — does NOT take floor'; 'reclaimTerminalForDesktop transitions mobile → desktop and is idempotent'; 'mobileTookFloor after reclaim re-applies phone-fit and flips driver back to mobile'; 'restores the pre-write driver after overlapping claims from one phone both fail'; 'keeps a successful overlapping claim as the rollback baseline'; 'does not let an older phone-fit completion retake a newer writer floor'; 'a superseded mobile input %s preserves a newer phone claim'; 'mobile input without an active subscriber cannot create an orphaned floor lock'; 'a %s phone-fit completion after disconnect cannot recreate the mobile lock'; 'admits a soft-leaving client to reserve the input floor within the grace window'; 'handleMobileUnsubscribe last leaver flips driver to idle after soft-leave grace'; 'resubscribe within soft-leave grace cancels idle without driver flap'; 'onPtyExit clears driver state and emits idle'; 'elects one query responder and promotes the survivor on unsubscribe'; 'keeps the earliest subscriber authoritative after a soft-leave resubscribe'; 'excludes an older passive desktop-mode subscriber from reply authority'; 'most-recent actor wins active phone-fit dims (B subscribes after A)'; 'B unsubscribes — A still present, driver re-elects to A'; 'A then B unsubscribes — peer survives; final unsubscribe goes idle'; 'terminal.send by phone-B updates lastActedAt — applyMobileDisplayMode picks B viewport'; 'mobile mode change marks the caller before applying phone-fit'; 'updateMobileViewport re-fits PTY without flipping the driver'; 'updateMobileViewport late-binds a viewport-less mobile subscriber'; 'updateMobileViewport records viewport without applying layout in desktop mode'; 'updateMobileViewport reports applied=false when phone-fit resize fails'; 'updateMobileViewport then disconnect restores PTY to original baseline'; 'legacy unsubscribe → resubscribe within grace preserves baseline (regression)'; 'earliest-subscribe restore target is preserved when peers churn'; 'second Restore click after success returns true with no new resize or fit-override event'; 'driving take-back still converges: driver → desktop, override cleared, both channels notified'; 'held restore with a failing resize still releases and clears the override'; 'active-subscriber take-back with a failing resize still releases the lock'; 'phone-initiated setDisplayMode(desktop) against a stale held override converges'; 'orphan cleanup: reclaim on a held override with no layout entry converges'; 'a still-subscribed phone reporting its viewport does not undo a desktop take-back'; 'a deliberate mobile gesture still re-takes the floor after a desktop take-back'; 'a replayed subscribe after a reconnect does not undo a desktop take-back'; 'a foreground resubscribe inside the soft-leave grace does not undo a desktop take-back'; 'typing on the phone after a reconnect re-takes the floor and phone-fits again'; 'take-back of a held phone-fit with no subscriber also keeps the next subscribe passive'." + "Audit1931 (sources1928/1929): Partial mobile-presence suite retains only five authored callbacks: admitted preview-paste completion across phone takeover, desktop take-back superseding mobile input, desktop viewport write/restore geometry, and held-fit reclaim convergence. Other supplied floor/rollback/selection/viewport/grace/disconnect/reconnect/orphan-state alarms are lost. No per-source assertion object exists to reassign. The one affected dated mobile-view-authority receipt is retired whole into historical notes with its full original/currentCommand/raw data preserved; it is not active corroboration for reduced candidate bytes. Imported mobile-subscribe registrations and retained callbacks remain bounded to their actual source obligations, without equivalent replacement or physical-phone/native-PTY claims. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Exact retired authored alarms: 'starts idle for unknown PTY'; 'handleMobileSubscribe in auto mode transitions idle → mobile{clientId}'; 'handleMobileSubscribe in desktop mode is passive — does NOT take floor'; 'reclaimTerminalForDesktop transitions mobile → desktop and is idempotent'; 'mobileTookFloor after reclaim re-applies phone-fit and flips driver back to mobile'; 'restores the pre-write driver after overlapping claims from one phone both fail'; 'keeps a successful overlapping claim as the rollback baseline'; 'does not let an older phone-fit completion retake a newer writer floor'; 'a superseded mobile input %s preserves a newer phone claim'; 'mobile input without an active subscriber cannot create an orphaned floor lock'; 'a %s phone-fit completion after disconnect cannot recreate the mobile lock'; 'admits a soft-leaving client to reserve the input floor within the grace window'; 'handleMobileUnsubscribe last leaver flips driver to idle after soft-leave grace'; 'resubscribe within soft-leave grace cancels idle without driver flap'; 'onPtyExit clears driver state and emits idle'; 'elects one query responder and promotes the survivor on unsubscribe'; 'keeps the earliest subscriber authoritative after a soft-leave resubscribe'; 'excludes an older passive desktop-mode subscriber from reply authority'; 'most-recent actor wins active phone-fit dims (B subscribes after A)'; 'B unsubscribes — A still present, driver re-elects to A'; 'A then B unsubscribes — peer survives; final unsubscribe goes idle'; 'terminal.send by phone-B updates lastActedAt — applyMobileDisplayMode picks B viewport'; 'mobile mode change marks the caller before applying phone-fit'; 'updateMobileViewport re-fits PTY without flipping the driver'; 'updateMobileViewport late-binds a viewport-less mobile subscriber'; 'updateMobileViewport records viewport without applying layout in desktop mode'; 'updateMobileViewport reports applied=false when phone-fit resize fails'; 'updateMobileViewport then disconnect restores PTY to original baseline'; 'legacy unsubscribe → resubscribe within grace preserves baseline (regression)'; 'earliest-subscribe restore target is preserved when peers churn'; 'second Restore click after success returns true with no new resize or fit-override event'; 'driving take-back still converges: driver → desktop, override cleared, both channels notified'; 'held restore with a failing resize still releases and clears the override'; 'active-subscriber take-back with a failing resize still releases the lock'; 'phone-initiated setDisplayMode(desktop) against a stale held override converges'; 'orphan cleanup: reclaim on a held override with no layout entry converges'; 'a still-subscribed phone reporting its viewport does not undo a desktop take-back'; 'a deliberate mobile gesture still re-takes the floor after a desktop take-back'; 'a replayed subscribe after a reconnect does not undo a desktop take-back'; 'a foreground resubscribe inside the soft-leave grace does not undo a desktop take-back'; 'typing on the phone after a reconnect re-takes the floor and phone-fits again'; 'take-back of a held phone-fit with no subscriber also keeps the next subscribe passive'.", + "Audit2052 (source2049): The ordinary orca-runtime.test.ts registrar drops seven imports of deliberately deleted low-value runtime suites. Their mock capability/agent-presence/environment/title/deduplication and batching alarms are intentionally lost without replacement; remaining imports retain their original order. The runtime handle-contract registrar separately drops the deleted tab-collision registration. Unrelated dated evidenceRuns remain unchanged and do not validate reduced-source bytes or selectors. No fresh gate execution or historical import-closure equivalence is claimed." ], "demotionRule": "Keep experimental or demote if missing ownership proof changes incumbent behavior, a live TUI loses mouse/focus modes, foreground inspection enters ordinary output/reveal paths, or the focused Electron journey flakes without an identified product or harness fault." }, @@ -6871,7 +6875,8 @@ "Audit1392: src/main/agent-hooks/server-pane-authority.test.ts reduced. Retires one duplicate-transfer no-op listener count and latest pty/timestamp callback fixture. No equivalent replacement coverage is claimed. Historical removed assertion inventory: []", "Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Historical removed assertion inventory: [{\"file\":\"src/main/runtime/orca-runtime.test.ts\",\"assertions\":[\"workspace-wide close force-retires pinned and unpinned tabs, clears resume/incarnation state, awaits both target PTYs, preserves the sibling worktree, and reports an unconfirmed stop as unverifiable\"]}]", "Audit1863 removes the standalone local pane-to-PTY equality example. Its direct local-PTY authority alarm is intentionally lost; retained canonical runtime-handle tests do not replace it or prove physical pane/session retirement. Existing E2E and continuity receipts remain scoped to their original commands and counts.", - "Audit1904 reduces persistence-pty-binding-reconciliation from six to four definitions, intentionally losing legacy remap-load and first-binding projection alarms. Current selector/testFile remains valid, with no selected-source assertionRef or active matching receipt. The six unchanged close/continuity receipts keep their exact original scope; no new broad gate or replacement evidence is claimed. Lost direct alarms: 'remaps legacy SSH lease leaf ids by PTY when the layout is already normalized'; 'promotes an empty tab layout to a durable UUID root when persisting the first PTY binding'." + "Audit1904 reduces persistence-pty-binding-reconciliation from six to four definitions, intentionally losing legacy remap-load and first-binding projection alarms. Current selector/testFile remains valid, with no selected-source assertionRef or active matching receipt. The six unchanged close/continuity receipts keep their exact original scope; no new broad gate or replacement evidence is claimed. Lost direct alarms: 'remaps legacy SSH lease leaf ids by PTY when the layout is already normalized'; 'promotes an empty tab layout to a durable UUID root when persisting the first PTY binding'.", + "Audit2052 (source2049): The ordinary orca-runtime.test.ts registrar drops seven imports of deliberately deleted low-value runtime suites. Their mock capability/agent-presence/environment/title/deduplication and batching alarms are intentionally lost without replacement; remaining imports retain their original order. The runtime handle-contract registrar separately drops the deleted tab-collision registration. Unrelated dated evidenceRuns remain unchanged and do not validate reduced-source bytes or selectors. No fresh gate execution or historical import-closure equivalence is claimed." ], "demotionRule": "Keep experimental or demote to protection none if exact PTY disappearance flakes, a sibling/detached pane is retired, late hooks can recreate closed authority, or a renderer graph sync retires a host-created tab that no explicit close retired." }, @@ -7035,7 +7040,8 @@ "Audit1983 historical original assertionRefs object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n{\n \"file\": \"src/main/runtime/rpc/mobile-socket-wiring.test.ts\",\n \"assertions\": [\n \"the optional client capability is captured from legacy encrypted authentication and bound to the authenticated runtime-scoped socket identity\"\n ]\n }", "Audit1983 historical original testFiles object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n\"src/main/runtime/rpc/runtime-close-attribution-topology.test.ts\"", "Audit1983 historical original assertionRefs object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n{\n \"file\": \"src/main/runtime/rpc/runtime-close-attribution-topology.test.ts\",\n \"assertions\": [\n \"remote, legacy, reconnect, stale, concurrent, cross-worktree, and unowned close spans retain authoritative runtime, target, requester, decision, and outcome identities without serializing the bearer credential\",\n \"close attribution adds no terminal inventory scan or provider fanout\"\n ]\n }", - "Audit2020: The CLI WebSocket source retains old-protocol refusal only; its paired-open, capability, timeout and admission projection examples are removed. No daemon-generation coverage is transferred to that callback. Both independent daemon E2E receipts remain unchanged at their original commands; the reduced unit selector has no fresh result." + "Audit2020: The CLI WebSocket source retains old-protocol refusal only; its paired-open, capability, timeout and admission projection examples are removed. No daemon-generation coverage is transferred to that callback. Both independent daemon E2E receipts remain unchanged at their original commands; the reduced unit selector has no fresh result.", + "Audit2052 (source2049): The ordinary orca-runtime.test.ts registrar drops seven imports of deliberately deleted low-value runtime suites. Their mock capability/agent-presence/environment/title/deduplication and batching alarms are intentionally lost without replacement; remaining imports retain their original order. The runtime handle-contract registrar separately drops the deleted tab-collision registration. Unrelated dated evidenceRuns remain unchanged and do not validate reduced-source bytes or selectors. No fresh gate execution or historical import-closure equivalence is claimed." ], "demotionRule": "Keep experimental or quarantine if reconnect emits session-killed for a live canary, an exact root/descendant dies, an old server receives fallback destructive close, cleanup leaks a fixture process/pipe, or the gate flakes without a proven harness defect." }, @@ -7603,7 +7609,8 @@ "Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed.", "Audit1391: src/renderer/src/components/terminal-pane/pty-connection-remote-pause-drop-notice.spec.ts reduced. Lose repeated quiet switches avoiding snapshots and legacy host without drop-report capability requesting a snapshot. Retained imported registrar uses fake transport/xterm writes, exercising real gap/restore lifecycle rather than actual terminal rendering. No equivalent replacement coverage is claimed. Existing exact primary-selector receipts remain unchanged.", "Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Historical removed assertion inventory: []", - "Audit1417 intentionally deletes src/renderer/src/components/terminal-pane/pty-connection-hidden-tui-snapshot-replay.spec.ts: Loses rich hidden snapshot sequence replay/grid resize and forced repaint after hidden snapshot alarms, including live-trigger deduplication. No equivalent replacement coverage or fresh result is claimed." + "Audit1417 intentionally deletes src/renderer/src/components/terminal-pane/pty-connection-hidden-tui-snapshot-replay.spec.ts: Loses rich hidden snapshot sequence replay/grid resize and forced repaint after hidden snapshot alarms, including live-trigger deduplication. No equivalent replacement coverage or fresh result is claimed.", + "Audit2052 (source2049): The ordinary orca-runtime.test.ts registrar drops seven imports of deliberately deleted low-value runtime suites. Their mock capability/agent-presence/environment/title/deduplication and batching alarms are intentionally lost without replacement; remaining imports retain their original order. The runtime handle-contract registrar separately drops the deleted tab-collision registration. Unrelated dated evidenceRuns remain unchanged and do not validate reduced-source bytes or selectors. No fresh gate execution or historical import-closure equivalence is claimed." ], "demotionRule": "Demote or quarantine if failures are non-actionable or if a duplicate resume escape occurs outside the modeled matrix." }, @@ -7888,7 +7895,8 @@ "Audit1983 historical original evidenceRuns object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n{\n \"date\": \"2026-07-22\",\n \"runner\": \"local\",\n \"platform\": \"macos\",\n \"command\": \"pnpm test:repro:remote-agent-session\",\n \"result\": \"passed\",\n \"durationSeconds\": 48.63,\n \"summary\": \"The secondary build-backed headless parity harness passed post-rebase on main@72a2d7bc7 over encrypted WebSocket pairing with independent clients, proving one spawn, retry adoption, durable exit retirement, stale-publication rejection, and no restart resurrection.\",\n \"currentCommand\": \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/methods/terminal/agent-session.test.ts src/renderer/src/runtime/web-runtime-session.test.ts src/renderer/src/runtime/web-session-tabs-sync-focus-intent.test.ts\"\n }", "Audit2003: Delete the complete pure orphan-topology suite and its file membership; preserve the other selectors from its combined command after archiving the original command string. Lost alarms are synthetic current-layout preservation, one-anchor grafting and ambiguous-anchor appending examples. Do not transfer their ownership/topology scope to sibling suites. Preserve all5 independent historical receipts exactly. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed.", "Audit2003 historical original commands object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n\"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/terminal/adoption/terminal-orphan-topology.test.ts src/renderer/src/runtime/hosted-terminals/recovery/web-session-terminal-orphan-recovery.test.ts src/renderer/src/runtime/hosted-terminals/recovery/web-session-terminal-orphan-mixed-version.test.ts --maxWorkers=1\"", - "Audit2003 historical original testFiles object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n\"src/main/runtime/terminal/adoption/terminal-orphan-topology.test.ts\"" + "Audit2003 historical original testFiles object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n\"src/main/runtime/terminal/adoption/terminal-orphan-topology.test.ts\"", + "Audit2052 (source2049): The ordinary orca-runtime.test.ts registrar drops seven imports of deliberately deleted low-value runtime suites. Their mock capability/agent-presence/environment/title/deduplication and batching alarms are intentionally lost without replacement; remaining imports retain their original order. The runtime handle-contract registrar separately drops the deleted tab-collision registration. Unrelated dated evidenceRuns remain unchanged and do not validate reduced-source bytes or selectors. No fresh gate execution or historical import-closure equivalence is claimed." ], "demotionRule": "Keep experimental or demote if the focused gate flakes without a product or harness bug, if a retry can physically spawn twice, if a stale exit/publication can replace or resurrect a terminal, or if mixed-version fallback occurs after an authority side effect." }, @@ -9305,7 +9313,8 @@ "Audit1991 historical original assertionRefs object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n{\n \"file\": \"src/main/runtime/rpc/terminal-multiplex-snapshot-serialization.test.ts\",\n \"assertions\": [\n \"binary first paint remains valid when only retained history was truncated\"\n ]\n }", "Audit1991 historical original assertionRefs object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n{\n \"file\": \"src/main/runtime/rpc/terminal-subscribe-buffer.test.ts\",\n \"assertions\": [\n \"omits an unknown snapshot output sequence instead of publishing the layout version\"\n ]\n }", "Audit2003: Remove SSH/absent-inventory attach refusal, later-subscriber retry, no-view adoption/takeback, provider-tail/unknown-read projections, failed-keystroke retry and simpler loss reattach examples. Keep the existing-subscriber inventory-ready retry alias only at its retained callback, plus retained held-input cancellation/replacement and overlapping attach/loss fences. The inventory driver also loses the whole empty-worktree-publication registration and folder-host/unverifiable scalar examples. Retire the entire dated10-case attach receipt; retain16 independent receipts only in their original scopes. No retained-memory or real-daemon measurement follows from supplied provider inventories. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed.", - "Audit2003 historical original evidenceRuns object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n{\n \"date\": \"2026-08-07\",\n \"runner\": \"local\",\n \"platform\": \"macos\",\n \"command\": \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/terminal-subscriber-driven-daemon-attach.test.ts\",\n \"result\": \"passed\",\n \"durationSeconds\": 4.29,\n \"summary\": \"All 10 subscriber-driven attach contracts passed. With two authoritative inventories overlapping one refused in-flight attach, removing only the post-settlement retry made the byte-identical focused assertion fail with one attach instead of two; restoring it retained one bounded waiter, retried once, and resumed live output on the existing stream.\",\n \"currentCommand\": \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/terminal-subscriber-driven-daemon-attach.test.ts\"\n }" + "Audit2003 historical original evidenceRuns object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n{\n \"date\": \"2026-08-07\",\n \"runner\": \"local\",\n \"platform\": \"macos\",\n \"command\": \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/terminal-subscriber-driven-daemon-attach.test.ts\",\n \"result\": \"passed\",\n \"durationSeconds\": 4.29,\n \"summary\": \"All 10 subscriber-driven attach contracts passed. With two authoritative inventories overlapping one refused in-flight attach, removing only the post-settlement retry made the byte-identical focused assertion fail with one attach instead of two; restoring it retained one bounded waiter, retried once, and resumed live output on the existing stream.\",\n \"currentCommand\": \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/terminal-subscriber-driven-daemon-attach.test.ts\"\n }", + "Audit2052 (source2049): The ordinary orca-runtime.test.ts registrar drops seven imports of deliberately deleted low-value runtime suites. Their mock capability/agent-presence/environment/title/deduplication and batching alarms are intentionally lost without replacement; remaining imports retain their original order. The runtime handle-contract registrar separately drops the deleted tab-collision registration. Unrelated dated evidenceRuns remain unchanged and do not validate reduced-source bytes or selectors. No fresh gate execution or historical import-closure equivalence is claimed." ], "demotionRule": "Keep experimental or demote to protection none if decorative title frequency changes paired client-event or session-tabs publication volume after convergence, a semantic fact is dropped, paired first paint is blank, passive work reconnects after manual disconnect, a capable hidden paired manager survives ordinary parking, a legacy hidden pane schedules raw xterm output or bypasses its fallback, reveal loses requested bounded history or live PTY identity, retained buffer cells do not fall, or either headed/headless scenario flakes." }, @@ -9620,7 +9629,8 @@ "Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed.", "Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Historical removed assertion inventory: [{\"file\":\"src/main/runtime/orca-runtime.test.ts\",\"assertions\":[\"returns a blocked wait result for Codex update prompts\",\"returns a blocked wait result for Codex workspace trust prompts\",\"returns a blocked wait result for generic Codex interactive prompts\",\"resolves tui-idle when a stale Codex prompt is followed by the ready header\"]}]", "Audit1931 (sources1928/1929): Delete the complete tail-wait memo suite: its sole current authored callback checks supplied fromTail/blocked field values. Retire all three broader memoization/equivalence/eviction assertion aliases; they are not backed by retained source callbacks. No scan-work budget, sustained output, physical terminal or resource measurement is assigned to this removed test. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Exact retired authored alarms: 'computeTerminalTailWaitState reports fromTail and blocked signals'.", - "Audit1931 historical original assertionRefs object, preserved verbatim; retired objects are not active evidence or replacement coverage:\n{\n \"file\": \"src/main/runtime/orca-runtime-tail-wait-memo.test.ts\",\n \"assertions\": [\n \"does not rebuild or repeatedly scan an ordinary saturated tail\",\n \"memoized stamping matches recompute reference: blocked prompt split across chunks\",\n \"stays equivalent across tail eviction beyond the retained cap\"\n ]\n }" + "Audit1931 historical original assertionRefs object, preserved verbatim; retired objects are not active evidence or replacement coverage:\n{\n \"file\": \"src/main/runtime/orca-runtime-tail-wait-memo.test.ts\",\n \"assertions\": [\n \"does not rebuild or repeatedly scan an ordinary saturated tail\",\n \"memoized stamping matches recompute reference: blocked prompt split across chunks\",\n \"stays equivalent across tail eviction beyond the retained cap\"\n ]\n }", + "Audit2052 (source2049): The ordinary orca-runtime.test.ts registrar drops seven imports of deliberately deleted low-value runtime suites. Their mock capability/agent-presence/environment/title/deduplication and batching alarms are intentionally lost without replacement; remaining imports retain their original order. The runtime handle-contract registrar separately drops the deleted tab-collision registration. Unrelated dated evidenceRuns remain unchanged and do not validate reduced-source bytes or selectors. No fresh gate execution or historical import-closure equivalence is claimed." ], "demotionRule": "Cannot promote without metric artifacts and bounded-byte assertions." }, @@ -9856,7 +9866,7 @@ "providers": ["ssh", "remote-runtime", "wsl"], "coveredPlatforms": ["macos"], "coveredProviders": ["ssh", "remote-runtime"], - "coverageNotes": "Audit1983: Delete the terminal-create idempotency forwarding suite and its prospective selector. Preserve2 unrelated receipts without claiming the lost forwarding alarm was replaced. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete complete transport-unmount and queued-initial-CWD helper suites: despite lifecycle-shaped fixtures, the unmount owner returns a Boolean PTY-id predicate, while CWD cases check nullish field selection and callback counts. Lose their detach/destroy/teardown and one-shot-CWD supplied examples. Partial queued-pane-startup loses three identical/empty/nonowner identity examples, retaining four exact one-shot/replacement ownership callbacks. No assertion object maps to these three sources, so unrelated alias objects remain byte-exact. Preserve the current81ed prior removal of pane-split-startup; stale bd948 source metadata snapshots are not replayed. No actual process/PTY startup, transport shutdown, live SSH or rendered recovery is proven by this metadata change. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Delete the sole supplied public-SSH-state spread/sanitized-error projection and its provider-authority-pair alias. Also delete the complete tiny one-shot split-startup wrapper suite: callback-visible temporary field/reset, sequential payload and thrown-sentinel reset alarms disappear. No SSH provider epoch handoff, connection, process startup or actual terminal split was performed by either deleted suite. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1903 removes whole mocked detach, supplied geometry and/or close-request suites selected by this gate. Their pending-CWD/PTY-binding argument/order, fabricated hit-test and close bookkeeping alarms are intentionally lost without replacement. Valid remaining selectors/assertions and unchanged-selector execution receipts retain their original scope. Reduced unit selections have no fresh broad gate, real PTY/provider, rendered focus, or measured-budget validation. Historical prior account (preserved verbatim): Audit1645 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1342 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Audit1301 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Deterministic renderer coverage proves retained native and runtime SSH payloads are admitted through production routes only with valid complete authority, stale cleanup cannot unregister a replacement runtime terminal, direct SSH Git and folder panes keep their PTY bindings through disconnect and reconnect, one authority chain stops after two automatic attempts even when each timeout exceeds the rolling window, rejected acknowledgements mutate no store maps, and one shared exact attempt admits every concurrent split-pane spawn and reattach while preserving the first PTY as the tab fallback. A later sibling failure rotates the tab once, stale callbacks from the prior attempt mutate no state, split remount activity suppression is counted per leaf, primary PTY exit promotes a bound survivor or preserves an empty continuation gap for a late sibling, and primary, non-primary, or null-PTY detach preserves exact authority on both resulting tabs. Intentional pane disposal cancels its settlement timer without breaking StrictMode remount timeout ownership. A mounted remote-runtime terminal survives repeated transport partitions without changing PTY identity. A real encrypted-WebSocket oracle proves a successful reachability probe can replace a pre-ready shared-control socket without rejecting or duplicating the waiting RPC. Direct SSH coordinator tests cover immediate terminal finalization, hydration correction, damping, bounded retry, and telemetry non-interference. Client/server heartbeat tests cover timer suspension, socket generations fence stale callbacks, cold restored-terminal attachment retries, cached pixels remain unhealthy until authoritative replay, automatic retries stop after one minute, manual reconnect preserves the PTY, and pane closure releases recovery UI state. Current-transport recovery clears every error that transport surfaced without clearing or displaying a sibling pane's errors, while transport suppression, pane retention, and the rendered surface are independently bounded. Current macOS Electron journeys against an ephemeral Linux Docker SSH target cover exact-authority repo/worktree hydration, live terminal recovery after disconnect/reconnect, and eager six-terminal remount after renderer reload. A Windows remote-runtime smoke covers reachability and PTY round-trip. Multi-target live fanout, paired-close, WSL, and patched live partition journeys remain gaps. The test-value audit narrowed resolved-worktree-execution-host.test.ts to cache reuse and invalidation. Its direct hydrated-worktree, missing-folder, restored-owner, host-stamp and empty-runtime selection alarms are lost. Other routing and recovery suites do not establish equivalent selector coverage; historical run commands and results remain historical. The test-value audit removes standalone unwritten/released renderer-authority and cross-scope request-count examples. The retained synthetic mirror/store/sidebar and pending-inventory checks do not establish real PTY byte ownership, SSH reconnection or equivalent replacement coverage; historical commands and results remain historical. The test-value audit removes direct join/label ledgers, immediate failure and negative-only stale/removal/partial-authority examples, plus the standalone retained/live event projection. Retained synthetic store/hydration compositions do not establish real SSH continuity, remote authority delivery or equivalent replacement alarms. Historical commands and results remain historical. The renderer scheduling fixture retains in-flight coalescing only. Its immediate publication and negative stale-SSH-cleanup call ledgers were removed; the retained SSH recovery evidence does not replace those alarms. The accepted-handle-events observer suite is removed, including its scoped listener and settlement-release assertions. These observer alarms are lost; retained SSH/transport journeys are not equivalent replacement coverage. The test-value audit removed repeated remote-handle rotation inventories and snapshot-first pending-restart migration examples from terminal-pty-identity-replacement.test.ts, plus direct foreground metadata setter, confirmation, evidence-enum, and prefix/worktree cleanup examples. Those rotation, pending-restart, snapshot-first migration, and foreground scalar-update alarms are lost. The retained replacement case observes pane and tab identities in one subscriber publication; it does not establish equivalent migration, process-evidence, or input-routing coverage. Historical commands and results remain historical. The test-value audit narrows terminals-hydration.test.ts to a real reconnect batch with one measured store publication and hydration-seeded history consumed by a subsequent visit/Back check. Direct split-layout, runtime/folder/floating restoration, dead-leaf focus, cold/known-absent SSH deferral, title, default-tab marker, navigation initialization, and hydrationSucceeded scalar examples are removed; those specific alarms are lost. No actual target-removal transition, live SSH connection, session writer, or persisted restart is exercised by the retained cases. The old target-scoped/snapshot assertion references are retired because the current file does not contain those oracles. Other suites and historical runs do not establish equivalent replacement coverage. Audit1299 removes tests/e2e/terminal-cold-activation-deferral.spec.ts. Private-state/work-budget/assembled-fixture alarms are intentionally lost; retained suites are not equivalent replacement coverage. No new runtime/platform evidence is claimed. Audit1301: src/renderer/src/runtime/remote-runtime-session-tabs-inflight.test.ts reduced. Direct dedupe eviction/count and equal receipt-position sample loses authored alarm. No equivalent replacement coverage is claimed. Audit1318: src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts: Retain real local encrypted WebSocket regressions for pre-ready socket replacement preserving a request, close-before-ready logical subscription cleanup, unrelated RPC surviving another deadline, and pending setup abort leaving a sibling pending. Host server is synthetic and uses production crypto; kept scenarios also retain internal diagnostics/memory assertions unchanged. Remove happy routing, authority-envelope, unknown-ID/log, cleanup enum, binary, keepalive/liveness and production-budget/private socket inventories; intentionally lose those alarms, no physical host authorization, independent crypto or remote provider claim. Reduced selectors need fresh validation; historical full-suite receipts do not validate the changed coverage. No equivalent replacement or physical-provider claim. Audit1342: src/renderer/src/hooks/ipc-events/direct-ssh-connect-reply-routing.test.ts removed. Initial and event-triggered partial-authority hydration fixture alarms disappear. src/renderer/src/components/terminal-pane/terminal-error-accumulation.test.ts removed. Multiline dedup/storm bounds, resource classification/collision, scoped clear/reconnect strip and1000-pane map count alarms disappear. No equivalent replacement coverage is claimed. Audit1396: src/renderer/src/components/terminal-pane/pty-connection-pending-spawn.spec.ts reduced. Lose standalone debug-state retention/log silence alarm. React StrictMode is not mounted; bindings manually simulate remount over mocked transport. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1400: src/main/ipc/ssh/ssh.test.ts reduced. Lose trivial missing target and mocked publication inventory. Preexisting unresolved ../ssh/ssh-port-scanner mock is recorded, not fixed. src/renderer/src/runtime/sync-runtime-graph-scheduling.test.ts removed. Removes whole coalescing call-count suite; no newest-state delivery or replacement claim. src/renderer/src/store/slices/terminal-pty-identity-replacement.test.ts reduced. Removes three no-op/work-count registrations; retains externally observed ownership consistency. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1412: src/main/ssh/ssh-provider-authority.test.ts removed. Loses real AbortController revocation/target isolation/reentrancy outcomes, recreated-target generation-floor/session rollover behavior, stale mutation refusal and settled-registration cleanup alarms. These useful alarms are deliberately lost; no equivalent cancellation coverage is claimed. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1743 removes the standalone line-height clamp/default and pane cwd fallback helper tests (5 authored cases). These trivial-helper alarms are intentionally lost, with no equivalent replacement. Only current commands/testFiles lose the deleted selectors; historical receipts and evidenceRuns remain unchanged and do not validate the reduced commands.", + "coverageNotes": "Audit2052 (sources2049/2050/2051): Remove complete low-value restored-pane-title and pane-visibility-identity suites and their current selectors. Their supplied snapshot/title and nullable identity-comparison alarms are intentionally lost without replacement. Unrelated dated evidenceRuns remain unchanged and do not validate the reduced commands. No fresh gate execution, actual PTY/provider, rendered, remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Delete the terminal-create idempotency forwarding suite and its prospective selector. Preserve2 unrelated receipts without claiming the lost forwarding alarm was replaced. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete complete transport-unmount and queued-initial-CWD helper suites: despite lifecycle-shaped fixtures, the unmount owner returns a Boolean PTY-id predicate, while CWD cases check nullish field selection and callback counts. Lose their detach/destroy/teardown and one-shot-CWD supplied examples. Partial queued-pane-startup loses three identical/empty/nonowner identity examples, retaining four exact one-shot/replacement ownership callbacks. No assertion object maps to these three sources, so unrelated alias objects remain byte-exact. Preserve the current81ed prior removal of pane-split-startup; stale bd948 source metadata snapshots are not replayed. No actual process/PTY startup, transport shutdown, live SSH or rendered recovery is proven by this metadata change. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Delete the sole supplied public-SSH-state spread/sanitized-error projection and its provider-authority-pair alias. Also delete the complete tiny one-shot split-startup wrapper suite: callback-visible temporary field/reset, sequential payload and thrown-sentinel reset alarms disappear. No SSH provider epoch handoff, connection, process startup or actual terminal split was performed by either deleted suite. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1903 removes whole mocked detach, supplied geometry and/or close-request suites selected by this gate. Their pending-CWD/PTY-binding argument/order, fabricated hit-test and close bookkeeping alarms are intentionally lost without replacement. Valid remaining selectors/assertions and unchanged-selector execution receipts retain their original scope. Reduced unit selections have no fresh broad gate, real PTY/provider, rendered focus, or measured-budget validation. Historical prior account (preserved verbatim): Audit1645 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1342 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Audit1301 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Deterministic renderer coverage proves retained native and runtime SSH payloads are admitted through production routes only with valid complete authority, stale cleanup cannot unregister a replacement runtime terminal, direct SSH Git and folder panes keep their PTY bindings through disconnect and reconnect, one authority chain stops after two automatic attempts even when each timeout exceeds the rolling window, rejected acknowledgements mutate no store maps, and one shared exact attempt admits every concurrent split-pane spawn and reattach while preserving the first PTY as the tab fallback. A later sibling failure rotates the tab once, stale callbacks from the prior attempt mutate no state, split remount activity suppression is counted per leaf, primary PTY exit promotes a bound survivor or preserves an empty continuation gap for a late sibling, and primary, non-primary, or null-PTY detach preserves exact authority on both resulting tabs. Intentional pane disposal cancels its settlement timer without breaking StrictMode remount timeout ownership. A mounted remote-runtime terminal survives repeated transport partitions without changing PTY identity. A real encrypted-WebSocket oracle proves a successful reachability probe can replace a pre-ready shared-control socket without rejecting or duplicating the waiting RPC. Direct SSH coordinator tests cover immediate terminal finalization, hydration correction, damping, bounded retry, and telemetry non-interference. Client/server heartbeat tests cover timer suspension, socket generations fence stale callbacks, cold restored-terminal attachment retries, cached pixels remain unhealthy until authoritative replay, automatic retries stop after one minute, manual reconnect preserves the PTY, and pane closure releases recovery UI state. Current-transport recovery clears every error that transport surfaced without clearing or displaying a sibling pane's errors, while transport suppression, pane retention, and the rendered surface are independently bounded. Current macOS Electron journeys against an ephemeral Linux Docker SSH target cover exact-authority repo/worktree hydration, live terminal recovery after disconnect/reconnect, and eager six-terminal remount after renderer reload. A Windows remote-runtime smoke covers reachability and PTY round-trip. Multi-target live fanout, paired-close, WSL, and patched live partition journeys remain gaps. The test-value audit narrowed resolved-worktree-execution-host.test.ts to cache reuse and invalidation. Its direct hydrated-worktree, missing-folder, restored-owner, host-stamp and empty-runtime selection alarms are lost. Other routing and recovery suites do not establish equivalent selector coverage; historical run commands and results remain historical. The test-value audit removes standalone unwritten/released renderer-authority and cross-scope request-count examples. The retained synthetic mirror/store/sidebar and pending-inventory checks do not establish real PTY byte ownership, SSH reconnection or equivalent replacement coverage; historical commands and results remain historical. The test-value audit removes direct join/label ledgers, immediate failure and negative-only stale/removal/partial-authority examples, plus the standalone retained/live event projection. Retained synthetic store/hydration compositions do not establish real SSH continuity, remote authority delivery or equivalent replacement alarms. Historical commands and results remain historical. The renderer scheduling fixture retains in-flight coalescing only. Its immediate publication and negative stale-SSH-cleanup call ledgers were removed; the retained SSH recovery evidence does not replace those alarms. The accepted-handle-events observer suite is removed, including its scoped listener and settlement-release assertions. These observer alarms are lost; retained SSH/transport journeys are not equivalent replacement coverage. The test-value audit removed repeated remote-handle rotation inventories and snapshot-first pending-restart migration examples from terminal-pty-identity-replacement.test.ts, plus direct foreground metadata setter, confirmation, evidence-enum, and prefix/worktree cleanup examples. Those rotation, pending-restart, snapshot-first migration, and foreground scalar-update alarms are lost. The retained replacement case observes pane and tab identities in one subscriber publication; it does not establish equivalent migration, process-evidence, or input-routing coverage. Historical commands and results remain historical. The test-value audit narrows terminals-hydration.test.ts to a real reconnect batch with one measured store publication and hydration-seeded history consumed by a subsequent visit/Back check. Direct split-layout, runtime/folder/floating restoration, dead-leaf focus, cold/known-absent SSH deferral, title, default-tab marker, navigation initialization, and hydrationSucceeded scalar examples are removed; those specific alarms are lost. No actual target-removal transition, live SSH connection, session writer, or persisted restart is exercised by the retained cases. The old target-scoped/snapshot assertion references are retired because the current file does not contain those oracles. Other suites and historical runs do not establish equivalent replacement coverage. Audit1299 removes tests/e2e/terminal-cold-activation-deferral.spec.ts. Private-state/work-budget/assembled-fixture alarms are intentionally lost; retained suites are not equivalent replacement coverage. No new runtime/platform evidence is claimed. Audit1301: src/renderer/src/runtime/remote-runtime-session-tabs-inflight.test.ts reduced. Direct dedupe eviction/count and equal receipt-position sample loses authored alarm. No equivalent replacement coverage is claimed. Audit1318: src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts: Retain real local encrypted WebSocket regressions for pre-ready socket replacement preserving a request, close-before-ready logical subscription cleanup, unrelated RPC surviving another deadline, and pending setup abort leaving a sibling pending. Host server is synthetic and uses production crypto; kept scenarios also retain internal diagnostics/memory assertions unchanged. Remove happy routing, authority-envelope, unknown-ID/log, cleanup enum, binary, keepalive/liveness and production-budget/private socket inventories; intentionally lose those alarms, no physical host authorization, independent crypto or remote provider claim. Reduced selectors need fresh validation; historical full-suite receipts do not validate the changed coverage. No equivalent replacement or physical-provider claim. Audit1342: src/renderer/src/hooks/ipc-events/direct-ssh-connect-reply-routing.test.ts removed. Initial and event-triggered partial-authority hydration fixture alarms disappear. src/renderer/src/components/terminal-pane/terminal-error-accumulation.test.ts removed. Multiline dedup/storm bounds, resource classification/collision, scoped clear/reconnect strip and1000-pane map count alarms disappear. No equivalent replacement coverage is claimed. Audit1396: src/renderer/src/components/terminal-pane/pty-connection-pending-spawn.spec.ts reduced. Lose standalone debug-state retention/log silence alarm. React StrictMode is not mounted; bindings manually simulate remount over mocked transport. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1400: src/main/ipc/ssh/ssh.test.ts reduced. Lose trivial missing target and mocked publication inventory. Preexisting unresolved ../ssh/ssh-port-scanner mock is recorded, not fixed. src/renderer/src/runtime/sync-runtime-graph-scheduling.test.ts removed. Removes whole coalescing call-count suite; no newest-state delivery or replacement claim. src/renderer/src/store/slices/terminal-pty-identity-replacement.test.ts reduced. Removes three no-op/work-count registrations; retains externally observed ownership consistency. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1412: src/main/ssh/ssh-provider-authority.test.ts removed. Loses real AbortController revocation/target isolation/reentrancy outcomes, recreated-target generation-floor/session rollover behavior, stale mutation refusal and settled-registration cleanup alarms. These useful alarms are deliberately lost; no equivalent cancellation coverage is claimed. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1743 removes the standalone line-height clamp/default and pane cwd fallback helper tests (5 authored cases). These trivial-helper alarms are intentionally lost, with no equivalent replacement. Only current commands/testFiles lose the deleted selectors; historical receipts and evidenceRuns remain unchanged and do not validate the reduced commands.", "motivatingLinks": [ "https://linear.app/stably/issue/STA-3107", "https://github.com/stablyai/orca/pull/12664", @@ -9871,10 +9881,10 @@ "https://github.com/stablyai/orca/issues/12902" ], "invariant": "SSH, WSL, and remote-runtime restore paths must treat provider listing failures and unknown liveness as unknown, not dead, while still avoiding duplicate spawn and clearing expired relay leases exactly once. Direct SSH disconnect, reconnect, and wake must keep PTY bindings and relay identity, and target snapshot hydration/reconnect cannot reset sibling SSH, local, WSL, or runtime-owned state. Every restored remote terminal must preserve its provider PTY identity, including the authoritative incarnation returned by a successful session-ID reattach. After a recoverable partition the same authenticated runtime must reattach the same PTY, reject detached input, apply the latest viewport, and report healthy only after authoritative replay. A successful one-shot reachability probe may replace a pre-ready shared-control socket, but waiting RPCs must continue onto the replacement under their original deadline without duplicate host delivery or retained request bytes. Automatic PTY recovery stops after one bounded minute without a fatal terminal error; a manual reconnect starts a newly fenced epoch against the same PTY, and closed panes retain no recovery UI state. Successful current-transport recovery must clear every stale error surfaced for that pane without clearing or displaying a sibling pane's error; a later genuine failure must remain visible. Each transport retains at most eight suppressed messages, each pane retains at most eight distinct messages, and the rendered surface retains at most 24 lines and 4,000 characters. One capability-gated terminal-create mutation must produce at most one host PTY across an unknown response outcome, remain manually retryable after cutoff, and never let a stale completion replace a newer pane lifecycle. Reconnect must alternate exact activation with authoritative inventory so neither a stale activation response nor an activation failure can strand or retire a pane, and activating a parked surface whose persisted binding was already retired must respawn it rather than report a changed owner after signalling its exit.", - "oracle": "Audit1983: Delete the terminal-create idempotency forwarding suite and its prospective selector. Preserve2 unrelated receipts without claiming the lost forwarding alarm was replaced. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete complete transport-unmount and queued-initial-CWD helper suites: despite lifecycle-shaped fixtures, the unmount owner returns a Boolean PTY-id predicate, while CWD cases check nullish field selection and callback counts. Lose their detach/destroy/teardown and one-shot-CWD supplied examples. Partial queued-pane-startup loses three identical/empty/nonowner identity examples, retaining four exact one-shot/replacement ownership callbacks. No assertion object maps to these three sources, so unrelated alias objects remain byte-exact. Preserve the current81ed prior removal of pane-split-startup; stale bd948 source metadata snapshots are not replayed. No actual process/PTY startup, transport shutdown, live SSH or rendered recovery is proven by this metadata change. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Delete the sole supplied public-SSH-state spread/sanitized-error projection and its provider-authority-pair alias. Also delete the complete tiny one-shot split-startup wrapper suite: callback-visible temporary field/reset, sequential payload and thrown-sentinel reset alarms disappear. No SSH provider epoch handoff, connection, process startup or actual terminal split was performed by either deleted suite. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1903 removes whole mocked detach, supplied geometry and/or close-request suites selected by this gate. Their pending-CWD/PTY-binding argument/order, fabricated hit-test and close bookkeeping alarms are intentionally lost without replacement. Valid remaining selectors/assertions and unchanged-selector execution receipts retain their original scope. Reduced unit selections have no fresh broad gate, real PTY/provider, rendered focus, or measured-budget validation. Historical prior account (preserved verbatim): Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): Deterministic tests cover bounded stale-handle replacement, suspended heartbeat clocks, cold and established subscription failure, ten partition/recovery cycles, automatic-recovery cutoff, manual reconnect, and direct SSH binding retention. They assert SSH state changes leave PTY bindings in place, relay identity survives, and another target/local/WSL/runtime panes remain byte-identical through target snapshot hydration and reconnect. Both remount callbacks consume split-count activity suppression, intentional dispose emits no failure/timeout, and a same-attempt StrictMode remount still owns one timeout. Hydration clears an untrusted PTY hint without clearing its current pending owner, healthy current-authority bindings suppress correction, hydration finalizes once, and reconnect emits no paired close lifecycle. A provider-level session-ID reattach returns an incarnation, then a legacy exit without an incarnation must resolve to that returned identity rather than minting a fallback identity. The shared-control oracle withholds the first encrypted ready frame, starts one RPC, triggers the successful-probe refresh, then requires exactly two client connections, one host request, a successful response, zero pending calls, and zero retained request bytes. Tests also assert one unsubscribe per remote-runtime epoch, observable recovery phases, stable PTY identity, resumed snapshot/output/input, no healthy state before replay, no retry or input after cutoff, a new manual epoch against the same PTY, quiet recovery UI with an explicit Reconnect action, pane-close state cleanup, one stable create mutation id, old-runtime no-retry behavior, cross-process PTY adoption, and bounded in-flight coordination. A focused recovery oracle surfaces two distinct failures through one transport, completes authoritative replay, and requires both matching clear callbacks; pane-state tests require only the active pane's error to render, matching-pane recovery to preserve sibling and unrelated errors, dismissal to re-admit later failures, and distinct storms to retain only the newest eight messages within 24 lines and 4,000 characters. The retained store replacement assertion observes one atomic pane/tab subscriber publication; repeated rotations and snapshot-first pending-restart migration no longer have their direct store examples.", + "oracle": "Audit2052 (sources2049/2050/2051): Remove complete low-value restored-pane-title and pane-visibility-identity suites and their current selectors. Their supplied snapshot/title and nullable identity-comparison alarms are intentionally lost without replacement. Unrelated dated evidenceRuns remain unchanged and do not validate the reduced commands. No fresh gate execution, actual PTY/provider, rendered, remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Delete the terminal-create idempotency forwarding suite and its prospective selector. Preserve2 unrelated receipts without claiming the lost forwarding alarm was replaced. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete complete transport-unmount and queued-initial-CWD helper suites: despite lifecycle-shaped fixtures, the unmount owner returns a Boolean PTY-id predicate, while CWD cases check nullish field selection and callback counts. Lose their detach/destroy/teardown and one-shot-CWD supplied examples. Partial queued-pane-startup loses three identical/empty/nonowner identity examples, retaining four exact one-shot/replacement ownership callbacks. No assertion object maps to these three sources, so unrelated alias objects remain byte-exact. Preserve the current81ed prior removal of pane-split-startup; stale bd948 source metadata snapshots are not replayed. No actual process/PTY startup, transport shutdown, live SSH or rendered recovery is proven by this metadata change. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Delete the sole supplied public-SSH-state spread/sanitized-error projection and its provider-authority-pair alias. Also delete the complete tiny one-shot split-startup wrapper suite: callback-visible temporary field/reset, sequential payload and thrown-sentinel reset alarms disappear. No SSH provider epoch handoff, connection, process startup or actual terminal split was performed by either deleted suite. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1903 removes whole mocked detach, supplied geometry and/or close-request suites selected by this gate. Their pending-CWD/PTY-binding argument/order, fabricated hit-test and close bookkeeping alarms are intentionally lost without replacement. Valid remaining selectors/assertions and unchanged-selector execution receipts retain their original scope. Reduced unit selections have no fresh broad gate, real PTY/provider, rendered focus, or measured-budget validation. Historical prior account (preserved verbatim): Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): Deterministic tests cover bounded stale-handle replacement, suspended heartbeat clocks, cold and established subscription failure, ten partition/recovery cycles, automatic-recovery cutoff, manual reconnect, and direct SSH binding retention. They assert SSH state changes leave PTY bindings in place, relay identity survives, and another target/local/WSL/runtime panes remain byte-identical through target snapshot hydration and reconnect. Both remount callbacks consume split-count activity suppression, intentional dispose emits no failure/timeout, and a same-attempt StrictMode remount still owns one timeout. Hydration clears an untrusted PTY hint without clearing its current pending owner, healthy current-authority bindings suppress correction, hydration finalizes once, and reconnect emits no paired close lifecycle. A provider-level session-ID reattach returns an incarnation, then a legacy exit without an incarnation must resolve to that returned identity rather than minting a fallback identity. The shared-control oracle withholds the first encrypted ready frame, starts one RPC, triggers the successful-probe refresh, then requires exactly two client connections, one host request, a successful response, zero pending calls, and zero retained request bytes. Tests also assert one unsubscribe per remote-runtime epoch, observable recovery phases, stable PTY identity, resumed snapshot/output/input, no healthy state before replay, no retry or input after cutoff, a new manual epoch against the same PTY, quiet recovery UI with an explicit Reconnect action, pane-close state cleanup, one stable create mutation id, old-runtime no-retry behavior, cross-process PTY adoption, and bounded in-flight coordination. A focused recovery oracle surfaces two distinct failures through one transport, completes authoritative replay, and requires both matching clear callbacks; pane-state tests require only the active pane's error to render, matching-pane recovery to preserve sibling and unrelated errors, dismissal to re-admit later failures, and distinct storms to retain only the newest eight messages within 24 lines and 4,000 characters. The retained store replacement assertion observes one atomic pane/tab subscriber publication; repeated rotations and snapshot-first pending-restart migration no longer have their direct store examples.", "commands": [ "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/paired-reconnect-multi-pane-materialization.test.ts src/renderer/src/runtime/paired-reconnect-sidebar-agent-count.test.ts --reporter=dot", - "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/resolved-worktree-execution-host.test.ts src/renderer/src/components/terminal/background-terminal-worktree-mount.test.ts src/renderer/src/components/terminal-pane/mounting/queued-pane-startup.test.ts src/renderer/src/components/terminal-pane/parking/one-shot-park-replay.test.ts src/renderer/src/components/terminal-pane/titles/restored-pane-titles.test.ts src/renderer/src/components/terminal-pane/viewport/pane-visibility-identity.test.ts src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-host-surface-replacement.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-stream-reconnect.test.ts src/renderer/src/runtime/remote-runtime-session-tabs-inflight.test.ts src/renderer/src/store/terminals/terminal-pty-identity-replacement.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/resolved-worktree-execution-host.test.ts src/renderer/src/components/terminal/background-terminal-worktree-mount.test.ts src/renderer/src/components/terminal-pane/mounting/queued-pane-startup.test.ts src/renderer/src/components/terminal-pane/parking/one-shot-park-replay.test.ts src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-host-surface-replacement.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-stream-reconnect.test.ts src/renderer/src/runtime/remote-runtime-session-tabs-inflight.test.ts src/renderer/src/store/terminals/terminal-pty-identity-replacement.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-reattach-admission.test.ts src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-detach-attach-handoff.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-attach-subscription.test.ts --reporter=dot", "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-attach-subscription.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-host-surface-replacement.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-stream-reconnect.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-expired-pane-recovery.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-create-outcome-recovery.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-create-handoff.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/recovery/remote-runtime-pty-recovery-state.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/recovery/TerminalRemoteRuntimeReconnectBanner.test.tsx src/shared/remote-runtime/remote-runtime-socket-liveness.test.ts src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts src/shared/remote-runtime/control/remote-runtime-shared-control-socket-generation.test.ts src/shared/remote-runtime/remote-runtime-client-error-classification.test.ts src/main/runtime/rpc/remote-runtime-server-heartbeat.test.ts src/main/runtime/terminal/launch/orca-runtime-terminal-create-idempotency.test.ts", @@ -9891,8 +9901,6 @@ "src/renderer/src/components/terminal/background-terminal-worktree-mount.test.ts", "src/renderer/src/components/terminal-pane/mounting/queued-pane-startup.test.ts", "src/renderer/src/components/terminal-pane/parking/one-shot-park-replay.test.ts", - "src/renderer/src/components/terminal-pane/titles/restored-pane-titles.test.ts", - "src/renderer/src/components/terminal-pane/viewport/pane-visibility-identity.test.ts", "src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts", "src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-reattach-admission.test.ts", "src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-detach-attach-handoff.test.ts", @@ -10171,7 +10179,8 @@ "Audit1931 (sources1928/1929): Delete complete transport-unmount and queued-initial-CWD helper suites: despite lifecycle-shaped fixtures, the unmount owner returns a Boolean PTY-id predicate, while CWD cases check nullish field selection and callback counts. Lose their detach/destroy/teardown and one-shot-CWD supplied examples. Partial queued-pane-startup loses three identical/empty/nonowner identity examples, retaining four exact one-shot/replacement ownership callbacks. No assertion object maps to these three sources, so unrelated alias objects remain byte-exact. Preserve the current81ed prior removal of pane-split-startup; stale bd948 source metadata snapshots are not replayed. No actual process/PTY startup, transport shutdown, live SSH or rendered recovery is proven by this metadata change. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Exact retired authored alarms: 'detaches when the tab still owns the transport PTY'; 'detaches when a mirrored replacement tab owns the same PTY'; 'detaches when closeTab already owns provider shutdown for the removed tab'; 'destroys an ID-less transport so a pending spawn cannot outlive unmount'; 'detaches a removed automation pane after closeTab takes teardown authority'; 'consumes the queued initial cwd once when the ref is unset'; 'reuses the existing queued state without re-reading the store'; 'clears the one-shot cwd and restores the default cwd after the first pane'; 'leaves the cwd unchanged when no one-shot override is queued'; 'denies ownership to a split payload structurally identical to the queued command'; 'denies ownership when the tab queued nothing, so an unrelated pane cannot spend a slot'; 'withholds the consumer from a pane that does not own the queued command'.", "Audit1983: Delete the terminal-create idempotency forwarding suite and its prospective selector. Preserve2 unrelated receipts without claiming the lost forwarding alarm was replaced. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed.", "Audit1983 historical original commands object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n\"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-attach-subscription.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-host-surface-replacement.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-stream-reconnect.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-expired-pane-recovery.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-create-outcome-recovery.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-create-handoff.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/recovery/remote-runtime-pty-recovery-state.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/recovery/TerminalRemoteRuntimeReconnectBanner.test.tsx src/shared/remote-runtime/remote-runtime-socket-liveness.test.ts src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts src/shared/remote-runtime/control/remote-runtime-shared-control-socket-generation.test.ts src/shared/remote-runtime/remote-runtime-client-error-classification.test.ts src/main/runtime/rpc/remote-runtime-server-heartbeat.test.ts src/main/runtime/rpc/methods/terminal/terminal-create-idempotency.test.ts src/main/runtime/terminal/launch/orca-runtime-terminal-create-idempotency.test.ts\"", - "Audit1983 historical original testFiles object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n\"src/main/runtime/rpc/methods/terminal/terminal-create-idempotency.test.ts\"" + "Audit1983 historical original testFiles object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n\"src/main/runtime/rpc/methods/terminal/terminal-create-idempotency.test.ts\"", + "Audit2052 (sources2049/2050/2051): Remove complete low-value restored-pane-title and pane-visibility-identity suites and their current selectors. Their supplied snapshot/title and nullable identity-comparison alarms are intentionally lost without replacement. Unrelated dated evidenceRuns remain unchanged and do not validate the reduced commands. No fresh gate execution, actual PTY/provider, rendered, remote/mobile or cross-platform result is claimed." ], "demotionRule": "Cannot promote if provider failure can close panes or if the oracle is screenshot-only." }, @@ -10943,7 +10952,8 @@ "Audit1383: src/main/runtime/rpc/terminal-agent-prompt-send.test.ts reduced. Lose mocked successful routing, fallback args and signal identity forwarding. Retained fake PTY write sink observes no output; no actual shell/provider claimed. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed.", "Audit1383 historical assertion inventory for changed sources:\n[\n {\n \"file\": \"src/main/runtime/rpc/terminal-agent-prompt-send.test.ts\",\n \"assertions\": [\n \"a freshly proven Claude or Codex desktop target uses settled prompt delivery\",\n \"a non-target agent or shell preserves the existing direct send\"\n ]\n }\n]", "Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Historical removed assertion inventory: [{\"file\":\"src/main/runtime/orca-runtime.test.ts\",\"assertions\":[\"Claude and Codex wait for marker-gated composer quiescence before submit\",\"every other configured TUI agent retains the legacy platform delay\",\"a speculative CLI prompt check does not poll wrapper foregrounds\",\"the PTY write boundary retains bracketed framing and one delayed submit\"]}]", - "Audit1991: Remove partial-runtime terminal-send micro-alarms; the reduced RPC source retains held viewport admission, authenticated-client spoof refusal, text admission and stale-binding fences. Preserve the3 unrelated historical repro and source-built end-to-end receipts at their original exact commands; do not transfer their counts or physical platform claims to reduced unit callbacks. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed." + "Audit1991: Remove partial-runtime terminal-send micro-alarms; the reduced RPC source retains held viewport admission, authenticated-client spoof refusal, text admission and stale-binding fences. Preserve the3 unrelated historical repro and source-built end-to-end receipts at their original exact commands; do not transfer their counts or physical platform claims to reduced unit callbacks. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed.", + "Audit2052 (source2049): The ordinary orca-runtime.test.ts registrar drops seven imports of deliberately deleted low-value runtime suites. Their mock capability/agent-presence/environment/title/deduplication and batching alarms are intentionally lost without replacement; remaining imports retain their original order. The runtime handle-contract registrar separately drops the deleted tab-collision registration. Unrelated dated evidenceRuns remain unchanged and do not validate reduced-source bytes or selectors. No fresh gate execution or historical import-closure equivalence is claimed." ], "demotionRule": "Keep experimental or demote to protection none if direct shell/mobile/query input is reframed, an unrecognized target receives bracketed paste, a prompt can emit duplicate Enter, mixed-version decoding rejects the optional field, or the deterministic fake-composer candidate requires a rescue send." }, @@ -11080,7 +11090,8 @@ "Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Historical removed assertion inventory: [{\"file\":\"src/main/runtime/orca-runtime.test.ts\",\"assertions\":[\"runtime writes bracketed paste before a delayed submit\",\"Claude and Codex ignore unrelated and split pre-marker output, then wait for render quiescence before one submit\",\"every other configured TUI agent retains the platform delay\",\"a late Codex marker receives a fresh settlement window before one submit\",\"a silent Claude composer reaches one bounded fallback submit\",\"a marked Claude composer with continuous render output reaches one bounded fallback submit\",\"large prompt frames are chunked and reconstructed before submit\",\"partial prompt write failure closes the paste frame and does not submit\"]}]", "Audit1943 (sources1934/1935/1938): Pruned coordinator suite retains actual dispatch-failure circuit breaking through SQLite and an actual drift-threshold silent-skip. Both existing prompt-injection aliases remain backed within injected send/terminal/probe scope. Other scalar admission, identity attribution, stop flag and prompt-section/fallback projections are intentionally lost; independent runtime writer and worker-start receipts remain limited to their original selectors, without transferred execution or replacement claims. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Exact retired authored alarms: 'throws if no tasks exist'; 'records the assignee pane key when the runtime can resolve one'; 'records authenticated process authority for automatic dispatch'; 'can be stopped'; 'threads drift into the preamble when behind > 0 and under threshold'; 'proceeds with stripped spec + drift section when allow-stale-base overrides'; 'proceeds without drift section when probeWorktreeDrift returns null'; 'does not call probeWorktreeDrift when coordinator has no worktree selector'; 'proceeds without drift when probeWorktreeDrift throws'.", "Audit1973: Remove mocked injected-preamble forwarding and raw terminal.send absence aliases. Retain the real database rollback alias for failed injection and both unrelated dated receipts. Whole original changed dated receipts are retired, never narrowed or transferred. This metadata review claims no fresh execution, equivalent replacement, provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result.", - "Audit1973 historical original assertionRefs object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n{\n \"file\": \"src/main/runtime/rpc/methods/orchestration/runs/tasks-dispatch.test.ts\",\n \"assertions\": [\n \"orchestration.dispatch uses the agent prompt path for injected preambles\",\n \"raw terminal.send is not called for injected task prompts\",\n \"failed prompt injection rolls back the active dispatch\"\n ]\n }" + "Audit1973 historical original assertionRefs object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n{\n \"file\": \"src/main/runtime/rpc/methods/orchestration/runs/tasks-dispatch.test.ts\",\n \"assertions\": [\n \"orchestration.dispatch uses the agent prompt path for injected preambles\",\n \"raw terminal.send is not called for injected task prompts\",\n \"failed prompt injection rolls back the active dispatch\"\n ]\n }", + "Audit2052 (source2049): The ordinary orca-runtime.test.ts registrar drops seven imports of deliberately deleted low-value runtime suites. Their mock capability/agent-presence/environment/title/deduplication and batching alarms are intentionally lost without replacement; remaining imports retain their original order. The runtime handle-contract registrar separately drops the deleted tab-collision registration. Unrelated dated evidenceRuns remain unchanged and do not validate reduced-source bytes or selectors. No fresh gate execution or historical import-closure equivalence is claimed." ], "demotionRule": "Demote or quarantine if the live harness flakes without a product bug or harness bug filed to the terminal-input owner." }, @@ -11289,7 +11300,8 @@ "Audit1948 historical original assertionRefs object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n{\n \"file\": \"src/main/runtime/orchestration/db/worker-dispatch/orchestration-worker-dispatch-db.test.ts\",\n \"assertions\": [\n \"remote Dispatch attachment lookup remains bounded across pane remints and malformed suffix collisions\"\n ]\n }", "Audit1948 historical original assertionRefs object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n{\n \"file\": \"src/main/runtime/orchestration/federation/synchronization/federation-sync.test.ts\",\n \"assertions\": [\n \"an acknowledged duplicate replay does not wake a waiter\",\n \"overlapping syncs preserve one durable forward-only checkpoint\"\n ]\n }", "Audit1973: Remove scalar, private-shape and projection examples and check cases whose reconciler runs manually before check. Retain actual federation lost-ack/gap and lifecycle completion-ack/replay alarms; unrelated message-delivery-identity receipt remains exact. Whole original changed dated receipts are retired, never narrowed or transferred. This metadata review claims no fresh execution, equivalent replacement, provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result.", - "Audit2003: Remove simpler proven-absent/unknown-delivery, synchronous double-trigger and exit-cleanup examples from the stale-leaf source. Retain controlled waiter-versus-probe races, queued-row progression, same-ID stale-Enter cancellation and orphaned-snapshot fences. Provider/process observations and database rows in this source are supplied, not actual process absence or SQLite delivery durability. Preserve the independent five-case SQLite/CLI receipt only at its unchanged command. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed." + "Audit2003: Remove simpler proven-absent/unknown-delivery, synchronous double-trigger and exit-cleanup examples from the stale-leaf source. Retain controlled waiter-versus-probe races, queued-row progression, same-ID stale-Enter cancellation and orphaned-snapshot fences. Provider/process observations and database rows in this source are supplied, not actual process absence or SQLite delivery durability. Preserve the independent five-case SQLite/CLI receipt only at its unchanged command. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed.", + "Audit2052 (source2049): The ordinary orca-runtime.test.ts registrar drops seven imports of deliberately deleted low-value runtime suites. Their mock capability/agent-presence/environment/title/deduplication and batching alarms are intentionally lost without replacement; remaining imports retain their original order. The runtime handle-contract registrar separately drops the deleted tab-collision registration. Unrelated dated evidenceRuns remain unchanged and do not validate reduced-source bytes or selectors. No fresh gate execution or historical import-closure equivalence is claimed." ], "demotionRule": "Demote or quarantine if the deterministic oracle flakes without a product or harness bug owned by orchestration." }, @@ -11580,7 +11592,8 @@ "Audit1983 historical original evidenceRuns object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n{\n \"date\": \"2026-08-03\",\n \"runner\": \"local\",\n \"platform\": \"macos\",\n \"command\": \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/orchestration-runtime-update-settlement.test.ts --reporter=dot\",\n \"result\": \"failed\",\n \"durationSeconds\": 3.07,\n \"summary\": \"The byte-identical 5f45c270f1 oracle, applied as the sole tree overlay in 063340a8ba on origin/main@34291f07e9, failed 3 of 5 rows: completion remained dispatched, takeover lacked a stable pane, and remote attachment authority lost process identity.\"\n }", "Audit1983 historical original evidenceRuns object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n{\n \"date\": \"2026-08-03\",\n \"runner\": \"local\",\n \"platform\": \"macos\",\n \"command\": \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/orchestration-runtime-update-settlement.test.ts --reporter=dot\",\n \"result\": \"passed\",\n \"durationSeconds\": 3.13,\n \"summary\": \"The same byte-identical oracle passed 5 tests on candidate@2748b0b29b, exercising the production verifier and fresh-runtime replay while preserving exact DB identity and unchanged fixture bytes.\"\n }", "Audit1983 historical original evidenceRuns object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n{\n \"date\": \"2026-08-03\",\n \"runner\": \"local\",\n \"platform\": \"macos\",\n \"command\": \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/orchestration-runtime-update-settlement.test.ts --reporter=dot\",\n \"result\": \"failed\",\n \"durationSeconds\": 3.14,\n \"summary\": \"With current-authority propagation actually disabled in candidate child 08a7db37bf, the same byte-identical oracle failed 2 of 5 rows: completion remained dispatched and remote attachment authority was rejected.\"\n }", - "Audit1983 historical original evidenceRuns object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n{\n \"date\": \"2026-08-03\",\n \"runner\": \"local\",\n \"platform\": \"macos\",\n \"command\": \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/orchestration-runtime-update-settlement.test.ts --reporter=dot\",\n \"result\": \"passed\",\n \"durationSeconds\": 3.1,\n \"summary\": \"After reverting the intentional break in d2a4e2e024, the same byte-identical oracle passed all 5 tests.\"\n }" + "Audit1983 historical original evidenceRuns object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n{\n \"date\": \"2026-08-03\",\n \"runner\": \"local\",\n \"platform\": \"macos\",\n \"command\": \"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/orchestration-runtime-update-settlement.test.ts --reporter=dot\",\n \"result\": \"passed\",\n \"durationSeconds\": 3.1,\n \"summary\": \"After reverting the intentional break in d2a4e2e024, the same byte-identical oracle passed all 5 tests.\"\n }", + "Audit2052 (source2049): The ordinary orca-runtime.test.ts registrar drops seven imports of deliberately deleted low-value runtime suites. Their mock capability/agent-presence/environment/title/deduplication and batching alarms are intentionally lost without replacement; remaining imports retain their original order. The runtime handle-contract registrar separately drops the deleted tab-collision registration. Unrelated dated evidenceRuns remain unchanged and do not validate reduced-source bytes or selectors. No fresh gate execution or historical import-closure equivalence is claimed." ], "demotionRule": "Keep experimental or demote if either Electron journey flakes without a product or harness defect, if local worker-start can return before tab materialization without an explicit reveal warning, if focus moves to the worker, if restart or workspace re-entry spawns/resumes/duplicates/interferes with the worker, if retained output becomes unreadable, or if pane-stable delivery reads the wrong mailbox." }, @@ -13797,7 +13810,8 @@ "Audit1973 historical original commands object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n\"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/methods/files/files-watch-cleanup.test.ts --reporter=dot\"", "Audit1973 historical original testFiles object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n\"src/main/runtime/rpc/methods/files/files-watch-cleanup.test.ts\"", "Audit1973 historical original assertionRefs object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n{\n \"file\": \"src/main/runtime/rpc/methods/files/files-watch-cleanup.test.ts\",\n \"assertions\": [\n \"a failed paired-web unwatch retries after already-resolved or late physical exit and emits stream end exactly once\"\n ]\n }", - "Audit1973 historical original assertionRefs object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n{\n \"file\": \"src/main/runtime/rpc/methods/files/files.test.ts\",\n \"assertions\": [\n \"pre-ready transport abort reaches RuntimeFileCommands as the owning AbortSignal\",\n \"terminal watcher loss flushes a final overflow change before error/end and unregisters cleanup\"\n ]\n }" + "Audit1973 historical original assertionRefs object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n{\n \"file\": \"src/main/runtime/rpc/methods/files/files.test.ts\",\n \"assertions\": [\n \"pre-ready transport abort reaches RuntimeFileCommands as the owning AbortSignal\",\n \"terminal watcher loss flushes a final overflow change before error/end and unregisters cleanup\"\n ]\n }", + "Audit2052 (source2049): The ordinary orca-runtime.test.ts registrar drops seven imports of deliberately deleted low-value runtime suites. Their mock capability/agent-presence/environment/title/deduplication and batching alarms are intentionally lost without replacement; remaining imports retain their original order. The runtime handle-contract registrar separately drops the deleted tab-collision registration. Unrelated dated evidenceRuns remain unchanged and do not validate reduced-source bytes or selectors. No fresh gate execution or historical import-closure equivalence is claimed." ], "demotionRule": "Demote or quarantine if the fault harness flakes without a product or harness bug, if healthy operation exceeds one runtime watcher child, if total physical operation exceeds eight children including retiring generations, if quarantine children outlive their roots or repeat after fusing, if event delivery becomes unbounded, or if metadata/stat work returns to the serve process." }, @@ -14460,15 +14474,15 @@ "providers": ["local"], "coveredPlatforms": ["macos"], "coveredProviders": ["local"], - "coverageNotes": "Audit1931 (sources1928/1929): Delete complete transport-unmount and queued-initial-CWD helper suites: despite lifecycle-shaped fixtures, the unmount owner returns a Boolean PTY-id predicate, while CWD cases check nullish field selection and callback counts. Lose their detach/destroy/teardown and one-shot-CWD supplied examples. Partial queued-pane-startup loses three identical/empty/nonowner identity examples, retaining four exact one-shot/replacement ownership callbacks. No assertion object maps to these three sources, so unrelated alias objects remain byte-exact. Preserve the current81ed prior removal of pane-split-startup; stale bd948 source metadata snapshots are not replayed. No actual process/PTY startup, transport shutdown, live SSH or rendered recovery is proven by this metadata change. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Delete the complete pane-split-startup wrapper suite and selector. Its temporary dependency-field exposure/reset, sequential payload isolation and thrown-sentinel cleanup alarms are lost; no quick command, process or PTY startup was exercised by those callbacks. Remaining queued-startup/ownership sources are not equivalent replacements. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1903 removes whole mocked detach, supplied geometry and/or close-request suites selected by this gate. Their pending-CWD/PTY-binding argument/order, fabricated hit-test and close bookkeeping alarms are intentionally lost without replacement. Valid remaining selectors/assertions and unchanged-selector execution receipts retain their original scope. Reduced unit selections have no fresh broad gate, real PTY/provider, rendered focus, or measured-budget validation. Historical prior account (preserved verbatim): A forced pre-spawn barrier makes one visible Quick Command cross a recovery remount before its successor PTY binds. Lifecycle contracts retain lower-layer ownership; the Electron sentinel adds the rendered affordance, real PTY, exact-once terminal marker, staged identity file, and unrelated sibling canary. The test-value audit removed the store examples for retaining an undelivered queued startup command across remount, distinct queued ownership, sibling-bind preservation, unspawned close, and sibling queue isolation. The remaining store cases exercise recovery admission/settlement and non-replay after consumption; neither covers an undelivered command. The store suite is retired from this gate. Retained lifecycle and historical Electron evidence do not establish equivalent replacement coverage; historical commands and results remain historical. Audit1743 removes the standalone line-height clamp/default and pane cwd fallback helper tests (5 authored cases). These trivial-helper alarms are intentionally lost, with no equivalent replacement. Only current commands/testFiles lose the deleted selectors; historical receipts and evidenceRuns remain unchanged and do not validate the reduced commands.", + "coverageNotes": "Audit2052 (sources2049/2050/2051): Remove complete low-value restored-pane-title and pane-visibility-identity suites and their current selectors. Their supplied snapshot/title and nullable identity-comparison alarms are intentionally lost without replacement. Unrelated dated evidenceRuns remain unchanged and do not validate the reduced commands. No fresh gate execution, actual PTY/provider, rendered, remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete complete transport-unmount and queued-initial-CWD helper suites: despite lifecycle-shaped fixtures, the unmount owner returns a Boolean PTY-id predicate, while CWD cases check nullish field selection and callback counts. Lose their detach/destroy/teardown and one-shot-CWD supplied examples. Partial queued-pane-startup loses three identical/empty/nonowner identity examples, retaining four exact one-shot/replacement ownership callbacks. No assertion object maps to these three sources, so unrelated alias objects remain byte-exact. Preserve the current81ed prior removal of pane-split-startup; stale bd948 source metadata snapshots are not replayed. No actual process/PTY startup, transport shutdown, live SSH or rendered recovery is proven by this metadata change. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Delete the complete pane-split-startup wrapper suite and selector. Its temporary dependency-field exposure/reset, sequential payload isolation and thrown-sentinel cleanup alarms are lost; no quick command, process or PTY startup was exercised by those callbacks. Remaining queued-startup/ownership sources are not equivalent replacements. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1903 removes whole mocked detach, supplied geometry and/or close-request suites selected by this gate. Their pending-CWD/PTY-binding argument/order, fabricated hit-test and close bookkeeping alarms are intentionally lost without replacement. Valid remaining selectors/assertions and unchanged-selector execution receipts retain their original scope. Reduced unit selections have no fresh broad gate, real PTY/provider, rendered focus, or measured-budget validation. Historical prior account (preserved verbatim): A forced pre-spawn barrier makes one visible Quick Command cross a recovery remount before its successor PTY binds. Lifecycle contracts retain lower-layer ownership; the Electron sentinel adds the rendered affordance, real PTY, exact-once terminal marker, staged identity file, and unrelated sibling canary. The test-value audit removed the store examples for retaining an undelivered queued startup command across remount, distinct queued ownership, sibling-bind preservation, unspawned close, and sibling queue isolation. The remaining store cases exercise recovery admission/settlement and non-replay after consumption; neither covers an undelivered command. The store suite is retired from this gate. Retained lifecycle and historical Electron evidence do not establish equivalent replacement coverage; historical commands and results remain historical. Audit1743 removes the standalone line-height clamp/default and pane cwd fallback helper tests (5 authored cases). These trivial-helper alarms are intentionally lost, with no equivalent replacement. Only current commands/testFiles lose the deleted selectors; historical receipts and evidenceRuns remain unchanged and do not validate the reduced commands.", "motivatingLinks": [ "https://linear.app/stably/issue/STA-4876", "https://github.com/stablyai/orca/pull/15630" ], "invariant": "A Quick Command selected for a new terminal remains owned by that tab through a recovery remount, executes exactly once only after the successor PTY binds, and never reaches an unrelated terminal.", - "oracle": "Audit1931 (sources1928/1929): Delete complete transport-unmount and queued-initial-CWD helper suites: despite lifecycle-shaped fixtures, the unmount owner returns a Boolean PTY-id predicate, while CWD cases check nullish field selection and callback counts. Lose their detach/destroy/teardown and one-shot-CWD supplied examples. Partial queued-pane-startup loses three identical/empty/nonowner identity examples, retaining four exact one-shot/replacement ownership callbacks. No assertion object maps to these three sources, so unrelated alias objects remain byte-exact. Preserve the current81ed prior removal of pane-split-startup; stale bd948 source metadata snapshots are not replayed. No actual process/PTY startup, transport shutdown, live SSH or rendered recovery is proven by this metadata change. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Delete the complete pane-split-startup wrapper suite and selector. Its temporary dependency-field exposure/reset, sequential payload isolation and thrown-sentinel cleanup alarms are lost; no quick command, process or PTY startup was exercised by those callbacks. Remaining queued-startup/ownership sources are not equivalent replacements. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1903 removes whole mocked detach, supplied geometry and/or close-request suites selected by this gate. Their pending-CWD/PTY-binding argument/order, fabricated hit-test and close bookkeeping alarms are intentionally lost without replacement. Valid remaining selectors/assertions and unchanged-selector execution receipts retain their original scope. Reduced unit selections have no fresh broad gate, real PTY/provider, rendered focus, or measured-budget validation. Historical prior account (preserved verbatim): Arm the E2E-only pre-spawn barrier, click the visible Quick Command, force one recovery generation while the original spawn is blocked, and release it. Require one exact semantic xterm marker, an independently written pane/tab identity file matching the bound live PTY, queue consumption only after bind, and a live interactive sibling canary.", + "oracle": "Audit2052 (sources2049/2050/2051): Remove complete low-value restored-pane-title and pane-visibility-identity suites and their current selectors. Their supplied snapshot/title and nullable identity-comparison alarms are intentionally lost without replacement. Unrelated dated evidenceRuns remain unchanged and do not validate the reduced commands. No fresh gate execution, actual PTY/provider, rendered, remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete complete transport-unmount and queued-initial-CWD helper suites: despite lifecycle-shaped fixtures, the unmount owner returns a Boolean PTY-id predicate, while CWD cases check nullish field selection and callback counts. Lose their detach/destroy/teardown and one-shot-CWD supplied examples. Partial queued-pane-startup loses three identical/empty/nonowner identity examples, retaining four exact one-shot/replacement ownership callbacks. No assertion object maps to these three sources, so unrelated alias objects remain byte-exact. Preserve the current81ed prior removal of pane-split-startup; stale bd948 source metadata snapshots are not replayed. No actual process/PTY startup, transport shutdown, live SSH or rendered recovery is proven by this metadata change. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Delete the complete pane-split-startup wrapper suite and selector. Its temporary dependency-field exposure/reset, sequential payload isolation and thrown-sentinel cleanup alarms are lost; no quick command, process or PTY startup was exercised by those callbacks. Remaining queued-startup/ownership sources are not equivalent replacements. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1903 removes whole mocked detach, supplied geometry and/or close-request suites selected by this gate. Their pending-CWD/PTY-binding argument/order, fabricated hit-test and close bookkeeping alarms are intentionally lost without replacement. Valid remaining selectors/assertions and unchanged-selector execution receipts retain their original scope. Reduced unit selections have no fresh broad gate, real PTY/provider, rendered focus, or measured-budget validation. Historical prior account (preserved verbatim): Arm the E2E-only pre-spawn barrier, click the visible Quick Command, force one recovery generation while the original spawn is blocked, and release it. Require one exact semantic xterm marker, an independently written pane/tab identity file matching the bound live PTY, queue consumption only after bind, and a live interactive sibling canary.", "commands": [ - "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-connection/host-ownership/pty-connection-owner-hydration-backend-retention.test.ts src/renderer/src/components/terminal-pane/pty-connection/startup/pty-connection-queued-startup-consume.test.ts src/renderer/src/components/terminal-pane/mounting/queued-pane-startup.test.ts src/renderer/src/components/terminal-pane/parking/one-shot-park-replay.test.ts src/renderer/src/components/terminal-pane/titles/restored-pane-titles.test.ts src/renderer/src/components/terminal-pane/viewport/pane-visibility-identity.test.ts --reporter=dot", + "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-connection/host-ownership/pty-connection-owner-hydration-backend-retention.test.ts src/renderer/src/components/terminal-pane/pty-connection/startup/pty-connection-queued-startup-consume.test.ts src/renderer/src/components/terminal-pane/mounting/queued-pane-startup.test.ts src/renderer/src/components/terminal-pane/parking/one-shot-park-replay.test.ts --reporter=dot", "pnpm exec playwright test tests/e2e/terminal-quick-command-pre-bind-recovery.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1", "ORCA_E2E_FORCE_HEADFUL=1 SKIP_BUILD=1 pnpm exec playwright test tests/e2e/terminal-quick-command-pre-bind-recovery.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1" ], @@ -14477,8 +14491,6 @@ "src/renderer/src/components/terminal-pane/pty-connection/startup/pty-connection-queued-startup-consume.test.ts", "src/renderer/src/components/terminal-pane/mounting/queued-pane-startup.test.ts", "src/renderer/src/components/terminal-pane/parking/one-shot-park-replay.test.ts", - "src/renderer/src/components/terminal-pane/titles/restored-pane-titles.test.ts", - "src/renderer/src/components/terminal-pane/viewport/pane-visibility-identity.test.ts", "tests/e2e/terminal-quick-command-pre-bind-recovery.spec.ts" ], "assertionRefs": [ @@ -14539,7 +14551,8 @@ "Audit1880 removes the entire mounted-terminal-scrollback.test.ts suite. Its direct fake-terminal scrollback option-assignment and repeated-value write-budget alarm is intentionally lost; no actual xterm output-retention or equivalent replacement coverage is claimed. Only its exact tokens in current commands and its testFiles entry are removed. Existing unrelated dated receipts, their raw objects and platform/provider accounting remain unchanged; they do not validate the reduced command selector.", "Audit1903 removes whole mocked detach, supplied geometry and/or close-request suites selected by this gate. Their pending-CWD/PTY-binding argument/order, fabricated hit-test and close bookkeeping alarms are intentionally lost without replacement. Valid remaining selectors/assertions and unchanged-selector execution receipts retain their original scope. Reduced unit selections have no fresh broad gate, real PTY/provider, rendered focus, or measured-budget validation. Exact lost direct alarms: 'detaches a rolled-back split surface without closing its PTY'; \"closes a tab through its last pane with the requester's reason, never an implied user close\"; 'uses non-destructive tab close semantics for the last rolled-back pane'; 'ignores a delayed rollback after the pane PTY identity changed'; 'retires a mounted rollback pane without detaching it as a movable surface'; 'retires mounted authority and binding while preserving the process and sleeping fence'; 'suppresses the pane PTY exit before intentional close teardown destroys the transport'; 'does not suppress natural PTY exits that already cleared the transport id'.", "Audit1925 (sources1922/1923): Delete the complete pane-split-startup wrapper suite and selector. Its temporary dependency-field exposure/reset, sequential payload isolation and thrown-sentinel cleanup alarms are lost; no quick command, process or PTY startup was exercised by those callbacks. Remaining queued-startup/ownership sources are not equivalent replacements. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Exact retired authored alarms: 'only exposes startup to the intentional split and clears it afterwards'; 'isolates startup payloads across sequential calls (setup then issue)'; 'clears startup even when splitPane throws'.", - "Audit1931 (sources1928/1929): Delete complete transport-unmount and queued-initial-CWD helper suites: despite lifecycle-shaped fixtures, the unmount owner returns a Boolean PTY-id predicate, while CWD cases check nullish field selection and callback counts. Lose their detach/destroy/teardown and one-shot-CWD supplied examples. Partial queued-pane-startup loses three identical/empty/nonowner identity examples, retaining four exact one-shot/replacement ownership callbacks. No assertion object maps to these three sources, so unrelated alias objects remain byte-exact. Preserve the current81ed prior removal of pane-split-startup; stale bd948 source metadata snapshots are not replayed. No actual process/PTY startup, transport shutdown, live SSH or rendered recovery is proven by this metadata change. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Exact retired authored alarms: 'detaches when the tab still owns the transport PTY'; 'detaches when a mirrored replacement tab owns the same PTY'; 'detaches when closeTab already owns provider shutdown for the removed tab'; 'destroys an ID-less transport so a pending spawn cannot outlive unmount'; 'detaches a removed automation pane after closeTab takes teardown authority'; 'consumes the queued initial cwd once when the ref is unset'; 'reuses the existing queued state without re-reading the store'; 'clears the one-shot cwd and restores the default cwd after the first pane'; 'leaves the cwd unchanged when no one-shot override is queued'; 'denies ownership to a split payload structurally identical to the queued command'; 'denies ownership when the tab queued nothing, so an unrelated pane cannot spend a slot'; 'withholds the consumer from a pane that does not own the queued command'." + "Audit1931 (sources1928/1929): Delete complete transport-unmount and queued-initial-CWD helper suites: despite lifecycle-shaped fixtures, the unmount owner returns a Boolean PTY-id predicate, while CWD cases check nullish field selection and callback counts. Lose their detach/destroy/teardown and one-shot-CWD supplied examples. Partial queued-pane-startup loses three identical/empty/nonowner identity examples, retaining four exact one-shot/replacement ownership callbacks. No assertion object maps to these three sources, so unrelated alias objects remain byte-exact. Preserve the current81ed prior removal of pane-split-startup; stale bd948 source metadata snapshots are not replayed. No actual process/PTY startup, transport shutdown, live SSH or rendered recovery is proven by this metadata change. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Exact retired authored alarms: 'detaches when the tab still owns the transport PTY'; 'detaches when a mirrored replacement tab owns the same PTY'; 'detaches when closeTab already owns provider shutdown for the removed tab'; 'destroys an ID-less transport so a pending spawn cannot outlive unmount'; 'detaches a removed automation pane after closeTab takes teardown authority'; 'consumes the queued initial cwd once when the ref is unset'; 'reuses the existing queued state without re-reading the store'; 'clears the one-shot cwd and restores the default cwd after the first pane'; 'leaves the cwd unchanged when no one-shot override is queued'; 'denies ownership to a split payload structurally identical to the queued command'; 'denies ownership when the tab queued nothing, so an unrelated pane cannot spend a slot'; 'withholds the consumer from a pane that does not own the queued command'.", + "Audit2052 (sources2049/2050/2051): Remove complete low-value restored-pane-title and pane-visibility-identity suites and their current selectors. Their supplied snapshot/title and nullable identity-comparison alarms are intentionally lost without replacement. Unrelated dated evidenceRuns remain unchanged and do not validate the reduced commands. No fresh gate execution, actual PTY/provider, rendered, remote/mobile or cross-platform result is claimed." ], "demotionRule": "Demote if the barrier can be bypassed nondeterministically, either independent oracle is removed, the sibling canary is no longer isolated, or one unexplained flake occurs." }, @@ -15567,7 +15580,8 @@ "Audit1973: Remove lower-level scalar lifecycle examples while retaining durable completion/restart/replay and the independent Electron recovery receipt. Existing broad prospective command remains prospective only. Whole original changed dated receipts are retired, never narrowed or transferred. This metadata review claims no fresh execution, equivalent replacement, provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result.", "Audit1991: Remove one-inventory/100-candidate and per-pass workspace lookup-count aliases, foreign-provider timer-call counts, and the ten-minute settled-worker/empty-batch budget sample. Narrow broad inventory/incarnation/probe aliases to retained missing-membership, restarted-relay uncertainty and explicit owning-host absence-verdict callbacks. Remove rollback clone/snapshot-call budgets and supplied persistence microvariants; retain the held-write failure rollback callback that preserves concurrent in-place edits at an injected writer seam, without claiming actual disk durability. Retain late provider recovery and host timer cancellation callbacks. Preserve the independent six-journey Electron restart receipt exactly; its result does not validate these reduced runtime selectors. Historical performance and red/green observations remain historical rather than fresh measurements. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed.", "Audit1991 historical original assertionRefs object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n{\n \"file\": \"src/main/runtime/runtime-legacy-worker-terminal-recovery-retry.test.ts\",\n \"assertions\": [\n \"late provider availability recovers automatically after two minutes\",\n \"ten minutes of unresolved retries never revisit settled workers or persist empty batches\",\n \"every host timer remains cancellable during extended recovery\"\n ]\n }", - "Audit1991 historical original assertionRefs object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n{\n \"file\": \"src/main/runtime/runtime-legacy-worker-missing-workspace-recovery.test.ts\",\n \"assertions\": [\n \"100 deleted git or folder workspace candidates use one owning-provider inventory\",\n \"100 workers sharing a workspace resolve it once per pass; the next pass rechecks both git and folder workspaces\",\n \"live PTYs without scoped membership or verified incarnation remain deferred\",\n \"local inventory and restarted relay inventory never prove SSH worker exit\",\n \"SSH cleanup requires an explicit owning-host absence verdict; probe failures preserve uncertainty\",\n \"foreign provider identities do not start local recovery timers\"\n ]\n }" + "Audit1991 historical original assertionRefs object, preserved verbatim; retired objects are not active execution evidence or replacement coverage:\n{\n \"file\": \"src/main/runtime/runtime-legacy-worker-missing-workspace-recovery.test.ts\",\n \"assertions\": [\n \"100 deleted git or folder workspace candidates use one owning-provider inventory\",\n \"100 workers sharing a workspace resolve it once per pass; the next pass rechecks both git and folder workspaces\",\n \"live PTYs without scoped membership or verified incarnation remain deferred\",\n \"local inventory and restarted relay inventory never prove SSH worker exit\",\n \"SSH cleanup requires an explicit owning-host absence verdict; probe failures preserve uncertainty\",\n \"foreign provider identities do not start local recovery timers\"\n ]\n }", + "Audit2052 (source2049): The ordinary orca-runtime.test.ts registrar drops seven imports of deliberately deleted low-value runtime suites. Their mock capability/agent-presence/environment/title/deduplication and batching alarms are intentionally lost without replacement; remaining imports retain their original order. The runtime handle-contract registrar separately drops the deleted tab-collision registration. Unrelated dated evidenceRuns remain unchanged and do not validate reduced-source bytes or selectors. No fresh gate execution or historical import-closure equivalence is claimed." ], "promotionCriteria": [ "Collect cross-platform and provider soak evidence with no weakened identity, transaction or bounded-work assertions." diff --git a/config/scripts/ci/sharding/ci-shard-timings.json b/config/scripts/ci/sharding/ci-shard-timings.json index 02cc66d15f0..87f340f60f1 100644 --- a/config/scripts/ci/sharding/ci-shard-timings.json +++ b/config/scripts/ci/sharding/ci-shard-timings.json @@ -3953,7 +3953,6 @@ "src/main/runtime/integrations/linear/runtime-linear-write-lifetime.test.ts": 512, "src/main/runtime/workspaces/creation/runtime-local-worktree-create-pr-conflict.test.ts": 462, "src/main/runtime/workspaces/creation/runtime-local-worktree-create.test.ts": 693, - "src/main/runtime/workspaces/startup/runtime-local-worktree-terminal-startup-layout-owner.test.ts": 76, "src/main/runtime/workspaces/startup/runtime-local-worktree-terminal-startup.test.ts": 79, "src/main/runtime/workspaces/metadata/runtime-managed-worktree-metadata-sweep.test.ts": 1812, "src/main/runtime/workspaces/metadata/runtime-managed-worktree-metadata-wsl-move.test.ts": 1812, @@ -4165,8 +4164,6 @@ "src/main/runtime/workspace-session-membership-scaling.test.ts": 72, "src/main/runtime/workspaces/persisted-surfaces/live-terminal-placement-before-initial-tab.test.ts": 6111, "src/main/runtime/workspaces/persisted-surfaces/sweep-terminal-placement.test.ts": 12352, - "src/main/runtime/workspaces/sleep/remote-workspace-terminal-sleep.test.ts": 46, - "src/main/runtime/workspaces/workspace-host-notifications.test.ts": 4332, "src/main/runtime/workspaces/lifecycle/workspace-lifecycle-queue.test.ts": 116, "src/main/runtime/workspaces/sleep/workspace-sleep-execution.test.ts": 110, "src/main/runtime/workspaces/startup/worktree-agent-first-surface.test.ts": 5816, @@ -4183,11 +4180,9 @@ "src/main/runtime/workspaces/sleep/worktree-terminal-sleep-host-twin.test.ts": 4345, "src/main/runtime/wsl-distro-loss-exit-retention.test.ts": 5519, "src/main/runtime/wsl-guest-drive-mountinfo.test.ts": 38, - "src/main/runtime/wsl-held-pane-start-layout-owner.test.ts": 3969, "src/main/runtime/wsl-host-agent-launch-paths.test.ts": 4079, "src/main/runtime/wsl-host-agent-terminal-launch.test.ts": 850, "src/main/runtime/wsl-host-windows-drive-backstop.test.ts": 868, - "src/main/runtime/wsl-host-windows-drive-guard.test.ts": 107, "src/main/runtime/wsl-moved-project-chat-runtime.test.ts": 5094, "src/main/updater/serve-update-handoff.test.ts": 62, "src/main/server/serve-readiness.test.ts": 52, @@ -4313,7 +4308,6 @@ "src/main/speech/speech-model-download-response.test.ts": 44, "src/main/speech/stt-offline-audio-chunker.test.ts": 233, "src/main/speech/stt-service.test.ts": 143, - "src/main/speech/stt-worker-paths.test.ts": 47, "src/main/speech/stt-worker.test.ts": 33, "src/main/sqlite/node-sqlite-reader-api.test.ts": 62, "src/main/sqlite/sqlite-read-failure.test.ts": 81, @@ -4365,7 +4359,6 @@ "src/main/ssh/legacy-relay/legacy-relay-bridge-relay-restart.test.ts": 98, "src/main/ssh/legacy-relay/legacy-relay-bridge-restart-stop.test.ts": 3114, "src/main/ssh/legacy-relay/legacy-relay-bridge-runtime-exit.test.ts": 3411, - "src/main/ssh/legacy-relay/legacy-relay-bridge-teardown.test.ts": 3075, "src/main/ssh/legacy-relay/legacy-relay-bridge-timers.test.ts": 41, "src/main/ssh/legacy-relay/legacy-relay-cli-call-limits.test.ts": 7977, "src/main/ssh/legacy-relay/legacy-relay-cli-legacy-records.test.ts": 6234, @@ -4680,7 +4673,6 @@ "src/main/window/clipboard-agent-session-attachment-paste.test.ts": 585, "src/main/window/clipboard-copied-file-paths.test.ts": 58, "src/main/window/clipboard-dashboard-popout-access.test.ts": 1361, - "src/main/window/clipboard-image-thumbnail.test.ts": 50, "src/main/window/clipboard-ipc-handlers.test.ts": 496, "src/main/window/clipboard-macos-image-paste.test.ts": 1087, "src/main/window/clipboard-publisher-executable.test.ts": 62, @@ -6130,7 +6122,6 @@ "src/renderer/src/components/terminal-pane/titles/TerminalPaneHeaderOverlay.test.tsx": 1104, "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/recovery/TerminalPaneRecoveryPortals.test.tsx": 670, "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/recovery/TerminalRemoteRuntimeReconnectBanner.test.tsx": 812, - "src/renderer/src/components/terminal-pane/session-restore/spawn-deferral/TerminalSleepingPaneOverlay.test.tsx": 407, "src/renderer/src/components/terminal-pane/pty-transport/recovery/ssh/TerminalSshReconnectOverlay.test.tsx": 2354, "src/renderer/src/components/terminal-pane/account-restart/detached/account-restart-queue-progress.test.ts": 1988, "src/renderer/src/components/terminal-pane/agent-completion/agent-completion-coordinator-attention-dispatch.test.ts": 301, @@ -6147,7 +6138,6 @@ "src/renderer/src/components/terminal-pane/agent-status/input-inference/agent-interrupt-inference.test.ts": 146, "src/renderer/src/components/terminal-pane/pty-connection/startup/agent-pre-ready-typed-draft.test.ts": 1195, "src/renderer/src/components/terminal-pane/agent-completion/process-inspection/agent-process-inspection-queue-rejection-containment.test.ts": 56, - "src/renderer/src/components/terminal-pane/titles/cache-timer-seeding.test.ts": 108, "src/renderer/src/components/terminal-pane/account-restart/detached/claude-detached-pane-restart.test.ts": 1938, "src/renderer/src/components/terminal-pane/provider-notices/claude-diff-panel/claude-diff-panel-notice-banner.test.tsx": 1986, "src/renderer/src/components/terminal-pane/notifications/claude-side-question-completion.test.ts": 2305, @@ -6179,7 +6169,6 @@ "src/renderer/src/components/terminal-pane/pty-connection/agent-identity/foreground-process/pane-foreground-agent-tracker.test.ts": 486, "src/renderer/src/components/terminal-pane/pty-connection/agent-identity/foreground-process/pane-foreground-inspect-observation-identity.test.ts": 226, "src/renderer/src/components/terminal-pane/pty-connection/agent-identity/foreground-process/pane-foreground-process-exit-retire.test.ts": 329, - "src/renderer/src/components/terminal-pane/titles/pane-title-overlay-rects.test.ts": 58, "src/renderer/src/components/sidebar/workspace-card/activity/structured-chat-activity-status-live.test.tsx": 4146, "src/renderer/src/components/terminal-pane/parking/output-watchers/parked-terminal-byte-watcher.test.ts": 2837, "src/renderer/src/components/terminal-pane/parking/output-watchers/parked-terminal-command-status.test.ts": 352, @@ -6281,7 +6270,6 @@ "src/renderer/src/components/terminal-pane/pty-connection/geometry/remote-reconnect-unimaged-pane-redraw.test.ts": 3122, "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-connect-failure-recovery.test.ts": 989, "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-disconnected-input-grace-retry.test.ts": 1366, - "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/input/remote-runtime-disconnected-input-grace.test.ts": 41, "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-error-surface-dismissal.test.ts": 956, "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/input/remote-runtime-input-journal.test.ts": 69, "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-outage-toast-flood-and-stuck-reconnect.test.ts": 1269, @@ -6334,9 +6322,7 @@ "src/renderer/src/components/terminal-pane/snapshots/remote-snapshot-history-seam.test.ts": 2093, "src/renderer/src/components/terminal-pane/snapshots/replay-guard.test.ts": 371, "src/renderer/src/components/terminal-pane/layout/split/resolve-split-cwd.test.ts": 56, - "src/renderer/src/components/terminal-pane/snapshots/restored-snapshot-coverage.test.ts": 44, "src/renderer/src/components/terminal-pane/pty-transport/ipc/scan22-ssh-new-tab-disposed-spawn-kill.repro.test.ts": 577, - "src/renderer/src/components/terminal-pane/snapshots/shutdown-buffer-captures.test.ts": 48, "src/renderer/src/components/terminal-pane/viewport/split-right-white-screen.test.ts": 53, "src/renderer/src/components/terminal-pane/viewport/visibility/stale-document-visibility.test.ts": 88, "src/renderer/src/components/terminal-pane/input/paste/terminal-agent-paste-bracketing.test.ts": 329, @@ -6404,7 +6390,6 @@ "src/renderer/src/components/terminal-pane/layout/reconciliation/terminal-pane-frame-reconciliation.test.ts": 903, "src/renderer/src/components/terminal-pane/host-state/terminal-pane-host-state-memo.test.ts": 4534, "src/renderer/src/components/terminal-pane/mounting/terminal-pane-mount-bootstrap.test.ts": 1723, - "src/renderer/src/components/terminal-pane/render-health/recovery/terminal-pane-recovery-host-rebind-cap.test.ts": 826, "src/renderer/src/components/terminal-pane/render-health/recovery/terminal-pane-recovery-unsettled-fallback.test.ts": 831, "src/renderer/src/components/terminal-pane/render-health/recovery/terminal-pane-recovery.test.ts": 949, "src/renderer/src/components/terminal-pane/layout/split/terminal-pane-split-request-routing.test.ts": 2015, @@ -6427,7 +6412,6 @@ "src/renderer/src/components/terminal-pane/snapshots/terminal-restore-sgr-latch.test.ts": 175, "src/shared/terminal/viewport/terminal-restored-viewport.test.ts": 46, "src/renderer/src/components/terminal-pane/terminal-resume-escape-gap.test.ts": 102, - "src/renderer/src/components/terminal-pane/viewport/terminal-selection-fit-guard.test.ts": 42, "src/renderer/src/components/terminal-pane/snapshots/terminal-shutdown-layout-capture.test.ts": 197, "src/renderer/src/components/terminal-pane/pty-transport/output/terminal-side-effect-facts-handler.test.ts": 80, "src/renderer/src/components/terminal-pane/snapshots/terminal-snapshot-replay-paint.test.ts": 499, @@ -6685,7 +6669,6 @@ "src/renderer/src/lib/agent-session/launch/new-tab/agent-launch-caller-permissions.test.ts": 1267, "src/renderer/src/lib/agent-session/launch/new-tab/agent-launch-caller-prompt-transport.test.ts": 1326, "src/renderer/src/lib/agent-session/launch/new-tab/agent-launch-caller-routing.test.ts": 1266, - "src/renderer/src/lib/agent-session/launch/pane/agent-launch-pane-start.test.ts": 55, "src/renderer/src/lib/agent-session/launch/pane/agent-launch-pane-verdict-application.test.ts": 1869, "src/renderer/src/lib/agent-session/launch/routing/agent-launch-route-input.test.ts": 1659, "src/renderer/src/lib/agent-session/launch/routing/agent-launch-route-registered-agents.test.ts": 1749, @@ -6734,7 +6717,6 @@ "src/renderer/src/lib/automation-session-reuse.test.ts": 70, "src/renderer/src/lib/automation-terminal-ownership.test.ts": 1795, "src/renderer/src/lib/bounded-generation-map.test.ts": 35, - "src/renderer/src/lib/browser/cookies/browser-cookie-import-error-copy.test.ts": 370, "src/renderer/src/lib/browser/history/browser-history-match.test.ts": 328, "src/renderer/src/lib/browser/navigation/browser-link-destination.test.ts": 1839, "src/renderer/src/lib/browser/navigation/browser-link-open-layout-owner.test.ts": 3133, @@ -6781,7 +6763,6 @@ "src/renderer/src/lib/feedback-image-attachments.test.ts": 557, "src/renderer/src/lib/file-preview-link-open.test.ts": 2311, "src/renderer/src/lib/file-search-selection.test.ts": 51, - "src/renderer/src/lib/file-type-icons.test.ts": 147, "src/renderer/src/lib/find-query-bounds.test.ts": 45, "src/renderer/src/lib/finished-agent-resume-resurrection.test.ts": 1872, "src/renderer/src/lib/fix-checks-agent-launch.test.ts": 730, @@ -6966,7 +6947,6 @@ "src/renderer/src/lib/sidebar-ended-creations.test.ts": 1889, "src/renderer/src/lib/sidebar-pending-layer.test.ts": 338, "src/renderer/src/lib/sidebar-shadow/workspace-activity-shadow.test.ts": 1728, - "src/renderer/src/lib/sidebar-worktree-activation.test.ts": 212, "src/renderer/src/lib/simulator-launch-coordination.test.ts": 43, "src/renderer/src/lib/simulator-palette-search.test.ts": 515, "src/renderer/src/lib/simulator-pane-shutdown-scheduler.test.ts": 1679, @@ -7055,7 +7035,6 @@ "src/renderer/src/runtime/divider-ratio-refusal.test.ts": 2212, "src/renderer/src/runtime/editor-buffer-dirty-readers.test.ts": 1892, "src/renderer/src/runtime/file-explorer-delete-owner-provenance.test.ts": 1878, - "src/renderer/src/runtime/hosted-terminals/mounted-surfaces/focus-runtime-terminal-surface-readiness.test.ts": 329, "src/renderer/src/runtime/host-model-catalog-snapshots.test.ts": 2348, "src/renderer/src/runtime/host-session-mirror-hydration-frame-ordering.test.tsx": 2469, "src/renderer/src/runtime/host-session-mirror-settle-receipt-frames.test.tsx": 2130, @@ -7097,7 +7076,6 @@ "src/renderer/src/runtime/jira/runtime-jira-image-client.test.ts": 214, "src/renderer/src/runtime/jira/runtime-jira-payload-stream.test.ts": 192, "src/renderer/src/runtime/runtime-layout-client.test.ts": 165, - "src/renderer/src/runtime/runtime-legacy-recent-freshness.test.ts": 453, "src/renderer/src/runtime/files/reads/runtime-paged-file-read.test.ts": 1705, "src/renderer/src/runtime/runtime-quick-open-version-compatibility.test.ts": 451, "src/renderer/src/runtime/rpc/calls/runtime-rpc-client.test.ts": 342, @@ -7466,7 +7444,6 @@ "src/renderer/src/store/slices/worktrees/listing/detected-worktree-meta.test.ts": 318, "src/renderer/src/store/slices/worktrees/listing/stale-listing-purges-created-worktree.test.ts": 1828, "src/renderer/src/store/slices/worktrees/metadata/worktree-meta-persist.test.ts": 361, - "src/renderer/src/store/slices/worktrees/session/worktree-no-op-notifications.test.ts": 1129, "src/renderer/src/store/slices/worktrees/teardown/host-qualified-removal-refusal.test.ts": 518, "src/renderer/src/store/slices/worktrees/teardown/remove-worktree-shared-records.test.ts": 2086, "src/renderer/src/store/slices/worktrees/teardown/removed-workspace-unsaved-files.test.ts": 2481, diff --git a/mobile/src/host-screen/host-view-changes-reconnect.test.ts b/mobile/src/host-screen/host-view-changes-reconnect.test.ts deleted file mode 100644 index f8c25970487..00000000000 --- a/mobile/src/host-screen/host-view-changes-reconnect.test.ts +++ /dev/null @@ -1,128 +0,0 @@ -import { createElement, type ReactElement } from 'react' -import { QueryClientProvider } from '@tanstack/react-query' -import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, describe, expect, it, vi } from 'vitest' - -vi.mock('../../../src/shared/sidebar-inputs-switch', () => ({ ORCA_SIDEBAR_INPUTS_IS_MAIN: true })) -vi.mock('react-native', () => ({ - AppState: { currentState: 'active', addEventListener: () => ({ remove: () => {} }) } -})) -vi.mock('expo-router', () => ({ useFocusEffect: () => {} })) -vi.mock('../storage/preferences', () => ({ savePinnedIds: async () => {} })) - -import { FakeSession } from '../transport/mobile-endpoint-supervisor-test-fakes' -import type { ConnectionState, RpcResponse } from '../transport/types' -import { useHostScreenState } from './use-host-screen-state' -import { useHostViewSettings } from './use-host-view-settings' -import { useHostWorktreeCatalog } from './use-host-worktree-catalog' -import { createOrcaQueryClient } from '../query/orca-query-client' - -function reply(result: unknown): RpcResponse { - return { id: 'reply', ok: true, result, _meta: { runtimeId: 'runtime' } } -} - -// Lose the first attempt of each write to exercise replay against the desktop’s recent sort and expanded state. -function desktop() { - const client = new FakeSession('connected') - const lost = new Set() - const writes: { method: string; params: unknown }[] = [] - client.sendRequest.mockImplementation(async (method: string, params: unknown) => { - if (method === 'ui.set' || method === 'ui.setCollapsed') { - writes.push({ method, params }) - if (!lost.has(method)) { - lost.add(method) - throw new Error('client_disconnected') - } - return reply(method === 'ui.set' ? { ui: {} } : { collapsed: true, applied: true }) - } - if (method === 'ui.get') { - return reply({ ui: { sortBy: 'recent', collapsedGroups: [] } }) - } - if (method === 'worktree.ps') { - return reply({ worktrees: [], snapshotId: 's1' }) - } - return reply({}) - }) - return { client, writes } -} - -const SIDEBAR_FEED = { refresh: () => {}, changed: () => {}, onInstalled: () => () => {} } -// Keep callbacks stable as in the screen; refresh lifecycle depends on their identities. -const NO_CAPABILITIES: string[] = [] - -let renderer: ReactTestRenderer | null = null - -afterEach(() => { - act(() => renderer?.unmount()) - renderer = null -}) - -async function mountScreen(client: FakeSession) { - const held: { - view?: ReturnType - state?: ReturnType - } = {} - function Probe({ connState }: { connState: ConnectionState }): null { - const state = useHostScreenState('host-1') - held.state = state - state.clientRef.current = client - const view = useHostViewSettings({ client, connState, state }) - held.view = view - useHostWorktreeCatalog({ - client, - connState, - embedded: true, - hostCapabilities: NO_CAPABILITIES, - hostId: 'host-1', - sidebarFeed: SIDEBAR_FEED, - state, - syncViewSettingsFromDesktop: view.syncViewSettingsFromDesktop - }) - return null - } - const queryClient = createOrcaQueryClient() - const screen = (connState: ConnectionState): ReactElement => - createElement(QueryClientProvider, { client: queryClient }, createElement(Probe, { connState })) - await act(async () => { - renderer = create(screen('connected')) - }) - return { - view: () => held.view!, - state: () => held.state!, - connect: async (connState: ConnectionState) => { - await act(async () => { - renderer!.update(screen(connState)) - }) - } - } -} - -describe('Workspace options changed while the connection drops', () => { - it('resends a sort and a collapse the desktop never got once the phone reconnects', async () => { - const { client, writes } = desktop() - const screen = await mountScreen(client) - await act(async () => { - screen.view().handleSortChange('name') - screen.view().toggleCollapsed('repo:orca') - }) - expect(screen.view().pendingViewChanges.pending).toHaveLength(2) - - await screen.connect('reconnecting') - await screen.connect('connected') - - expect(writes).toEqual([ - { method: 'ui.set', params: expect.objectContaining({ sortBy: 'name' }) }, - { - method: 'ui.setCollapsed', - params: expect.objectContaining({ key: 'repo:orca', collapsed: true }) - }, - { method: 'ui.set', params: expect.objectContaining({ sortBy: 'name' }) }, - { - method: 'ui.setCollapsed', - params: expect.objectContaining({ key: 'repo:orca', collapsed: true }) - } - ]) - expect(screen.state().view).toMatchObject({ sortBy: 'name', collapsedGroups: ['repo:orca'] }) - expect(screen.view().pendingViewChanges.pending).toEqual([]) - }) -}) diff --git a/mobile/src/host-screen/host-worktree-catalog-action-error.test.ts b/mobile/src/host-screen/host-worktree-catalog-action-error.test.ts deleted file mode 100644 index 47a006bb771..00000000000 --- a/mobile/src/host-screen/host-worktree-catalog-action-error.test.ts +++ /dev/null @@ -1,99 +0,0 @@ -import { createElement } from 'react' -import { QueryClientProvider } from '@tanstack/react-query' -import { act, create } from 'react-test-renderer' -import { describe, expect, it, vi } from 'vitest' - -// The desktop's server-list feed loads react-native; its timer never runs without a subscriber. -vi.mock('react-native', () => ({ AppState: {} })) -vi.mock('expo-router', () => ({ useFocusEffect: () => {} })) -vi.mock('../storage/preferences', () => ({ savePinnedIds: async () => {} })) -vi.mock('../worktree/host-worktree-refresh', () => ({ startHostWorktreeRefresh: () => () => {} })) - -import { useHostWorktreeCatalog } from './use-host-worktree-catalog' -import { createOrcaQueryClient } from '../query/orca-query-client' -import { settleQueryNotifications } from '../test-support/rpc-recording/hook-mount' - -import { FakeSession } from '../transport/mobile-endpoint-supervisor-test-fakes' -import type { RpcResponse } from '../transport/types' -import { useHostScreenState } from './use-host-screen-state' - -async function fetchWith(fail: boolean) { - const client = new FakeSession('connected') - const response: RpcResponse = { - id: 'r', - ok: true, - result: { worktrees: [], snapshotId: 's1' }, - _meta: { runtimeId: 'runtime' } - } - client.sendRequest.mockImplementation(async () => { - if (fail) { - throw new Error('network disconnected') - } - return response - }) - let current: { state: ReturnType; fetch: () => Promise } | null = - null - function Probe(): null { - const state = useHostScreenState('host-1') - state.clientRef.current = client - const catalog = useHostWorktreeCatalog({ - client, - connState: 'connected', - embedded: true, - hostCapabilities: [], - hostId: 'host-1', - sidebarFeed: null, - state, - syncViewSettingsFromDesktop: async () => {} - }) - current = { state, fetch: catalog.fetchWorktrees } - return null - } - let renderer: ReturnType | null = null - try { - await act(async () => { - renderer = create( - createElement( - QueryClientProvider, - { client: createOrcaQueryClient() }, - createElement(Probe) - ) - ) - }) - const get = (): NonNullable => { - if (current === null) { - throw new Error('catalog hook did not mount') - } - return current - } - // The mount's own read settles first; the failure is from an action after it. - await settleQueryNotifications() - act(() => get().state.setActionError('Could not delete workspace.')) - await act(async () => get().fetch()) - await settleQueryNotifications() - expect(client.sendRequest).toHaveBeenCalledWith( - 'worktree.ps', - expect.anything(), - expect.anything() - ) - return { - actionError: get().state.actionError, - catalogError: get().state.catalogError, - loaded: get().state.worktreesLoaded - } - } finally { - act(() => renderer?.unmount()) - } -} - -describe('a catalog the host confirmed', () => { - it('clears the action failure the list is still showing', async () => { - expect(await fetchWith(false)).toEqual({ actionError: '', catalogError: null, loaded: true }) - }) - it('retains the action failure when the catalog transport fails', async () => { - expect(await fetchWith(true)).toMatchObject({ - actionError: 'Could not delete workspace.', - catalogError: 'network_error' - }) - }) -}) diff --git a/mobile/src/mobile-web-shell/mobile-web-shell-host-list-route.test.tsx b/mobile/src/mobile-web-shell/mobile-web-shell-host-list-route.test.tsx deleted file mode 100644 index 477cf2f04a1..00000000000 --- a/mobile/src/mobile-web-shell/mobile-web-shell-host-list-route.test.tsx +++ /dev/null @@ -1,107 +0,0 @@ -import { createElement } from 'react' -import { act, create } from 'react-test-renderer' -import { beforeEach, describe, expect, it, vi } from 'vitest' - -type RouteDependencies = { - pathnames: string[] - hostId: string | string[] - refusals: number -} - -const dependencies = vi.hoisted((): RouteDependencies => ({ - pathnames: [], - hostId: 'host-1', - refusals: 0 -})) - -vi.mock('@react-native-async-storage/async-storage', () => ({ - default: { getItem: async () => null, setItem: async () => {} } -})) - -vi.mock('react-native', () => ({ - StyleSheet: { create: (styles: unknown) => styles }, - View: 'View' -})) - -vi.mock('expo-router', () => ({ - useLocalSearchParams: () => ({ hostId: dependencies.hostId }) -})) - -// The host route's open-target hook reads the on-disk page cache; these tests cover the route's shell handoff. -vi.mock('./use-host-document-open-target', () => ({ - useHostDocumentOpenTarget: () => ({ - routeParams: undefined, - onRouteParamClear: () => {}, - onPageLocation: () => {} - }) -})) - -vi.mock('./PageRouteUnavailableScreen', () => ({ - PageRouteUnavailableScreen: () => { - dependencies.refusals += 1 - return null - } -})) - -vi.mock('./MobileWebShellScreen', () => ({ - MobileWebShellScreen: (props: { hostId: string; route: { pathname: string } }) => { - dependencies.pathnames.push(props.route.pathname) - return null - } -})) - -import { BRIDGE_ROUTE_PATHNAME_PATTERN } from './bridge/bridge-caps' -import HostWorktreeRoute from '../../app/h/[hostId]/index' - -async function renderRoute(): Promise { - await act(async () => { - create(createElement(HostWorktreeRoute)) - }) -} - -describe('the worktree-list route that hands off to the shell', () => { - beforeEach(() => { - dependencies.pathnames.length = 0 - dependencies.refusals = 0 - dependencies.hostId = 'host-1' - }) - - it('encodes the host id into the pathname, like the shell route already does', async () => { - for (const hostId of ['a?b', 'a#b', 'a b', 'a/b', 'a\\b']) { - dependencies.hostId = hostId - dependencies.pathnames.length = 0 - await renderRoute() - const pathname = dependencies.pathnames[0] - expect(pathname, hostId).toBe(`/h/${encodeURIComponent(hostId)}`) - expect(BRIDGE_ROUTE_PATHNAME_PATTERN.test(pathname ?? ''), hostId).toBe(true) - expect(decodeURIComponent((pathname ?? '').slice('/h/'.length)), hostId).toBe(hostId) - } - }) - - it('refuses a dot-segment host id instead of handing over a route the page refuses', async () => { - // Neither encodeURIComponent nor escaped dots can make a dot segment acceptable to the bridge. - for (const hostId of ['..', '.']) { - dependencies.hostId = hostId - dependencies.pathnames.length = 0 - dependencies.refusals = 0 - await renderRoute() - expect(BRIDGE_ROUTE_PATHNAME_PATTERN.test(`/h/${hostId}`), hostId).toBe(false) - expect(dependencies.pathnames, hostId).toEqual([]) - expect(dependencies.refusals, hostId).toBeGreaterThan(0) - } - }) - - it('opens the first of a repeated host id, never the pair joined into one', async () => { - // Use firstParam for repeated Expo keys; encoding the array as a,b otherwise invents one valid but nonexistent host segment. - dependencies.hostId = ['host-1', 'host-2'] - await renderRoute() - expect(dependencies.pathnames).toEqual(['/h/host-1']) - }) - - it('refuses an empty repeated host id, which names no host at all', async () => { - dependencies.hostId = [] - await renderRoute() - expect(dependencies.pathnames).toEqual([]) - expect(dependencies.refusals).toBeGreaterThan(0) - }) -}) diff --git a/mobile/src/mobile-web-shell/shell-route-first-frame.test.tsx b/mobile/src/mobile-web-shell/shell-route-first-frame.test.tsx deleted file mode 100644 index 006ba05612e..00000000000 --- a/mobile/src/mobile-web-shell/shell-route-first-frame.test.tsx +++ /dev/null @@ -1,217 +0,0 @@ -import { createElement, type ComponentType } from 'react' -import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' - -type SwitchDependencies = { - refusals: number - shells: string[] - params: Record -} - -const dependencies = vi.hoisted((): SwitchDependencies => ({ - refusals: 0, - shells: [], - params: {} -})) - -const refusalScreen = vi.hoisted( - () => async (): Promise>> => { - const React = await import('react') - return function RefusalScreen() { - React.useEffect(() => { - dependencies.refusals += 1 - }, []) - return null - } - } -) - -vi.mock('@react-native-async-storage/async-storage', () => ({ - default: { getItem: async () => null, setItem: async () => {} } -})) - -vi.mock('react-native', () => ({ - StyleSheet: { create: (styles: unknown) => styles }, - View: 'View' -})) - -vi.mock('../transport/host-client-hooks', () => ({ - useHostClient: () => ({ client: null, state: 'disconnected' }) -})) -vi.mock('../transport/workspace-server', () => ({ - useWorkspaceServer: () => ({ routeHost: undefined, server: null }) -})) -vi.mock('expo-router', () => ({ - useLocalSearchParams: () => dependencies.params, - useRouter: () => ({ setParams: () => {} }) -})) - -vi.mock('./MobileWebShellScreen', async () => { - const React = await import('react') - return { - MobileWebShellScreen: (props: { route: { pathname: string } }) => { - const pathname = React.useRef(props.route.pathname) - React.useEffect(() => { - dependencies.shells.push(pathname.current) - }, []) - return null - } - } -}) - -// The host route's open-target hook reads the on-disk page cache; these tests cover the route's shell handoff. -vi.mock('./use-host-document-open-target', () => ({ - useHostDocumentOpenTarget: () => ({ - routeParams: undefined, - onRouteParamClear: () => {}, - onPageLocation: () => {} - }) -})) - -vi.mock('./PageRouteUnavailableScreen', async () => ({ - PageRouteUnavailableScreen: await refusalScreen() -})) - -import HostListRoute from '../../app/h/[hostId]/index' -import TasksRoute from '../../app/h/[hostId]/tasks' -import AccountsRoute from '../../app/h/[hostId]/accounts' -import AgentHistoryRoute from '../../app/h/[hostId]/agent-history/[worktreeId]' -import FilesRoute from '../../app/h/[hostId]/files/[worktreeId]' -import FilesPreviewRoute from '../../app/h/[hostId]/files/preview/[worktreeId]' -import SourceControlRoute from '../../app/h/[hostId]/source-control/[worktreeId]' -import ReviewRoute from '../../app/h/[hostId]/review/[worktreeId]' -import SessionRoute from '../../app/h/[hostId]/session/[worktreeId]' -import CatchAllRoute from './catch-all-page-route' - -type SwitchCase = { - readonly name: string - readonly Route: ComponentType - readonly params: Record - readonly unroutableParams: Record - readonly pathname: string -} - -const SWITCHES: readonly SwitchCase[] = [ - { - name: 'host list', - Route: HostListRoute, - params: { hostId: 'host-1' }, - unroutableParams: { hostId: '' }, - pathname: '/h/host-1' - }, - { - name: 'tasks', - Route: TasksRoute, - params: { hostId: 'host-1' }, - unroutableParams: { hostId: '' }, - pathname: '/h/host-1/tasks' - }, - { - name: 'accounts', - Route: AccountsRoute, - params: { hostId: 'host-1' }, - unroutableParams: { hostId: '' }, - pathname: '/h/host-1/accounts' - }, - { - name: 'agent history', - Route: AgentHistoryRoute, - params: { hostId: 'host-1', worktreeId: 'wt-1' }, - unroutableParams: { hostId: 'host-1', worktreeId: '' }, - pathname: '/h/host-1/agent-history/wt-1' - }, - { - name: 'files', - Route: FilesRoute, - params: { hostId: 'host-1', worktreeId: 'wt-1' }, - unroutableParams: { hostId: 'host-1', worktreeId: '..' }, - pathname: '/h/host-1/files/wt-1' - }, - { - name: 'file preview', - Route: FilesPreviewRoute, - params: { hostId: 'host-1', worktreeId: 'wt-1', relativePath: 'src/index.ts' }, - unroutableParams: { hostId: 'host-1', worktreeId: 'wt-1' }, - pathname: '/h/host-1/files/preview/wt-1' - }, - { - name: 'source control', - Route: SourceControlRoute, - params: { hostId: 'host-1', worktreeId: 'wt-1' }, - unroutableParams: { hostId: 'host-1', worktreeId: '' }, - pathname: '/h/host-1/source-control/wt-1' - }, - { - name: 'review', - Route: ReviewRoute, - params: { hostId: 'host-1', worktreeId: 'wt-1' }, - unroutableParams: { hostId: 'host-1', worktreeId: '' }, - pathname: '/h/host-1/review/wt-1' - }, - { - name: 'session', - Route: SessionRoute, - params: { hostId: 'host-1', worktreeId: 'wt-1' }, - unroutableParams: { hostId: 'host-1', worktreeId: '' }, - pathname: '/h/host-1/session/wt-1' - }, - { - name: 'catch-all', - Route: CatchAllRoute, - params: { hostId: 'host-1', page: ['settings'] }, - unroutableParams: { hostId: 'host-1' }, - pathname: '/h/host-1/settings' - } -] - -const mountedTrees: ReturnType[] = [] - -function createTracked(element: Parameters[0]): ReturnType { - const tree = create(element) - mountedTrees.push(tree) - return tree -} - -afterEach(() => { - act(() => { - for (const tree of mountedTrees.splice(0)) { - tree.unmount() - } - }) -}) - -// Synchronous act commits mount effects without draining async follow-up, isolating the first visible frame. -function renderFirstFrame(Route: ComponentType): ReactTestRenderer { - const rendered: { tree: ReactTestRenderer | null } = { tree: null } - act(() => { - rendered.tree = createTracked(createElement(Route)) - }) - if (rendered.tree === null) { - throw new Error('the switch did not render') - } - return rendered.tree -} - -describe.each(SWITCHES)('the $name switch', (entry) => { - beforeEach(() => { - dependencies.refusals = 0 - dependencies.shells.length = 0 - }) - - it('commits the shell on its first frame', async () => { - dependencies.params = { ...entry.params } - renderFirstFrame(entry.Route) - expect(dependencies.shells).toEqual([entry.pathname]) - await act(async () => {}) - expect(dependencies.refusals).toBe(0) - expect(dependencies.shells).toEqual([entry.pathname]) - }) - - it('commits the refusal for params that name no screen the shell could open', async () => { - dependencies.params = { ...entry.unroutableParams } - renderFirstFrame(entry.Route) - await act(async () => {}) - expect(dependencies.refusals).toBe(1) - expect(dependencies.shells).toEqual([]) - }) -}) diff --git a/mobile/src/navigation/host-stack-navigation.test.ts b/mobile/src/navigation/host-stack-navigation.test.ts index a01e456d1fd..946f5dd5d7b 100644 --- a/mobile/src/navigation/host-stack-navigation.test.ts +++ b/mobile/src/navigation/host-stack-navigation.test.ts @@ -56,118 +56,7 @@ function committedHostState(hostIdParam: string): HostStackNavigationState { } } -// Model Expo’s internal root navigator: the host stack sits one level below the layout screen. -function rootLayoutScopedState(inner: HostStackNavigationState): HostStackNavigationState { - return { key: 'internal', index: 0, routes: [{ key: '__root', name: '__root', state: inner }] } -} - describe('host stack navigation', () => { - it('matches a host committed as the encoded segment it was pushed as', () => { - const harness = navigationHarness({ index: 0, routes: [{ name: 'index' }] }) - const push = vi.fn() - - navigateToHostStackRoute(harness.navigation, { push, replace: vi.fn() }, 'host/one', TARGET) - expect(push).toHaveBeenCalledWith('/h/host%2Fone') - expect(harness.navigation.dispatch).not.toHaveBeenCalled() - - harness.setState(committedHostState(encodeURIComponent('host/one'))) - - expect(harness.navigation.dispatch).toHaveBeenCalledTimes(1) - expect(harness.navigation.dispatch).toHaveBeenCalledWith({ - type: 'REPLACE', - target: '/h', - source: 'host-index', - payload: TARGET - }) - }) - - it('replaces the host stack seen from the root layout, one navigator further down', () => { - const harness = navigationHarness( - rootLayoutScopedState({ index: 0, routes: [{ name: 'index' }] }) - ) - - navigateToHostStackRoute( - harness.navigation, - { push: vi.fn(), replace: vi.fn() }, - 'host/one', - TARGET - ) - harness.setState(rootLayoutScopedState(committedHostState('host/one'))) - - expect(harness.navigation.dispatch).toHaveBeenCalledWith({ - type: 'REPLACE', - target: '/h', - source: 'host-index', - payload: TARGET - }) - }) - - it('survives the state emitted before the root navigator has hydrated', () => { - const harness = navigationHarness(undefined) - - navigateToHostStackRoute( - harness.navigation, - { push: vi.fn(), replace: vi.fn() }, - 'host/one', - TARGET - ) - - expect(() => harness.setState(undefined)).not.toThrow() - expect(harness.navigation.dispatch).not.toHaveBeenCalled() - - harness.setState(rootLayoutScopedState(committedHostState('host/one'))) - expect(harness.navigation.dispatch).toHaveBeenCalledTimes(1) - }) - - it('replaces through Expo Router when root state omits the mounted child stack', () => { - const harness = navigationHarness({ index: 0, routes: [{ name: 'index' }] }) - const replace = vi.fn() - - navigateToHostStackRoute(harness.navigation, { push: vi.fn(), replace }, 'host/one', TARGET) - harness.setState({ - index: 0, - routes: [{ name: 'h', params: { hostId: 'host/one' } }] - }) - - expect(harness.navigation.dispatch).not.toHaveBeenCalled() - expect(replace).toHaveBeenCalledWith({ - pathname: '/h/[hostId]/tasks', - params: { hostId: 'host/one' } - }) - expect(harness.listenerCount()).toBe(0) - }) - - it('abandons the transition when navigation leaves the host route it was waiting on', () => { - const harness = navigationHarness({ index: 0, routes: [{ name: 'index' }] }) - - navigateToHostStackRoute( - harness.navigation, - { push: vi.fn(), replace: vi.fn() }, - 'host/one', - TARGET - ) - harness.setState({ index: 0, routes: [{ name: 'h' }] }) - harness.setState({ index: 0, routes: [{ name: 'index' }] }) - harness.setState(committedHostState('host/one')) - - expect(harness.navigation.dispatch).not.toHaveBeenCalled() - expect(harness.listenerCount()).toBe(0) - }) - - it('ignores a different host whose id merely decodes badly', () => { - const harness = navigationHarness({ index: 0, routes: [{ name: 'index' }] }) - - navigateToHostStackRoute( - harness.navigation, - { push: vi.fn(), replace: vi.fn() }, - 'host/one', - TARGET - ) - harness.setState(committedHostState('100%')) - - expect(harness.navigation.dispatch).not.toHaveBeenCalled() - }) - it('stops listening and never replaces once canceled', () => { const harness = navigationHarness({ index: 0, routes: [{ name: 'index' }] }) @@ -219,76 +108,4 @@ describe('host stack navigation', () => { expect.objectContaining({ payload: OTHER_TARGET }) ) }) - - describe('a session opened inside its host document', () => { - const SESSION = { - name: '[hostId]/session/[worktreeId]', - params: { hostId: 'host/one', worktreeId: 'repo::/tmp/wt', paneKey: 'tab-1:leaf 2' } - } as const - // The session's href, escaped once more because the host screen's param reader decodes it. - const OPEN = - '%2Fh%2Fhost%252Fone%2Fsession%2Frepo%253A%253A%252Ftmp%252Fwt%3FpaneKey%3Dtab-1%253Aleaf%25202' - - it('pushes the host with the session to open instead of pushing a second document', () => { - const harness = navigationHarness({ index: 0, routes: [{ name: 'index' }] }) - const push = vi.fn() - - navigateToHostStackRoute( - harness.navigation, - { push, replace: vi.fn() }, - 'host/one', - SESSION, - true - ) - harness.setState(committedHostState('host/one')) - - expect(push.mock.calls).toEqual([ - [{ pathname: '/h/[hostId]', params: { hostId: 'host/one', open: OPEN } }] - ]) - expect(harness.navigation.dispatch).not.toHaveBeenCalled() - }) - - it('folds a second tap for the same host into the push still committing', () => { - const harness = navigationHarness({ index: 0, routes: [{ name: 'index' }] }) - const push = vi.fn() - const router = { push, replace: vi.fn() } - - const pending = coordinateHostStackNavigation( - null, - harness.navigation, - router, - 'host/one', - SESSION, - true - ) - coordinateHostStackNavigation(pending, harness.navigation, router, 'host/one', SESSION, true) - - expect(push).toHaveBeenCalledTimes(1) - }) - - it('hands the session to the host list already showing', () => { - const harness = navigationHarness(committedHostState('host/one')) - const push = vi.fn() - - navigateToHostStackRoute( - harness.navigation, - { push, replace: vi.fn() }, - 'host/one', - SESSION, - true - ) - - expect(push).not.toHaveBeenCalled() - expect(harness.navigation.dispatch.mock.calls).toEqual([ - [ - { - type: 'SET_PARAMS', - target: '/h', - source: 'host-index', - payload: { params: { open: OPEN } } - } - ] - ]) - }) - }) }) diff --git a/mobile/src/query/host-event-router.test.ts b/mobile/src/query/host-event-router.test.ts index b129b673315..bb23eaec2b3 100644 --- a/mobile/src/query/host-event-router.test.ts +++ b/mobile/src/query/host-event-router.test.ts @@ -91,52 +91,3 @@ it('reads again when the desktop reports a change during a read, ending on the r await settleQueryNotifications() expect(rows()).toBe('after') }) - -it('listens again on the next connection after the desktop ends the event stream', async () => { - const host = desktop() - await mountList(host) - await act(async () => host.replies[0]('first')) - host.emit({ type: 'ready', subscriptionId: 'events-1' }) - host.emit({ type: 'end' }) - await act(async () => { - host.setState('disconnected') - host.setState('connected') - }) - // The connected edge's own re-read. - await act(async () => host.replies.at(-1)!('second')) - await settleQueryNotifications() - host.emit({ type: 'ready', subscriptionId: 'events-2' }) - const before = host.replies.length - - host.emit({ type: 'worktreesChanged', repoId: 'repo-1', sortOrderOnly: false }) - await settleQueryNotifications() - expect(host.replies).toHaveLength(before + 1) -}) - -it('survives a stream that ends while opening and opens it on the next connection', async () => { - const host = desktop() - let refuse = true - const subscribe = host.client.subscribe - host.client.subscribe = (method, params, onData, options) => { - if (refuse) { - refuse = false - onData({ type: 'error', message: 'refused' }) - return () => {} - } - return subscribe(method, params, onData, options) - } - await mountList(host) - await act(async () => host.replies[0]('first')) - await act(async () => { - host.setState('disconnected') - host.setState('connected') - }) - await act(async () => host.replies.at(-1)!('second')) - await settleQueryNotifications() - host.emit({ type: 'ready', subscriptionId: 'events-2' }) - const before = host.replies.length - - host.emit({ type: 'worktreesChanged', repoId: 'repo-1', sortOrderOnly: false }) - await settleQueryNotifications() - expect(host.replies).toHaveLength(before + 1) -}) diff --git a/mobile/src/session/use-mobile-host-model-catalog-upgrade.test.ts b/mobile/src/session/use-mobile-host-model-catalog-upgrade.test.ts deleted file mode 100644 index 67b9635b588..00000000000 --- a/mobile/src/session/use-mobile-host-model-catalog-upgrade.test.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { createElement } from 'react' -import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { describe, expect, it, vi } from 'vitest' -import type { AgentSessionModelCatalogResult } from '../../../src/shared/agent-session/agent-session-wire' -import { structuredAgentSessionSeedCatalog } from '../../../src/shared/agent-session/options/structured-agent-session-seed-catalog' -import { createStructuredAgentSessionOptionState } from '../../../src/shared/agent-session/options/structured-agent-session-options' -import type { RpcClient } from '../transport/rpc-client' -import { useMobileHostModelCatalogUpgrade } from './use-mobile-host-model-catalog-upgrade' - -const LISTED: AgentSessionModelCatalogResult = { - origin: 'live-session', - models: [{ id: 'running-account-model', label: 'Running', isDefault: true, efforts: [] }], - fetchedAt: 1 -} - -function listingClient(): RpcClient { - let plainReads = 0 - return { - sendRequest: (_method: string, params?: unknown) => { - const waits = typeof params === 'object' && params !== null && 'waitForListing' in params - if (waits) { - // The host's listing is still running for the whole test. - return new Promise(() => {}) - } - plainReads += 1 - const result = plainReads === 1 ? { origin: 'unknown', listingInProgress: true } : LISTED - return Promise.resolve({ id: 'r', ok: true, result, _meta: { runtimeId: 'runtime-1' } }) - }, - subscribe: () => () => {}, - updateTerminalSubscriptionViewport: () => {}, - getState: () => 'connected', - getReconnectAttempt: () => 0, - getLastConnectedAt: () => 1, - onStateChange: () => () => {}, - notifyForeground: () => {}, - close: () => {} - } -} - -describe('useMobileHostModelCatalogUpgrade', () => { - it('does not save a read sent after the first turn, even while a pre-turn listing is waited on', async () => { - const client = listingClient() - const record = vi.fn() - const activeOptionRecordRef = { - current: createStructuredAgentSessionOptionState('opencode').record - } - function Probe(props: { hasTurn: boolean; selectedModel?: string }): null { - useMobileHostModelCatalogUpgrade({ - agent: 'opencode', - client, - sessionId: 'session-1', - enabled: true, - newLaunch: true, - worktree: 'wt-1', - hasTurn: props.hasTurn, - ...(props.selectedModel ? { selectedModel: props.selectedModel } : {}), - fence: 1, - optionCatalog: structuredAgentSessionSeedCatalog('opencode'), - modelCatalogCache: { seed: () => undefined, record }, - receiveCatalog: () => {}, - activeOptionRecordRef, - updateOptionState: () => {} - }) - return null - } - let renderer: ReactTestRenderer | null = null - await act(async () => { - renderer = create(createElement(Probe, { hasTurn: false })) - }) - await act(async () => { - renderer?.update(createElement(Probe, { hasTurn: true, selectedModel: 'other-model' })) - }) - - expect(record.mock.calls.map(([, catalog]) => catalog)).not.toContainEqual(LISTED) - await act(async () => renderer?.unmount()) - }) -}) diff --git a/mobile/src/source-control/mobile-branch-compare-outcome.test.ts b/mobile/src/source-control/mobile-branch-compare-outcome.test.ts deleted file mode 100644 index 8b2663a8ef5..00000000000 --- a/mobile/src/source-control/mobile-branch-compare-outcome.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { nextBranchCompareState } from './mobile-branch-compare-outcome' -import type { BranchCompareOutcome } from './mobile-branch-compare-outcome' -import type { MobileGitBranchCompareReply } from './git-compare-reply-schema' -import type { MobileBranchCompareState } from './mobile-source-control-screen-state' - -// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the mapping passes the reply through untouched and reads no member of it. -const REPLY = { summary: { baseRef: 'origin/main' } } as MobileGitBranchCompareReply - -const READY: MobileBranchCompareState = { kind: 'ready', result: REPLY } -const UNAVAILABLE: BranchCompareOutcome = { kind: 'unavailable' } -const FAILED: BranchCompareOutcome = { kind: 'failed', message: 'no base' } - -describe('nextBranchCompareState', () => { - it('publishes a ready compare whatever the previous state was', () => { - const outcome: BranchCompareOutcome = { kind: 'ready', result: REPLY } - expect(nextBranchCompareState(outcome, { kind: 'idle' })).toEqual(READY) - expect(nextBranchCompareState(outcome, { kind: 'error', message: 'old' })).toEqual(READY) - }) - - it('keeps a prior ready compare when a re-read fails', () => { - expect(nextBranchCompareState(FAILED, READY)).toBe(READY) - expect(nextBranchCompareState(UNAVAILABLE, READY)).toBe(READY) - }) - - it('separates a host without git from an attempt that failed', () => { - expect(nextBranchCompareState(UNAVAILABLE, { kind: 'loading' })).toEqual({ - kind: 'idle' - }) - expect(nextBranchCompareState(FAILED, { kind: 'loading' })).toEqual({ - kind: 'error', - message: 'no base' - }) - }) -}) diff --git a/src/main/github/client/lookup/shared-pr-provider-reads.test.ts b/src/main/github/client/lookup/shared-pr-provider-reads.test.ts deleted file mode 100644 index b3ebbb05341..00000000000 --- a/src/main/github/client/lookup/shared-pr-provider-reads.test.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest' - -const mocks = vi.hoisted(() => ({ sidebar: vi.fn(), checks: vi.fn() })) -vi.mock('./pull-request-sidebar-query', () => ({ readPullRequestSidebarQuery: mocks.sidebar })) -vi.mock('../check/complete-pr-check-observation', () => ({ - readCompletePRCheckObservation: mocks.checks -})) - -import { - readSharedPRCheckObservation, - readSharedPullRequestSidebarQuery -} from './shared-pr-provider-reads' - -const REPO = { owner: 'acme', repo: 'orca' } -const SCOPE = 'local-runtime' - -describe('shared PR provider reads', () => { - beforeEach(() => { - mocks.sidebar.mockReset() - mocks.checks.mockReset() - }) - - it('sends one request per PR for every checkout of one account, and none across accounts', async () => { - mocks.sidebar.mockImplementation(async () => ({ number: 12 })) - const reads = [ - readSharedPullRequestSidebarQuery(REPO, 12, { cwd: '/repo' }, SCOPE), - readSharedPullRequestSidebarQuery( - { owner: 'ACME', repo: 'orca' }, - 12, - { cwd: '/repo-wt' }, - SCOPE - ), - readSharedPullRequestSidebarQuery( - REPO, - 12, - { cwd: '/repo', ghAccount: { host: 'github.com', user: 'other' } }, - SCOPE - ), - readSharedPullRequestSidebarQuery(REPO, 12, { cwd: '/repo' }, 'wsl:Ubuntu') - ] - expect(mocks.sidebar).toHaveBeenCalledTimes(3) - const [first, second] = await Promise.all(reads) - expect(first).toBe(second) - }) - - it('shares a check read only for the same head', async () => { - mocks.checks.mockImplementation(() => new Promise(() => {})) - void readSharedPRCheckObservation(REPO, 12, 'aaa', { cwd: '/repo' }, SCOPE) - void readSharedPRCheckObservation(REPO, 12, 'aaa', { cwd: '/repo-wt' }, SCOPE) - void readSharedPRCheckObservation(REPO, 12, 'bbb', { cwd: '/repo' }, SCOPE) - expect(mocks.checks).toHaveBeenCalledTimes(2) - }) - - it('lets a bounded watch read join a full read, but never serve one', async () => { - mocks.sidebar.mockImplementation(() => new Promise(() => {})) - void readSharedPullRequestSidebarQuery(REPO, 12, { cwd: '/repo' }, SCOPE, { - checkPageLimit: 10 - }) - void readSharedPullRequestSidebarQuery(REPO, 12, { cwd: '/repo' }, SCOPE) - void readSharedPullRequestSidebarQuery(REPO, 12, { cwd: '/repo' }, SCOPE, { - checkPageLimit: 10 - }) - expect(mocks.sidebar).toHaveBeenCalledTimes(2) - expect(mocks.sidebar.mock.calls.map((call) => call[3])).toEqual([10, undefined]) - }) - - it('starts a fresh read for a user refresh instead of joining one begun before the click', async () => { - mocks.sidebar.mockImplementation(() => new Promise(() => {})) - void readSharedPullRequestSidebarQuery(REPO, 13, { cwd: '/repo' }, SCOPE) - void readSharedPullRequestSidebarQuery(REPO, 13, { cwd: '/repo' }, SCOPE, { userRefresh: true }) - // Later ordinary callers share the refresh's read. - void readSharedPullRequestSidebarQuery(REPO, 13, { cwd: '/repo-wt' }, SCOPE) - expect(mocks.sidebar).toHaveBeenCalledTimes(2) - }) -}) diff --git a/src/main/github/pr-watch/pr-check-occurrence.test.ts b/src/main/github/pr-watch/pr-check-occurrence.test.ts index 0404421d88e..770846af8a4 100644 --- a/src/main/github/pr-watch/pr-check-occurrence.test.ts +++ b/src/main/github/pr-watch/pr-check-occurrence.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { restPRCheckRollupRows } from '../client/check/rest-pr-check-pages' +import '../client/check/rest-pr-check-pages' import { evaluatePRCheckOccurrence, type PRCheckContextState } from './pr-check-occurrence' // Provider-shaped reads of one commit: GraphQL statusCheckRollup nodes and the REST check-runs and @@ -19,24 +19,6 @@ const graphqlStatus = (state: string, run: number) => ({ targetUrl: `https://circleci.com/gh/acme/repo/${run}`, createdAt: '2026-11-06T10:00:00Z' }) -const restRun = (id: number, conclusion: string | null, status = 'completed') => ({ - id, - name: 'build', - head_sha: '8d5f74b3c0e1', - status, - conclusion, - html_url: `https://github.com/acme/repo/runs/${id}`, - details_url: `https://github.com/acme/repo/actions/runs/101/job/${id}`, - started_at: '2026-11-06T10:00:00Z', - completed_at: status === 'completed' ? '2026-11-06T10:04:00Z' : null, - check_suite: { id: 29001 } -}) -const restStatus = (state: string, run: number) => ({ - context: 'ci/circleci: test', - state, - target_url: `https://circleci.com/gh/acme/repo/${run}`, - created_at: '2026-11-06T10:00:00Z' -}) function after( rollup: unknown[], @@ -75,43 +57,4 @@ describe('evaluatePRCheckOccurrence', () => { // The same final state under a new run URL is a new run. expect(after([graphqlStatus('SUCCESS', 102)], green.next).verdict).toBe('success') }) - - it('reports nothing until every check is final, and nothing for cancellation or approval', () => { - expect(after([graphqlStatus('EXPECTED', 101)]).verdict).toBe(null) - expect(after([]).verdict).toBe(null) - expect( - after([graphqlRun(31001, null, 'IN_PROGRESS'), graphqlStatus('FAILURE', 101)]).verdict - ).toBe(null) - expect(after([graphqlRun(31001, 'CANCELLED')]).verdict).toBe(null) - expect( - evaluatePRCheckOccurrence([graphqlRun(31001, 'SUCCESS')], false, new Map()).verdict - ).toBe(null) - const awaitingApproval = restPRCheckRollupRows( - [restRun(31001, 'success')], - [], - [{ id: 29002, status: 'completed', conclusion: 'action_required' }] - ) - expect(after(awaitingApproval).verdict).toBe(null) - }) - - it('gives the GraphQL and REST reads of one commit the same identity and verdict', () => { - const graphql = [graphqlRun(31001, 'FAILURE'), graphqlStatus('SUCCESS', 101)] - const rest = restPRCheckRollupRows( - [restRun(31001, 'failure')], - [restStatus('success', 101)], - [] - ) - const fromGraphql = after(graphql) - const fromRest = after(rest) - expect(fromRest.verdict).toBe(fromGraphql.verdict) - expect([...fromRest.next.values()]).toEqual([...fromGraphql.next.values()]) - // Either read after the other sees nothing new; a REST rerun is new to a GraphQL memory. - expect(after(rest, fromGraphql.next).verdict).toBe(null) - expect( - after( - restPRCheckRollupRows([restRun(31002, 'failure')], [restStatus('success', 101)], []), - fromGraphql.next - ).verdict - ).toBe('failure') - }) }) diff --git a/src/main/runtime/orca-runtime-tests/dedupe-worktree-create.spec.ts b/src/main/runtime/orca-runtime-tests/dedupe-worktree-create.spec.ts deleted file mode 100644 index 28b3f3cf2ca..00000000000 --- a/src/main/runtime/orca-runtime-tests/dedupe-worktree-create.spec.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import './runtime-test-module-registration.spec' -import { OrcaRuntimeService } from '../orca-runtime' -import { store } from './orca-runtime-test-fixtures.spec' - -describe('OrcaRuntimeService.dedupeWorktreeCreate', () => { - it('coalesces concurrent creates that share a clientMutationId', async () => { - const runtime = new OrcaRuntimeService(store) - let calls = 0 - const factory = (): Promise<{ worktree: { id: string } }> => { - calls += 1 - return Promise.resolve({ worktree: { id: 'wt' } }) - } - const [a, b] = await Promise.all([ - runtime.dedupeWorktreeCreate('id:r', 'key-1', factory), - runtime.dedupeWorktreeCreate('id:r', 'key-1', factory) - ]) - expect(calls).toBe(1) - expect(a).toBe(b) - }) - - it('reuses a settled success for a retry whose response was lost in a cutover', async () => { - const runtime = new OrcaRuntimeService(store) - let calls = 0 - const factory = (): Promise<{ worktree: { id: string } }> => { - calls += 1 - return Promise.resolve({ worktree: { id: `wt-${calls}` } }) - } - const first = await runtime.dedupeWorktreeCreate('id:r', 'key-1', factory) - const retried = await runtime.dedupeWorktreeCreate('id:r', 'key-1', factory) - expect(calls).toBe(1) - expect(retried).toEqual(first) - }) - - it('expires settled successes after the reconnect window', async () => { - vi.useFakeTimers() - try { - const runtime = new OrcaRuntimeService(store) - let calls = 0 - const factory = (): Promise<{ n: number }> => Promise.resolve({ n: (calls += 1) }) - await runtime.dedupeWorktreeCreate('id:r', 'key-1', factory) - await vi.advanceTimersByTimeAsync(59_999) - await runtime.dedupeWorktreeCreate('id:r', 'key-1', factory) - expect(calls).toBe(1) - - await vi.advanceTimersByTimeAsync(1) - await runtime.dedupeWorktreeCreate('id:r', 'key-1', factory) - expect(calls).toBe(2) - } finally { - vi.useRealTimers() - } - }) - - it('drops a failed create so a genuine retry starts fresh', async () => { - const runtime = new OrcaRuntimeService(store) - let calls = 0 - const factory = (): Promise => { - calls += 1 - return Promise.reject(new Error(`boom-${calls}`)) - } - await expect(runtime.dedupeWorktreeCreate('id:r', 'key-1', factory)).rejects.toThrow('boom-1') - await expect(runtime.dedupeWorktreeCreate('id:r', 'key-1', factory)).rejects.toThrow('boom-2') - expect(calls).toBe(2) - }) - - it('never dedupes across repos or when no clientMutationId is supplied', async () => { - const runtime = new OrcaRuntimeService(store) - let calls = 0 - const factory = (): Promise<{ n: number }> => { - calls += 1 - return Promise.resolve({ n: calls }) - } - await runtime.dedupeWorktreeCreate('id:a', 'key-1', factory) - await runtime.dedupeWorktreeCreate('id:b', 'key-1', factory) - await runtime.dedupeWorktreeCreate('id:a', undefined, factory) - await runtime.dedupeWorktreeCreate('id:a', undefined, factory) - expect(calls).toBe(4) - }) -}) diff --git a/src/main/runtime/orca-runtime-tests/headless-pane-title-terminal-list.spec.ts b/src/main/runtime/orca-runtime-tests/headless-pane-title-terminal-list.spec.ts deleted file mode 100644 index 3d049f898be..00000000000 --- a/src/main/runtime/orca-runtime-tests/headless-pane-title-terminal-list.spec.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import './runtime-test-module-registration.spec' -import { OrcaRuntimeService } from '../orca-runtime' -import { - HEADLESS_LEAF_ID, - TEST_WORKTREE_ID, - makeRuntimeStoreWithWorkspaceSession, - makeWorkspaceSessionWithHeadlessTerminal -} from './orca-runtime-test-fixtures.spec' - -// #30329: host listings must expose client-renamed panes persisted in host layout. -async function headlessRuntimeWithLivePane() { - const { runtimeStore, getSession } = makeRuntimeStoreWithWorkspaceSession( - makeWorkspaceSessionWithHeadlessTerminal() - ) - const runtime = new OrcaRuntimeService(runtimeStore) - runtime.setPtyController({ - spawn: vi.fn(async () => ({ id: 'pane-title-pty' })), - write: () => true, - kill: () => true, - getForegroundProcess: async () => null - }) - const created = await runtime.createTerminal(`id:${TEST_WORKTREE_ID}`, { - tabId: 'host-tab', - leafId: HEADLESS_LEAF_ID, - activate: true - }) - const renamePane = (titlesByLeafId: Record) => - runtime.updateMobileSessionPaneLayout(`id:${TEST_WORKTREE_ID}`, { - tabId: 'host-tab', - root: getSession().terminalLayoutsByTabId['host-tab']!.root, - expandedLeafId: null, - titlesByLeafId - }) - const listed = async () => - (await runtime.listTerminals(`id:${TEST_WORKTREE_ID}`)).terminals.find( - (terminal) => terminal.handle === created.handle - ) - return { runtime, handle: created.handle, renamePane, listed } -} - -describe('pane titles in terminal summaries', () => { - it('reports a client pane rename in terminal.list and terminal.show', async () => { - const { runtime, handle, renamePane, listed } = await headlessRuntimeWithLivePane() - expect((await listed())?.paneTitle).toBeUndefined() - - await renamePane({ [HEADLESS_LEAF_ID]: 'server' }) - - expect(await listed()).toMatchObject({ handle, paneTitle: 'server' }) - expect((await runtime.showTerminal(handle)).paneTitle).toBe('server') - }) - - it('drops the pane title once a client clears the last one', async () => { - const { renamePane, listed } = await headlessRuntimeWithLivePane() - await renamePane({ [HEADLESS_LEAF_ID]: 'server' }) - - await renamePane({}) - - expect((await listed())?.paneTitle).toBeUndefined() - }) -}) diff --git a/src/main/runtime/orca-runtime-tests/managed-server-capability.spec.ts b/src/main/runtime/orca-runtime-tests/managed-server-capability.spec.ts deleted file mode 100644 index d675de42633..00000000000 --- a/src/main/runtime/orca-runtime-tests/managed-server-capability.spec.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { createRuntime } from './orca-runtime-test-fixtures.spec' -import { - registerManagedServerActions, - type ManagedServerActions -} from '../managed-server-actions-registry' - -describe('managed server capability', () => { - // Without desktop SSH registry, never advertise methods that can only refuse. - it('is advertised only where the desktop registered the managed-server actions', () => { - registerManagedServerActions(null) - expect(createRuntime().getStatus().capabilities).not.toContain('managedServer.v1') - const unusedAction = async (): Promise => { - throw new Error('Capability discovery must not invoke managed-server actions') - } - const actions: ManagedServerActions = { - status: unusedAction, - update: unusedAction, - rollback: unusedAction, - recover: unusedAction, - stop: unusedAction, - cancelStop: unusedAction, - forget: unusedAction, - forgetRedundant: unusedAction - } - registerManagedServerActions(actions) - try { - expect(createRuntime().getStatus().capabilities).toContain('managedServer.v1') - } finally { - registerManagedServerActions(null) - } - }) -}) diff --git a/src/main/runtime/orca-runtime-tests/orca-runtime-tab-id-collision.spec.ts b/src/main/runtime/orca-runtime-tests/orca-runtime-tab-id-collision.spec.ts deleted file mode 100644 index 4dbc24411bf..00000000000 --- a/src/main/runtime/orca-runtime-tests/orca-runtime-tab-id-collision.spec.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { OrcaRuntimeService } from '../orca-runtime' -import type { RuntimeSyncWindowGraph } from '../../../shared/runtime-session-contracts' - -export function registerOrcaRuntimeTabIdCollisionTests(): void { - const WORKTREE_A = 'repo-1::/tmp/worktree-a' - const WORKTREE_B = 'repo-1::/tmp/worktree-b' - - function tab(tabId: string, worktreeId: string) { - return { - tabId, - worktreeId, - title: `${worktreeId} tab`, - activeLeafId: null, - layout: null - } - } - - function graph(tabs: RuntimeSyncWindowGraph['tabs']): RuntimeSyncWindowGraph { - return { tabs, leaves: [] } - } - - describe('runtime graph tab identity', () => { - it('does not claim graph authority when the first publication is malformed', () => { - const runtime = new OrcaRuntimeService() - - expect(() => - runtime.syncWindowGraph( - 1, - graph([tab('tab-duplicate', WORKTREE_A), tab('tab-duplicate', WORKTREE_B)]) - ) - ).toThrow('duplicate_runtime_tab_id') - expect( - (runtime as unknown as { authoritativeWindowId: number | null }).authoritativeWindowId - ).toBe(null) - - expect(() => runtime.syncWindowGraph(1, graph([tab('tab-valid', WORKTREE_A)]))).not.toThrow() - }) - - it('rejects duplicate tab ids across worktrees before replacing the graph', () => { - const runtime = new OrcaRuntimeService() - runtime.attachWindow(1) - runtime.syncWindowGraph(1, graph([tab('tab-unique', WORKTREE_A)])) - - expect(() => - runtime.syncWindowGraph( - 1, - graph([tab('tab-duplicate', WORKTREE_A), tab('tab-duplicate', WORKTREE_B)]) - ) - ).toThrow('duplicate_runtime_tab_id') - - expect([...(runtime as unknown as { tabs: Map }).tabs.keys()]).toEqual([ - 'tab-unique' - ]) - }) - - it('accepts distinct tab ids from different worktrees', () => { - const runtime = new OrcaRuntimeService() - runtime.attachWindow(1) - - expect(() => - runtime.syncWindowGraph(1, graph([tab('tab-a', WORKTREE_A), tab('tab-b', WORKTREE_B)])) - ).not.toThrow() - expect([...(runtime as unknown as { tabs: Map }).tabs.keys()]).toEqual([ - 'tab-a', - 'tab-b' - ]) - }) - }) -} diff --git a/src/main/runtime/orca-runtime-tests/orchestration-attention-batching.spec.ts b/src/main/runtime/orca-runtime-tests/orchestration-attention-batching.spec.ts deleted file mode 100644 index 15bed4239fd..00000000000 --- a/src/main/runtime/orca-runtime-tests/orchestration-attention-batching.spec.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import './runtime-test-module-registration.spec' -import { OrcaRuntimeService } from '../orca-runtime' -import { OrchestrationDb } from '../orchestration/db/orchestration-db' -import { createRootDispatch } from '../orchestration/db/root-dispatch-test-fixture' -import { makePaneKey } from '../../../shared/workspace-layout/stable-pane-id' -import { TEST_WORKTREE_ID, store } from './orca-runtime-test-fixtures.spec' - -describe('OrcaRuntimeService', () => { - it('batches attention queries across unchanged graph publishes', () => { - const runtime = new OrcaRuntimeService(store) - const terminals = Array.from({ length: 12 }, (_, index) => ({ - tabId: `tab-attention-batch-${index}`, - leafId: `10000000-0000-4000-8000-${String(index).padStart(12, '0')}`, - ptyId: `pty-attention-batch-${index}`, - paneRuntimeId: index + 1 - })) - const handles = terminals.map((terminal) => runtime.preAllocateHandleForPty(terminal.ptyId)) - const db = new OrchestrationDb(':memory:') - try { - const run = db.createRun({ - objective: 'bounded attention query oracle', - coordinatorHandle: 'term_attention_coordinator', - coordinatorPaneKey: makePaneKey( - 'tab-attention-coordinator', - '20000000-0000-4000-8000-000000000000' - ) - }) - for (const [index, terminal] of terminals.entries()) { - const task = db.createTask({ spec: `worker ${index}`, runId: run.id }) - createRootDispatch( - db, - task.id, - handles[index], - makePaneKey(terminal.tabId, terminal.leafId) - ) - } - const getWorkerAttentionFacts = vi.spyOn(db, 'getWorkerAttentionFacts') - const prepare = vi.spyOn(db.db, 'prepare') - runtime.setOrchestrationDb(db) - runtime.attachWindow(1) - const graph = { - tabs: terminals.map((terminal) => ({ - tabId: terminal.tabId, - worktreeId: TEST_WORKTREE_ID, - title: terminal.tabId, - activeLeafId: terminal.leafId, - layout: null - })), - leaves: terminals.map((terminal) => ({ - tabId: terminal.tabId, - worktreeId: TEST_WORKTREE_ID, - leafId: terminal.leafId, - paneRuntimeId: terminal.paneRuntimeId, - ptyId: terminal.ptyId, - paneTitle: null - })) - } - - runtime.syncWindowGraph(1, graph) - prepare.mockClear() - getWorkerAttentionFacts.mockClear() - const unchanged = runtime.syncWindowGraph(1, graph) - - const attentionSql = prepare.mock.calls - .map(([sql]) => sql) - .filter( - (sql) => - (sql.includes('AS pending_input') && sql.includes('json_each(?)')) || - (sql.includes('attempt_observation_facts') && sql.includes('json_each(?)')) - ) - expect(Object.keys(unchanged.agentOrchestrationByPaneKey ?? {})).toHaveLength(12) - expect(getWorkerAttentionFacts).not.toHaveBeenCalled() - expect(attentionSql).toHaveLength(2) - } finally { - db.close() - } - }) -}) diff --git a/src/main/runtime/orca-runtime-tests/reattach-headless-grid.spec.ts b/src/main/runtime/orca-runtime-tests/reattach-headless-grid.spec.ts deleted file mode 100644 index fb99763b93a..00000000000 --- a/src/main/runtime/orca-runtime-tests/reattach-headless-grid.spec.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { createRuntime, syncSinglePty } from './orca-runtime-test-fixtures.spec' - -describe('headless model grid after a reattach', () => { - it('reflows a model that live bytes created at the 80x24 default onto the PTY grid', async () => { - const runtime = createRuntime() - // Model a reattach whose real grid is learned only from the reply. - runtime.setPtyController({ - write: () => true, - kill: () => true, - getForegroundProcess: async () => null, - getSize: () => null - }) - syncSinglePty(runtime, 'pty-1') - - runtime.onPtyData('pty-1', 'user@host % claude\r\n', 100) - await expect( - runtime.serializeMainTerminalBuffer('pty-1', { scrollbackRows: 100 }) - ).resolves.toMatchObject({ cols: 80, rows: 24 }) - - runtime.reflowHeadlessTerminalToPtyGrid('pty-1', 211, 57) - - await expect( - runtime.serializeMainTerminalBuffer('pty-1', { scrollbackRows: 100 }) - ).resolves.toMatchObject({ cols: 211, rows: 57, source: 'headless' }) - }) - - it('never creates a model for a PTY that has none', async () => { - const runtime = createRuntime() - runtime.setPtyController({ - write: () => true, - kill: () => true, - getForegroundProcess: async () => null, - getSize: () => null - }) - syncSinglePty(runtime, 'pty-1') - - runtime.reflowHeadlessTerminalToPtyGrid('pty-1', 211, 57) - runtime.onPtyData('pty-1', 'hello\r\n', 100) - - // Pre-creating the model would bypass the renderer-authority gate. - await expect( - runtime.serializeMainTerminalBuffer('pty-1', { scrollbackRows: 100 }) - ).resolves.toMatchObject({ cols: 80, rows: 24 }) - }) -}) diff --git a/src/main/runtime/orca-runtime-tests/terminal-agent-presence.spec.ts b/src/main/runtime/orca-runtime-tests/terminal-agent-presence.spec.ts deleted file mode 100644 index 173b485ebda..00000000000 --- a/src/main/runtime/orca-runtime-tests/terminal-agent-presence.spec.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import { committingSpawn } from './bind-first-pane.test-fixture' -import './runtime-test-module-registration.spec' -import { OrcaRuntimeService } from '../orca-runtime' -import { TEST_WORKTREE_PATH, store } from './orca-runtime-test-fixtures.spec' - -describe('terminal agent presence', () => { - it('finds an idle Claude by a fresh read when p_comm is its version directory', async () => { - const spawn = vi.fn().mockResolvedValue({ id: 'pty-claude' }) - const runtime = new OrcaRuntimeService(store) - runtime.setPtyController({ - spawn: committingSpawn(runtime, spawn), - write: () => true, - kill: () => true, - getForegroundProcess: async () => '2.1.310', - confirmForegroundProcess: async () => 'claude' - }) - const { handle } = await runtime.createTerminal(`path:${TEST_WORKTREE_PATH}`, { - command: 'claude', - title: 'worker' - }) - // Claude answered over OSC 7501 paints no title glyph. - runtime.onPtyData('pty-claude', '\x1b]0;Orca worker dispatch task ok\x07', 1) - - await expect(runtime.isTerminalRunningAgent(handle)).resolves.toBe(true) - }) -}) diff --git a/src/main/runtime/orca-runtime-tests/terminal-workspace-id-env.spec.ts b/src/main/runtime/orca-runtime-tests/terminal-workspace-id-env.spec.ts deleted file mode 100644 index c7ea2591f7a..00000000000 --- a/src/main/runtime/orca-runtime-tests/terminal-workspace-id-env.spec.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import './runtime-test-module-registration.spec' -import { OrcaRuntimeService } from '../orca-runtime' -import { TEST_WORKTREE_ID, store } from './orca-runtime-test-fixtures.spec' -import { spawnedPtyEnv } from '../spawned-pty-env-fixtures' - -function makeRuntime(): { runtime: OrcaRuntimeService; spawn: ReturnType } { - const spawn = vi.fn().mockResolvedValue({ id: 'pty-workspace-id' }) - const runtime = new OrcaRuntimeService(store) - runtime.setPtyController({ - spawn, - write: () => true, - kill: () => true, - getForegroundProcess: async () => null - }) - return { runtime, spawn } -} - -// Host-created panes need the same workspace id that renderer panes pass to agent wrappers. -describe('OrcaRuntimeService terminal ORCA_WORKSPACE_ID', () => { - it('replaces a client-sent value with the host workspace id', async () => { - const { runtime, spawn } = makeRuntime() - - await runtime.createTerminal(`id:${TEST_WORKTREE_ID}`, { - env: { ORCA_WORKSPACE_ID: 'stale-client-id' } - }) - - expect(spawnedPtyEnv(spawn.mock.calls[0]?.[0]).ORCA_WORKSPACE_ID).toBe(TEST_WORKTREE_ID) - }) -}) diff --git a/src/main/runtime/orca-runtime.test.ts b/src/main/runtime/orca-runtime.test.ts index 1d6cfe34cd5..0cbd6235854 100644 --- a/src/main/runtime/orca-runtime.test.ts +++ b/src/main/runtime/orca-runtime.test.ts @@ -13,11 +13,9 @@ await import('./orca-runtime-tests/orca-runtime-test-lifecycle.spec') await import('./orca-runtime-tests/orca-runtime-test-fixtures.spec') await import('./orca-runtime-tests/orca-runtime-test-scenario-builders.spec') -await import('./orca-runtime-tests/dedupe-worktree-create.spec') await import('./orca-runtime-tests/paired-settings.spec') await import('./orca-runtime-tests/runtime-availability.spec') await import('./orca-runtime-tests/browser-capabilities.spec') -await import('./orca-runtime-tests/managed-server-capability.spec') await import('./orca-runtime-tests/window-authority.spec') await import('./orca-runtime-tests/terminal-handles.spec') await import('./orca-runtime-tests/terminal-handles-part-02.spec') @@ -38,7 +36,6 @@ await import('./orca-runtime-tests/terminal-side-effect-facts-part-03.spec') await import('./orca-runtime-tests/decorative-title-fact-throttle.spec') await import('./orca-runtime-tests/headless-snapshots.spec') await import('./orca-runtime-tests/headless-snapshots-part-02.spec') -await import('./orca-runtime-tests/reattach-headless-grid.spec') await import('./orca-runtime-tests/agent-status-and-waits.spec') await import('./orca-runtime-tests/program-status-osc.spec') await import('./orca-runtime-tests/agent-status-and-waits-part-02.spec') @@ -46,7 +43,6 @@ await import('./orca-runtime-tests/agent-status-and-waits-part-03.spec') await import('./orca-runtime-tests/terminal-creation-and-readiness.spec') await import('./orca-runtime-tests/terminal-creation-and-readiness-part-02.spec') await import('./orca-runtime-tests/terminal-creation-and-readiness-part-03.spec') -await import('./orca-runtime-tests/terminal-workspace-id-env.spec') await import('./orca-runtime-tests/terminal-creation-and-readiness-part-04.spec') await import('./orca-runtime-tests/terminal-creation-and-readiness-part-05.spec') await import('./orca-runtime-tests/terminal-creation-and-readiness-part-06.spec') @@ -68,7 +64,6 @@ await import('./orca-runtime-tests/terminal-output-and-worker-recovery-part-06.s await import('./orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec') await import('./orca-runtime-tests/terminal-handles-and-agent-status.spec') await import('./orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec') -await import('./orca-runtime-tests/terminal-agent-presence.spec') await import('./orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec') await import('./orca-runtime-tests/terminal-handles-and-agent-status-part-04.spec') await import('./orca-runtime-tests/terminal-handles-and-agent-status-part-05.spec') @@ -79,7 +74,6 @@ await import('./orca-runtime-tests/mobile-session-tabs-part-03.spec') await import('./orca-runtime-tests/mobile-session-tabs-part-04.spec') await import('./orca-runtime-tests/mobile-session-tabs-part-05.spec') await import('./orca-runtime-tests/mobile-session-tabs-part-06.spec') -await import('./orca-runtime-tests/headless-pane-title-terminal-list.spec') await import('./orca-runtime-tests/mobile-session-tabs-part-07.spec') await import('./orca-runtime-tests/mobile-session-tabs-part-08.spec') await import('./orca-runtime-tests/mobile-session-tabs-part-09.spec') @@ -112,7 +106,6 @@ await import('./orca-runtime-tests/terminal-sleep-and-teardown-part-03.spec') await import('./orca-runtime-tests/lineage-and-scan-cache.spec') await import('./orca-runtime-tests/lineage-and-scan-cache-part-02.spec') await import('./orca-runtime-tests/lineage-and-scan-cache-part-05.spec') -await import('./orca-runtime-tests/orchestration-attention-batching.spec') await import('./orca-runtime-tests/wsl-stopped-distro-worktree-scan.spec') await import('./orca-runtime-tests/worktree-setup-and-startup.spec') await import('./orca-runtime-tests/worktree-setup-and-startup-part-02.spec') diff --git a/src/main/runtime/terminal/identity/runtime-terminal-handle-contracts.test.ts b/src/main/runtime/terminal/identity/runtime-terminal-handle-contracts.test.ts index 6a26f423049..96f6fd792c3 100644 --- a/src/main/runtime/terminal/identity/runtime-terminal-handle-contracts.test.ts +++ b/src/main/runtime/terminal/identity/runtime-terminal-handle-contracts.test.ts @@ -1,5 +1,3 @@ import { registerTerminalMobileSubscribeTabMountTests } from '../launch/terminal-mobile-subscribe-tab-mount.spec' -import { registerOrcaRuntimeTabIdCollisionTests } from '../../orca-runtime-tests/orca-runtime-tab-id-collision.spec' registerTerminalMobileSubscribeTabMountTests() -registerOrcaRuntimeTabIdCollisionTests() diff --git a/src/main/runtime/workspaces/sleep/remote-workspace-terminal-sleep.test.ts b/src/main/runtime/workspaces/sleep/remote-workspace-terminal-sleep.test.ts deleted file mode 100644 index 2c8eb84fd65..00000000000 --- a/src/main/runtime/workspaces/sleep/remote-workspace-terminal-sleep.test.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { - requestRemoteWorktreeSleep, - type RemoteWorkspaceCall -} from './remote-workspace-terminal-sleep' - -const noTerminals = { terminals: [], totalCount: 0, truncated: false } - -/** A paired server answering by method; a function answer runs per call. */ -function server(answers: Record) { - const methods: string[] = [] - const call: RemoteWorkspaceCall = async (method) => { - methods.push(method) - const answer = answers[method] - return typeof answer === 'function' ? answer() : answer - } - return { call, methods } -} - -const notFound = () => { - throw Object.assign(new Error('unknown method'), { code: 'method_not_found' }) -} - -describe('requestRemoteWorktreeSleep', () => { - it('stops an older server and polls until no terminal is live', async () => { - const { call, methods } = server({ - 'terminal.sleep': notFound, - 'terminal.stop': {}, - 'terminal.list': noTerminals - }) - expect(await requestRemoteWorktreeSleep(call, 'r::/w')).toEqual([]) - expect(methods).toEqual(['terminal.sleep', 'terminal.stop', 'terminal.list']) - }) - - it('takes no legacy path for any other refusal', async () => { - const { call, methods } = server({ - 'terminal.sleep': () => { - throw Object.assign(new Error('denied'), { code: 'forbidden' }) - } - }) - await expect(requestRemoteWorktreeSleep(call, 'r::/w')).rejects.toThrow('denied') - expect(methods).toEqual(['terminal.sleep']) - }) -}) diff --git a/src/main/runtime/workspaces/startup/runtime-local-worktree-terminal-startup-layout-owner.test.ts b/src/main/runtime/workspaces/startup/runtime-local-worktree-terminal-startup-layout-owner.test.ts deleted file mode 100644 index e157bd53822..00000000000 --- a/src/main/runtime/workspaces/startup/runtime-local-worktree-terminal-startup-layout-owner.test.ts +++ /dev/null @@ -1,114 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import type { Repo } from '../../../../shared/repo-types' -import type { Worktree } from '../../../../shared/worktree/types' -import { startRuntimeLocalWorktreeTerminals } from './runtime-local-worktree-terminal-startup' - -vi.mock('../../../../shared/layout-owner-switch', () => ({ ORCA_LAYOUT_OWNER_IS_MAIN: true })) - -const repo: Repo = { - id: 'repo-1', - path: '/repo', - displayName: 'repo', - badgeColor: 'blue', - addedAt: 1 -} - -const worktree: Worktree = { - id: 'worktree-1', - repoId: repo.id, - path: '/worktree', - head: 'abc', - branch: 'feature', - isBare: false, - isMainWorktree: false, - displayName: 'feature', - comment: '', - linkedIssue: null, - linkedPR: null, - linkedLinearIssue: null, - isArchived: false, - isUnread: false, - isPinned: false, - sortOrder: 0, - lastActivityAt: 1 -} - -type StartupArgs = Parameters[0] - -function createPorts() { - const createTerminal = vi.fn().mockResolvedValue({ - handle: 'term-1', - worktreeId: worktree.id, - title: null - }) - const ports: StartupArgs['ports'] = { - canSpawn: true, - createTerminal, - pasteDraft: vi.fn(), - sendFollowup: vi.fn(), - provision: vi.fn().mockResolvedValue({ setupSpawned: false, setupTerminalHandle: null }), - activate: vi.fn() - } - return { createTerminal, ports } -} - -describe('layout-owner build: a create whose agent failed to start', () => { - it('still provisions setup and default tabs in main, and hands the window nothing to retry', async () => { - const { ports, createTerminal } = createPorts() - createTerminal.mockRejectedValueOnce(new Error('pty unavailable')) - const setup = { runnerScriptPath: '/repo/setup.sh', envVars: {} } - const defaultTabs = { runCommands: true, tabs: [{ title: 'Dev', command: 'pnpm dev' }] } - await startRuntimeLocalWorktreeTerminals({ - request: { - repoSelector: repo.id, - name: 'recover', - activate: true, - awaitTerminalProvisioning: true - }, - repo, - worktree, - startup: { command: 'codex' }, - setup, - defaultTabs, - ports - }) - expect(createTerminal.mock.calls[0]![1]).toMatchObject({ keepPaneOnStartFailure: true }) - // The agent's pane stays, showing the failure, so no extra shell is seeded beside it. - expect(ports.provision).toHaveBeenCalledWith( - expect.objectContaining({ setup, defaultTabs, hasStartupTerminal: true }) - ) - // Setup did not start here either (the fake spawns nothing), and still stays main's. - expect(ports.activate).toHaveBeenCalledWith( - repo.id, - worktree.id, - undefined, - undefined, - undefined - ) - }) - - it('asks main to start the agent even when its launch failed or no terminal service runs', async () => { - const repair = new Error('agent runtime needs repair') - for (const [canSpawn, startupLaunchRuntime] of [ - [true, repair], - [false, undefined] - ] as const) { - const { ports, createTerminal } = createPorts() - ports.canSpawn = canSpawn - createTerminal.mockRejectedValueOnce(new Error('start failed')) - await startRuntimeLocalWorktreeTerminals({ - request: { repoSelector: repo.id, name: 'recover', activate: true }, - repo, - worktree, - startup: { command: 'codex' }, - ...(startupLaunchRuntime ? { startupLaunchRuntime } : {}), - ports - }) - expect(createTerminal).toHaveBeenCalledTimes(1) - expect(createTerminal.mock.calls[0]![1]).toMatchObject({ - keepPaneOnStartFailure: true, - ...(startupLaunchRuntime ? { startFailure: repair } : {}) - }) - } - }) -}) diff --git a/src/main/runtime/workspaces/startup/workspace-activation-vm-wake.test.ts b/src/main/runtime/workspaces/startup/workspace-activation-vm-wake.test.ts deleted file mode 100644 index 52a3e344370..00000000000 --- a/src/main/runtime/workspaces/startup/workspace-activation-vm-wake.test.ts +++ /dev/null @@ -1,42 +0,0 @@ -// #36923: a workspace this host runs on a recipe VM over its SSH target is opened through this -// host's own worktree.activate (window, CLI, paired clients), so that opening wakes the VM. -import { describe, expect, it, vi } from 'vitest' - -await import('../../orca-runtime-tests/runtime-test-module-registration.spec') -const { OrcaRuntimeService } = await import('../../orca-runtime') -await import('../../orca-runtime-tests/orca-runtime-test-lifecycle.spec') -const { TEST_WINDOW_ID, TEST_WORKTREE_ID, store } = - await import('../../orca-runtime-tests/orca-runtime-test-fixtures.spec') - -describe('activateManagedWorktree and a recipe VM', () => { - it('wakes the VM behind a workspace this host activates', async () => { - const resumeVm = vi.fn(async () => null) - const runtime = new OrcaRuntimeService(store, undefined, { - workspaceSleepPlatform: { - callEnvironment: vi.fn(async () => { - throw new Error('no paired servers') - }), - ownsVm: (workspaceId: string) => workspaceId === TEST_WORKTREE_ID, - acceptWake: () => ({ sshHeld: false, sshUserDisconnects: 0 }), - suspendVm: vi.fn(async () => {}), - resumeVm - } - }) - runtime.attachWindow(TEST_WINDOW_ID) - runtime.markGraphReady(TEST_WINDOW_ID) - - await expect( - runtime.activateManagedWorktree(`id:${TEST_WORKTREE_ID}`, { - notifyClients: false, - clientKind: 'runtime' - }) - ).resolves.toMatchObject({ worktreeId: TEST_WORKTREE_ID }) - // The wake runs on its own, since a recipe's resume can outlast activation. - await vi.waitFor(() => - expect(resumeVm).toHaveBeenCalledWith(TEST_WORKTREE_ID, { - sshHeld: false, - sshUserDisconnects: 0 - }) - ) - }) -}) diff --git a/src/main/runtime/workspaces/workspace-host-notifications.test.ts b/src/main/runtime/workspaces/workspace-host-notifications.test.ts deleted file mode 100644 index 3c923ca1c06..00000000000 --- a/src/main/runtime/workspaces/workspace-host-notifications.test.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { describe, expect, it } from 'vitest' -import type { Repo } from '../../../shared/repo-types' -import type { RuntimeClientEvent } from '../../../shared/runtime-client-events' -import { OrcaRuntimeService } from '../orca-runtime' -import type { RuntimeStore } from '../runtime-store-contract' -import { partialRuntimeStore } from '../orca-runtime-tests/runtime-store-partial-fixture' - -function catalogEventsFor(repo: Repo): RuntimeClientEvent[] { - const store: Pick = { getRepos: () => [repo] } - const runtime = new OrcaRuntimeService(partialRuntimeStore(store)) - const events: RuntimeClientEvent[] = [] - runtime.onClientEvent((event) => events.push(event)) - runtime.notifyWorktreeCatalogChangedForRemoteClients(repo.id) - return events.filter((event) => event.type === 'worktreesChanged') -} - -const baseRepo: Repo = { id: 'r', path: '/r', displayName: 'r', badgeColor: 'blue', addedAt: 1 } - -describe('notifyWorktreeCatalogChangedForRemoteClients', () => { - it('tells remote clients about a local repo', () => { - expect(catalogEventsFor(baseRepo)).toHaveLength(1) - }) - - it('skips an SSH repo named only by its execution host', () => { - expect(catalogEventsFor({ ...baseRepo, executionHostId: 'ssh:target-1' })).toHaveLength(0) - }) - - it('skips an SSH repo named by its legacy connection id', () => { - expect(catalogEventsFor({ ...baseRepo, connectionId: 'target-1' })).toHaveLength(0) - }) -}) diff --git a/src/main/runtime/wsl-held-pane-start-layout-owner.test.ts b/src/main/runtime/wsl-held-pane-start-layout-owner.test.ts deleted file mode 100644 index 84bc0b61728..00000000000 --- a/src/main/runtime/wsl-held-pane-start-layout-owner.test.ts +++ /dev/null @@ -1,83 +0,0 @@ -// A background start held for a stopped WSL distro publishes `failed` with the hold, and Start starts it as the user. -import { describe, expect, it, vi } from 'vitest' -import { wslDistroHoldMessage } from '../../shared/wsl-distro-stopped-hold' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../shared/execution-host' -import { committingSpawn } from './orca-runtime-tests/bind-first-pane.test-fixture' - -vi.mock('../../shared/layout-owner-switch', () => ({ ORCA_LAYOUT_OWNER_IS_MAIN: true })) - -// Preserve side-effect order: mocks, lifecycle, fixtures. -await import('./orca-runtime-tests/runtime-test-module-registration.spec') -const { OrcaRuntimeService } = await import('./orca-runtime') -await import('./orca-runtime-tests/orca-runtime-test-lifecycle.spec') -const { - HEADLESS_LEAF_ID, - TEST_WORKTREE_ID, - makeRuntimeStoreWithWorkspaceSession, - makeWorkspaceSessionWithHeadlessTerminal -} = await import('./orca-runtime-tests/orca-runtime-test-fixtures.spec') - -const PANE = { worktreeId: TEST_WORKTREE_ID, tabId: 'host-tab', leafId: HEADLESS_LEAF_ID } -const HOLD = wslDistroHoldMessage('Ubuntu', 'stopped') - -type SpawnArgs = { - sessionId?: string - worktreeId?: string - tabId?: string - leafId?: string - wslUserAct?: true -} - -async function heldPaneRuntime() { - const { runtimeStore } = makeRuntimeStoreWithWorkspaceSession( - makeWorkspaceSessionWithHeadlessTerminal() - ) - const runtime = new OrcaRuntimeService( - Object.assign(runtimeStore, { - getWorkspaceSessionHostIds: (): ExecutionHostId[] => [LOCAL_EXECUTION_HOST_ID] - }) - ) - runtime.subscribeWorkspaceLayouts(() => {}) - const spawn = vi.fn(committingSpawn(runtime, async (_args: SpawnArgs) => ({ id: 'pty-started' }))) - spawn.mockRejectedValueOnce(new Error(HOLD)) - runtime.setPtyController({ - spawn, - write: () => true, - kill: () => false, - stopAndWait: async () => true, - getForegroundProcess: async () => null, - listProcesses: async () => [] - }) - runtime.syncWindowGraph(0, { tabs: [], leaves: [] }) - await expect(runtime.ensureRestoredPaneStarted(PANE)).rejects.toThrow(HOLD) - return { runtime, spawn } -} - -function publishedPane(runtime: InstanceType) { - const { snapshot, unsubscribe } = runtime.subscribeWorkspaceLayouts(() => {}) - unsubscribe() - return snapshot - .find((entry) => entry.key === TEST_WORKTREE_ID) - ?.layout.tabs.flatMap((tab) => tab.terminal?.panes ?? []) - .find((pane) => pane.leafId === HEADLESS_LEAF_ID) -} - -describe('a pane main held for a stopped WSL distro (layout-owner build)', () => { - it('publishes failed, not held, so older desktops never offer the newer-build Reopen', async () => { - const { runtime, spawn } = await heldPaneRuntime() - - expect(publishedPane(runtime)).toMatchObject({ status: 'failed', statusReason: HOLD }) - // Main's own start is background work: it never names the user's act. - expect(spawn.mock.calls[0]?.[0]).not.toHaveProperty('wslUserAct') - }) - - it("starts as the user's act on Start, and the failure clears", async () => { - const { runtime, spawn } = await heldPaneRuntime() - - await expect(runtime.startWslHeldTerminalPanes([PANE])).resolves.toEqual({ started: true }) - - expect(spawn).toHaveBeenCalledTimes(2) - expect(spawn).toHaveBeenLastCalledWith(expect.objectContaining({ wslUserAct: true })) - expect(publishedPane(runtime)?.status).toBeUndefined() - }) -}) diff --git a/src/main/runtime/wsl-host-windows-drive-guard.test.ts b/src/main/runtime/wsl-host-windows-drive-guard.test.ts deleted file mode 100644 index c3ec03096ec..00000000000 --- a/src/main/runtime/wsl-host-windows-drive-guard.test.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { WslHostWindowsDriveRefusalError } from '../../shared/wsl-host-windows-drive-refusal' -import { - refuseWslHostWindowsDrivePath, - type WslHostWindowsDriveGuardDeps -} from './terminal/launch/wsl-host-windows-drive-guard' - -function deps(overrides: Partial = {}): WslHostWindowsDriveGuardDeps { - return { - isWslHost: () => true, - readMounts: async () => [ - { mountPoint: '/mnt/c', windowsRoot: 'C:\\' }, - { mountPoint: '/win/d drive', windowsRoot: 'D:\\' }, - { mountPoint: '/usr/lib/wsl/drivers', windowsRoot: null } - ], - realpath: async (path) => path, - ...overrides - } -} - -async function refusal(path: string, guardDeps = deps()): Promise { - return refuseWslHostWindowsDrivePath(path, guardDeps).then( - () => null, - (error: unknown) => error - ) -} - -describe('refuseWslHostWindowsDrivePath', () => { - it('refuses a drive mount with the path this computer uses for it', async () => { - const error = await refusal('/mnt/c/Users/me/src/') - expect(error).toBeInstanceOf(WslHostWindowsDriveRefusalError) - expect(error).toMatchObject({ data: { windowsPath: 'C:\\Users\\me\\src' } }) - await expect(refusal('/win/d drive')).resolves.toMatchObject({ - data: { windowsPath: 'D:\\' } - }) - }) - - it('refuses a Linux path that resolves onto a drive', async () => { - const error = await refusal('/home/me/src', deps({ realpath: async () => '/mnt/c/work/src' })) - expect(error).toMatchObject({ data: { windowsPath: 'C:\\work\\src' } }) - }) - - it('still refuses a missing folder by its spelling', async () => { - const error = await refusal( - '/mnt/c/new', - deps({ realpath: () => Promise.reject(new Error('ENOENT')) }) - ) - expect(error).toMatchObject({ data: { windowsPath: 'C:\\new' } }) - }) - - it('refuses without an alternative when the mount does not name its drive', async () => { - await expect(refusal('/usr/lib/wsl/drivers/x')).resolves.toMatchObject({ - data: { windowsPath: null } - }) - }) - - it('rereads mounts per check, so a drive mounted after orcad started is caught', async () => { - let mounted = false - const guardDeps = deps({ - readMounts: async () => (mounted ? [{ mountPoint: '/mnt/q', windowsRoot: 'Q:\\' }] : []) - }) - await expect(refusal('/mnt/q/src', guardDeps)).resolves.toBeNull() - mounted = true - await expect(refusal('/mnt/q/src', guardDeps)).resolves.toMatchObject({ - data: { windowsPath: 'Q:\\src' } - }) - }) - - it('allows Linux folders, look-alike prefixes, and every non-WSL host', async () => { - await expect(refusal('/home/me/src')).resolves.toBeNull() - await expect(refusal('/mnt/cache/src')).resolves.toBeNull() - // SSH hosts and the desktop never carry the WSL-host marker. - await expect(refusal('/mnt/c/src', deps({ isWslHost: () => false }))).resolves.toBeNull() - await expect(refusal('/mnt/c/src', deps({ readMounts: async () => [] }))).resolves.toBeNull() - }) -}) diff --git a/src/main/source-control/forge-provider-detection.test.ts b/src/main/source-control/forge-provider-detection.test.ts deleted file mode 100644 index 347f94e4bb6..00000000000 --- a/src/main/source-control/forge-provider-detection.test.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { execFileSync } from 'node:child_process' -import { mkdtemp, rm } from 'node:fs/promises' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { afterEach, expect, it, vi } from 'vitest' -import type * as GitExecFile from '../git/command-runner/git-exec-file' -import { gitExecFileAsync } from '../git/command-runner/git-exec-file' -import { getForgeProviderForRepository } from './forge-provider-detection' - -vi.mock('../git/command-runner/git-exec-file', async (importOriginal) => { - const actual = await importOriginal() - return { ...actual, gitExecFileAsync: vi.fn(actual.gitExecFileAsync) } -}) - -const roots: string[] = [] -afterEach(async () => { - await Promise.all(roots.splice(0).map((root) => rm(root, { recursive: true, force: true }))) -}) - -function remoteUrlReads(): number { - return vi - .mocked(gitExecFileAsync) - .mock.calls.filter(([args]) => args[0] === 'remote' && args[1] === 'get-url').length -} - -it('reads a repo remote once per forge detection and rereads it after the remote changes', async () => { - const repoPath = await mkdtemp(join(tmpdir(), 'orca-forge-remote-reads-')) - roots.push(repoPath) - execFileSync('git', ['init', '--quiet'], { cwd: repoPath }) - vi.mocked(gitExecFileAsync).mockClear() - - await expect( - getForgeProviderForRepository({ repoPath, executionHostId: 'local' }) - ).resolves.toBeNull() - expect(remoteUrlReads()).toBe(1) - - execFileSync('git', ['remote', 'add', 'origin', 'https://github.com/stablyai/orca.git'], { - cwd: repoPath - }) - vi.mocked(gitExecFileAsync).mockClear() - const provider = await getForgeProviderForRepository({ repoPath, executionHostId: 'local' }) - expect(provider?.id).toBe('github') - expect(remoteUrlReads()).toBe(1) -}) diff --git a/src/main/speech/openai-transcription-client.test.ts b/src/main/speech/openai-transcription-client.test.ts index b7729c348b9..515fa08098f 100644 --- a/src/main/speech/openai-transcription-client.test.ts +++ b/src/main/speech/openai-transcription-client.test.ts @@ -25,24 +25,6 @@ describe('sanitizeOpenAiTranscriptionErrorMessage', () => { describe('OpenAiTranscriptionSession', () => { afterEach(() => vi.unstubAllGlobals()) - it('sends the dictation language only when one is chosen', async () => { - const languages: (FormDataEntryValue | null)[] = [] - vi.stubGlobal('fetch', async (_url: string, init: RequestInit) => { - languages.push(init.body instanceof FormData ? init.body.get('language') : 'not multipart') - return new Response(JSON.stringify({ text: 'ok' })) - }) - for (const language of ['ko', undefined]) { - const session = new OpenAiTranscriptionSession( - 'openai-gpt-4o-mini-transcribe', - () => 'test-key', - language - ) - session.feedAudio(new Float32Array([0.1]), 16000) - await session.finish() - } - expect(languages).toEqual(['ko', null]) - }) - it('preserves multipart WAV bytes across owned, resampled and empty audio chunks', async () => { const uploads: Buffer[] = [] vi.stubGlobal('fetch', async (url: string, init: RequestInit) => { @@ -96,23 +78,4 @@ describe('OpenAiTranscriptionSession', () => { -32768, -32768, -16384, 0, 0, 16384, 32767, 32767, 0, 32767, -32768, 0, 24575 ]) }) - - it('keeps the first 10 minutes and reports the cap once instead of throwing', async () => { - const uploadBytes: number[] = [] - vi.stubGlobal('fetch', async (_url: string, init: RequestInit) => { - const file = init.body instanceof FormData ? init.body.get('file') : null - uploadBytes.push(file instanceof File ? file.size : -1) - return new Response(JSON.stringify({ text: 'first ten minutes' })) - }) - const session = new OpenAiTranscriptionSession( - 'openai-gpt-4o-mini-transcribe', - () => 'test-key' - ) - const sevenSeconds = new Float32Array(7 * 16000).fill(0.1) - const capReports = Array.from({ length: 90 }, () => session.feedAudio(sevenSeconds, 16000)) - expect(capReports.indexOf(true)).toBe(85) - expect(capReports.filter(Boolean)).toHaveLength(1) - expect(await session.finish()).toBe('first ten minutes') - expect(uploadBytes).toEqual([44 + 600 * 16000 * 2]) - }) }) diff --git a/src/main/speech/stt-worker-paths.test.ts b/src/main/speech/stt-worker-paths.test.ts deleted file mode 100644 index be1e455d6e2..00000000000 --- a/src/main/speech/stt-worker-paths.test.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { mkdtempSync, rmSync, writeFileSync } from 'node:fs' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { afterEach, describe, expect, it } from 'vitest' -import { installFakeAppEnvironment } from '../../../config/scripts/test-runtime/environment/vitest-host-ports-setup' -import { SPEECH_RECOGNIZER_DIR_ENV } from '../../shared/speech-recognizer-package' -import { getSherpaModulePath, hasLocalSpeechRecognizer } from './stt-worker-paths' - -const roots: string[] = [] -afterEach(() => { - delete process.env[SPEECH_RECOGNIZER_DIR_ENV] - for (const root of roots.splice(0)) { - rmSync(root, { recursive: true, force: true }) - } -}) - -// orcad: a packaged host with no Electron resources tree. -describe('speech worker paths on orcad (#31174)', () => { - it('has no on-device recognizer unless orca serve names one', () => { - installFakeAppEnvironment({ isPackaged: () => true }) - expect(getSherpaModulePath()).toBeNull() - expect(hasLocalSpeechRecognizer()).toBe(false) - }) - - it("uses the installed app's recognizer that orca serve names", () => { - installFakeAppEnvironment({ isPackaged: () => true }) - const dir = mkdtempSync(join(tmpdir(), 'orca-recognizer-')) - roots.push(dir) - writeFileSync(join(dir, 'sherpa-onnx.node'), '') - process.env[SPEECH_RECOGNIZER_DIR_ENV] = dir - expect(getSherpaModulePath()).toBe(dir) - }) - - it('ignores a named directory that holds no recognizer', () => { - installFakeAppEnvironment({ isPackaged: () => true }) - const dir = mkdtempSync(join(tmpdir(), 'orca-recognizer-')) - roots.push(dir) - process.env[SPEECH_RECOGNIZER_DIR_ENV] = dir - expect(getSherpaModulePath()).toBeNull() - }) -}) diff --git a/src/main/ssh/legacy-relay/legacy-relay-bridge-teardown.test.ts b/src/main/ssh/legacy-relay/legacy-relay-bridge-teardown.test.ts deleted file mode 100644 index f025edc30a7..00000000000 --- a/src/main/ssh/legacy-relay/legacy-relay-bridge-teardown.test.ts +++ /dev/null @@ -1,169 +0,0 @@ -import { beforeEach, describe, expect, it, vi, type Mock } from 'vitest' -import type { LegacyRelayBridgedPane } from '../../../shared/legacy-relay-bridge-contract' -import { toAppSshPtyId } from '../../../shared/ssh-pty-id' -import type { SshRemotePtyLease } from '../../../shared/ssh-types' -import type { LegacyRelayTargetBridgeDeps } from './legacy-relay-target-bridge' -import type { LegacyRelayBridgeHost } from './legacy-relay-bridge-registry' -import { unusedSshConnection } from '../unused-host-transport.test-fixture' - -const TARGET = 'ssh-box' -const PTY = toAppSshPtyId(TARGET, 'pty-1') - -const renderer = vi.hoisted(() => ({ - listeners: new Set<(panes: LegacyRelayBridgedPane[]) => void>() -})) - -// The bridge's relay listing is out of scope: this one lists the leased pane live on refresh. -vi.mock('./legacy-relay-target-bridge', () => ({ - LegacyRelayTargetBridge: class { - private listed: LegacyRelayBridgedPane[] = [] - constructor(private readonly deps: LegacyRelayTargetBridgeDeps) {} - snapshot(): LegacyRelayBridgedPane[] { - return this.listed - } - livePaneCount(): number { - return this.listed.length - } - async refresh(): Promise { - this.listed = this.deps.leases().map((row) => ({ - ptyId: toAppSshPtyId(this.deps.targetId, row.ptyId), - targetId: this.deps.targetId, - tabId: row.tabId ?? '', - ...(row.leafId ? { leafId: row.leafId } : {}), - state: 'live' as const - })) - this.deps.onPanesChanged() - } - async attach(_ptyId: string, atSnapshot?: (replay: string) => void) { - atSnapshot?.('SCREEN') - return { status: 'attached' as const, replay: 'SCREEN' } - } - dispose(): void { - this.listed = [] - this.deps.onPanesChanged() - } - } -})) - -vi.stubGlobal('window', { - api: { - legacyRelayBridge: { - listPanes: async () => [], - onPanes: (listener: (panes: LegacyRelayBridgedPane[]) => void) => { - renderer.listeners.add(listener) - return () => renderer.listeners.delete(listener) - } - } - } -}) - -const registry = await import('./legacy-relay-bridge-registry') -const { legacyRelayBridgePtyIdForPane } = - await import('../../../renderer/src/components/terminal-pane/pty-transport/legacy-relay/legacy-relay-bridge-panes') - -let leases: SshRemotePtyLease[] -let report: Mock - -function lease(): SshRemotePtyLease { - return { - targetId: TARGET, - ptyId: 'pty-1', - tabId: 'tab-1', - leafId: 'leaf-1', - state: 'detached', - createdAt: 1, - updatedAt: 1 - } -} - -beforeEach(async () => { - leases = [lease()] - report = vi.fn() - registry.installLegacyRelayBridge({ - leases: () => leases, - retireLease: vi.fn(), - recordStop: vi.fn(), - connection: () => null, - // Main publishes to the window as legacy-relay-bridge-ipc.ts does. - onPanesChanged: (panes) => renderer.listeners.forEach((listener) => listener(panes)), - onData: vi.fn(), - onReplay: vi.fn(), - onExit: vi.fn(), - report - }) - await registry.startLegacyRelayBridge(TARGET) -}) - -describe('a hung-up legacy relay bridge (loss of contact is not exit)', () => { - it('keeps the panes it served as unverifiable while their leases are held', () => { - registry.stopLegacyRelayBridge(TARGET) - - expect(registry.legacyRelayBridgedPanes()).toEqual([ - { ptyId: PTY, targetId: TARGET, tabId: 'tab-1', leafId: 'leaf-1', state: 'unverifiable' } - ]) - }) - - it('empties the list once the target and its leases are removed', () => { - registry.stopLegacyRelayBridge(TARGET) - expect(registry.legacyRelayBridgedPanes()).toHaveLength(1) - - leases = [] - registry.forgetLegacyRelayTarget(TARGET) - - expect(registry.legacyRelayBridgedPanes()).toEqual([]) - }) - - it('publishes an empty list when the next connect finds the leases retired', async () => { - registry.stopLegacyRelayBridge(TARGET) - const published: LegacyRelayBridgedPane[][] = [] - const record = (panes: LegacyRelayBridgedPane[]): void => void published.push(panes) - renderer.listeners.add(record) - - leases = [] - await registry.startLegacyRelayBridge(TARGET) - renderer.listeners.delete(record) - - expect(published.at(-1)).toEqual([]) - }) - - it('still sends a pane that remounts during the reconnect gap to the bridge', () => { - // Disconnect, then the pane's transport is rebuilt before the next connect starts a bridge. - registry.stopLegacyRelayBridge(TARGET) - - expect( - legacyRelayBridgePtyIdForPane({ - tabId: 'web-terminal-tab-1', - leafId: 'leaf-1', - boundPtyId: null - }) - ).toBe(PTY) - }) -}) - -describe('attaching a bridged pane', () => { - it('sends a reattach screen in output order and only once', async () => { - const replays: string[] = [] - const connection = unusedSshConnection() - registry.installLegacyRelayBridge({ - leases: () => leases, - retireLease: vi.fn(), - recordStop: vi.fn(), - connection: () => connection, - onPanesChanged: vi.fn(), - onData: vi.fn(), - onReplay: (_ptyId, replay) => replays.push(replay), - onExit: vi.fn(), - report: vi.fn() - }) - await expect(registry.attachLegacyRelayPane(PTY)).resolves.toEqual({ - status: 'attached', - replay: 'SCREEN' - }) - expect(replays).toEqual([]) - await expect(registry.attachLegacyRelayPane(PTY, true)).resolves.toEqual({ - status: 'attached', - replay: '' - }) - expect(replays).toEqual(['SCREEN']) - }) -}) diff --git a/src/main/startup/serve-pinned-bind-host.test.ts b/src/main/startup/serve-pinned-bind-host.test.ts index a7d9f8b261e..01ffca08b0b 100644 --- a/src/main/startup/serve-pinned-bind-host.test.ts +++ b/src/main/startup/serve-pinned-bind-host.test.ts @@ -1,38 +1,10 @@ import { describe, expect, it } from 'vitest' -import { WS_BIND_HOST_LOOPBACK } from '../runtime/rpc/server/runtime-rpc-pairing-types' -import { normalizeServeModeArgv } from './serve-mode-argv' +import '../runtime/rpc/server/runtime-rpc-pairing-types' +import './serve-mode-argv' import { getServeOptions } from './serve-options' -import { resolveServePinnedBindHost } from './serve-pinned-bind-host' +import './serve-pinned-bind-host' describe('Electron serve listener pin', () => { - it('leaves the listener unpinned when --bind is absent, as before --bind existed', () => { - const options = getServeOptions(['/AppRun', '--serve', '--serve-port', '6768']) - expect(options).not.toHaveProperty('bind') - expect(resolveServePinnedBindHost({ orcadSidecar: false, serveOptions: options })).toBe( - undefined - ) - expect(resolveServePinnedBindHost({ orcadSidecar: false, serveOptions: null })).toBe(undefined) - }) - - it('pins an explicit bind from either argv form, normalizing localhost', () => { - const internal = getServeOptions(['/AppRun', '--serve', '--serve-bind', '100.64.1.20']) - const cliForm = getServeOptions( - normalizeServeModeArgv(['/AppRun', 'serve', '--bind', 'localhost']) - ) - expect(resolveServePinnedBindHost({ orcadSidecar: false, serveOptions: internal })).toBe( - '100.64.1.20' - ) - expect(resolveServePinnedBindHost({ orcadSidecar: false, serveOptions: cliForm })).toBe( - '127.0.0.1' - ) - }) - - it('keeps the orcad browser sidecar on loopback regardless of --bind', () => { - expect( - resolveServePinnedBindHost({ orcadSidecar: true, serveOptions: { bind: '0.0.0.0' } }) - ).toBe(WS_BIND_HOST_LOOPBACK) - }) - it('rejects hostnames, empty values and --mobile-pairing with a narrower bind', () => { expect(() => getServeOptions(['/AppRun', '--serve', '--serve-bind'])).toThrow( 'Missing value for --serve-bind.' diff --git a/src/main/window/clipboard-image-thumbnail.test.ts b/src/main/window/clipboard-image-thumbnail.test.ts deleted file mode 100644 index 8a513e339a1..00000000000 --- a/src/main/window/clipboard-image-thumbnail.test.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import { buildClipboardImageThumbnail } from './clipboard-image-thumbnail' - -function fakeImage(overrides: Partial[0]>) { - return { - isEmpty: () => false, - getSize: () => ({ height: 10, width: 10 }), - resize: vi.fn(() => ({ toDataURL: () => 'data:image/png;base64,SMALL' })), - toDataURL: () => 'data:image/png;base64,FULL', - ...overrides - } -} - -describe('buildClipboardImageThumbnail', () => { - it('downscales to the thumbnail budget but reports the source dimensions', () => { - const image = fakeImage({ getSize: () => ({ height: 1600, width: 3200 }) }) - - expect(buildClipboardImageThumbnail(image)).toEqual({ - dataUrl: 'data:image/png;base64,SMALL', - height: 1600, - width: 3200 - }) - expect(image.resize).toHaveBeenCalledWith({ height: 160, quality: 'good', width: 320 }) - }) -}) diff --git a/src/main/window/main-window-activity.test.ts b/src/main/window/main-window-activity.test.ts deleted file mode 100644 index 25a245750bf..00000000000 --- a/src/main/window/main-window-activity.test.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { EventEmitter } from 'node:events' -import { describe, expect, it, vi } from 'vitest' - -const handlers = vi.hoisted(() => new Map unknown>()) -vi.mock('electron', () => ({ - ipcMain: { - handle: (channel: string, handler: () => unknown) => handlers.set(channel, handler), - removeHandler: (channel: string) => handlers.delete(channel) - } -})) - -import { installMainWindowActivityRelay, type ActivityWindow } from './main-window-activity' - -function fakeWindow() { - const state = { focused: true, visible: true, minimized: false } - const sent: boolean[] = [] - const emitter = new EventEmitter() - const window: ActivityWindow = { - isDestroyed: () => false, - isFocused: () => state.focused, - isVisible: () => state.visible, - isMinimized: () => state.minimized, - on: (event, listener) => emitter.on(event, listener), - webContents: { isDestroyed: () => false, send: (_channel, active) => sent.push(active) } - } - return { window, emitter, state, sent } -} - -describe('installMainWindowActivityRelay', () => { - it('reports the window inactive when it blurs, minimizes or hides, once per change', () => { - const { window, emitter, state, sent } = fakeWindow() - const relay = installMainWindowActivityRelay(window) - expect(handlers.get('window:isActive')?.()).toBe(true) - emitter.emit('focus') - state.minimized = true - emitter.emit('minimize') - emitter.emit('blur') - state.minimized = false - emitter.emit('restore') - state.visible = false - emitter.emit('hide') - expect(sent).toEqual([true, false, true, false]) - relay.dispose() - expect(handlers.has('window:isActive')).toBe(false) - }) -}) diff --git a/src/main/window/native-chat-pasted-text-file.test.ts b/src/main/window/native-chat-pasted-text-file.test.ts index 71edccb972a..3770e9f8259 100644 --- a/src/main/window/native-chat-pasted-text-file.test.ts +++ b/src/main/window/native-chat-pasted-text-file.test.ts @@ -33,23 +33,4 @@ describe('a long paste saved as a file', () => { expect(path.dirname(path.dirname(saved))).toBe(store.rootDir) expect(readFileSync(saved, 'utf8')).toBe('log line ✓\n') }) - - it("goes to the chat's store on its paired server, under a text paste's name", async () => { - mocks.upload.mockResolvedValue('/srv/agent-session-attachments/u1/orca-paste-1-a.txt') - const target = { - sessionId: 'session-1', - expectedEnvironmentPairingRevision: 7, - expectedEnvironmentRuntimeId: 'runtime-a' - } - await expect( - savePastedTextAsFile({ - text: 'diff', - runtimeEnvironmentId: 'env-1', - agentSessionAttachment: target - }) - ).resolves.toBe('/srv/agent-session-attachments/u1/orca-paste-1-a.txt') - const [sentTarget, environmentId, , buffer, name] = mocks.upload.mock.calls[0] ?? [] - expect([sentTarget, environmentId, buffer.toString('utf8')]).toEqual([target, 'env-1', 'diff']) - expect(name).toMatch(/^orca-paste-\d+-.+\.txt$/) - }) }) diff --git a/src/main/workspaces/catalog/worktree-lineage-host-peers.test.ts b/src/main/workspaces/catalog/worktree-lineage-host-peers.test.ts deleted file mode 100644 index 91dccd85829..00000000000 --- a/src/main/workspaces/catalog/worktree-lineage-host-peers.test.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { describe, expect, it } from 'vitest' -import type { Repo } from '../../../shared/repo-types' -import type { WorkspaceLineage } from '../../../shared/worktree/lineage-types' -import type { Worktree } from '../../../shared/worktree/types' -import { projectWorktreeLineageWithHostPeers } from './worktree-lineage-host-peers' - -const repo: Repo = { id: 'r', path: '/r', displayName: 'r', badgeColor: '', addedAt: 0 } - -function row(id: string): Worktree { - return { - id, - instanceId: `${id}#1`, - repoId: 'r', - path: id.split('::')[1], - head: 'abc', - branch: 'refs/heads/main', - isBare: false, - isMainWorktree: false, - displayName: id, - comment: '', - linkedIssue: null, - linkedPR: null, - linkedLinearIssue: null, - isArchived: false, - isUnread: false, - isPinned: false, - sortOrder: 0, - lastActivityAt: 0 - } -} - -const record: WorkspaceLineage = { - childWorkspaceKey: 'worktree:r::/r/child', - childInstanceId: 'r::/r/child#1', - parentWorkspaceKey: 'folder:f-1', - parentInstanceId: 'f-1', - origin: 'manual', - capture: { source: 'manual-action', confidence: 'explicit' }, - createdAt: 1 -} - -describe('projectWorktreeLineageWithHostPeers', () => { - it('attaches each listed row’s own folder parent, so a twin on another host keeps it', () => { - const projected = projectWorktreeLineageWithHostPeers( - { - getRepos: () => [repo], - getAllWorktreeMeta: () => ({}), - getAllWorktreeMetaForHost: () => ({}), - getAllWorktreeLineage: () => ({}), - getAllWorkspaceLineage: () => ({ 'worktree:r::/r/child': record }) - }, - repo, - [row('r::/r/child'), row('r::/r/other')] - ) - expect(projected.map((entry) => [entry.id, entry.workspaceLineage])).toEqual([ - ['r::/r/child', record], - ['r::/r/other', null] - ]) - }) -}) diff --git a/src/renderer/src/components/native-chat/composer/submit/native-chat-composer-send-state.test.ts b/src/renderer/src/components/native-chat/composer/submit/native-chat-composer-send-state.test.ts deleted file mode 100644 index 7bdc60e7412..00000000000 --- a/src/renderer/src/components/native-chat/composer/submit/native-chat-composer-send-state.test.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { describe, expect, it } from 'vitest' - -import { nativeChatComposerSendState } from './native-chat-composer-send-state' - -function chordSteersHead( - overrides: Partial[0]> & { - followUp?: 'queue' | 'steer' - } = {} -): boolean { - const { followUp = 'queue', ...input } = overrides - const working = input.isWorking ?? false - const structuredTransport = { - optionSnapshot: [], - sendFollowUp: { action: followUp, offersChoice: working } - } - return nativeChatComposerSendState({ - agent: 'claude', - draft: '', - messageDelivery: true, - imageAttachments: [], - pastedTextSaving: false, - disabled: false, - structuredTransport, - editSession: undefined, - isWorking: false, - canStop: true, - ...input - }).chordSteersHead -} - -describe('nativeChatComposerSendState chordSteersHead', () => { - it('sends the head card from an empty composer where steering means sending it now', () => { - // No turn runs (a paused queue after Stop): the card's own Send. - expect(chordSteersHead()).toBe(true) - // Mid-turn with follow-ups queued: the chord's other way is a steer. - expect(chordSteersHead({ isWorking: true })).toBe(true) - }) - - it.each([ - ['the chord queues mid-turn', { isWorking: true, followUp: 'steer' as const }], - ['a queued card is being edited', { editSession: { canSave: true } }], - ['the composer submits a goal, not a message', { messageDelivery: false }] - ])('never does where %s', (_case, overrides) => { - expect(chordSteersHead(overrides)).toBe(false) - }) -}) diff --git a/src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/input/remote-runtime-disconnected-input-grace.test.ts b/src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/input/remote-runtime-disconnected-input-grace.test.ts deleted file mode 100644 index 8e6f1c950d6..00000000000 --- a/src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/input/remote-runtime-disconnected-input-grace.test.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { - REMOTE_RUNTIME_DISCONNECTED_INPUT_GRACE_MS, - createRemoteRuntimeDisconnectedInputGrace -} from './remote-runtime-disconnected-input-grace' - -describe('disconnected input grace', () => { - it('expires once the latch outlives its grace', () => { - let now = 0 - const grace = createRemoteRuntimeDisconnectedInputGrace(() => now) - grace.start() - now = REMOTE_RUNTIME_DISCONNECTED_INPUT_GRACE_MS - 1 - expect(grace.isExpired()).toBe(false) - now += 1 - expect(grace.isExpired()).toBe(true) - }) - - it('carries a retry begun inside the grace, then measures the next latch from the first', () => { - let now = 0 - const grace = createRemoteRuntimeDisconnectedInputGrace(() => now) - grace.start() - now = REMOTE_RUNTIME_DISCONNECTED_INPUT_GRACE_MS - 10_000 - grace.carryThroughRetry() - now = REMOTE_RUNTIME_DISCONNECTED_INPUT_GRACE_MS + 60_000 - expect(grace.isExpired()).toBe(false) - // The retry gave up again: a fresh latch must not restart the clock. - grace.start() - expect(grace.isExpired()).toBe(true) - }) - - it('has nothing to carry before any latch, and forgets everything on reset', () => { - let now = 0 - const grace = createRemoteRuntimeDisconnectedInputGrace(() => now) - grace.carryThroughRetry() - grace.start() - now = REMOTE_RUNTIME_DISCONNECTED_INPUT_GRACE_MS - expect(grace.isExpired()).toBe(true) - grace.reset() - expect(grace.isExpired()).toBe(false) - }) -}) diff --git a/src/renderer/src/components/terminal-pane/render-health/recovery/terminal-pane-recovery-host-rebind-cap.test.ts b/src/renderer/src/components/terminal-pane/render-health/recovery/terminal-pane-recovery-host-rebind-cap.test.ts deleted file mode 100644 index 7d450520c20..00000000000 --- a/src/renderer/src/components/terminal-pane/render-health/recovery/terminal-pane-recovery-host-rebind-cap.test.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { afterEach, beforeEach, expect, it, vi } from 'vitest' -import { - _resetTerminalPaneRecoveryForTests, - captureTerminalPaneRecoveryGeneration -} from './terminal-pane-recovery' -import { requestAndSettle } from './terminal-recovery-ledger-test-driver' -import { - recoveryLedgerMocks as mocks, - resetRecoveryLedgerStore, - setTerminalTabs -} from './terminal-recovery-ledger-test-store' - -vi.mock('@/store/index', async () => { - const store = await import('./terminal-recovery-ledger-test-store') - return { useAppStore: { getState: () => store.recoveryLedgerStoreState() } } -}) - -vi.mock('@/lib/crash-breadcrumb-recorder', async () => { - const store = await import('./terminal-recovery-ledger-test-store') - return { recordRendererCrashBreadcrumb: store.recoveryLedgerMocks.recordRendererCrashBreadcrumb } -}) - -beforeEach(() => { - _resetTerminalPaneRecoveryForTests() - resetRecoveryLedgerStore() - setTerminalTabs([{ id: 'tab-1' }]) -}) - -afterEach(() => { - vi.useRealTimers() -}) - -it('stops re-binding at the window cap when the host keeps contradicting its exit record', async () => { - vi.useFakeTimers() - const rebind = () => - requestAndSettle( - { - tabId: 'tab-1', - ptyId: 'remote:env@@terminal-1', - reason: 'host-rebound-exited-pane', - trigger: 'host-evidence', - terminalRecoveryGeneration: captureTerminalPaneRecoveryGeneration('tab-1') - }, - // Each remounted pane is settled as exited again by the same contradicting host. - 'failed' - ) - - const outcomes: boolean[] = [] - for (let attempt = 0; attempt < 5; attempt += 1) { - vi.setSystemTime(attempt * 20_000) - outcomes.push(await rebind()) - } - - expect(outcomes).toEqual([true, true, true, false, false]) - await vi.advanceTimersByTimeAsync(10 * 60_000) - expect(mocks.remountTerminalTabForRecovery).toHaveBeenCalledTimes(3) -}) diff --git a/src/renderer/src/components/terminal-pane/session-restore/spawn-deferral/TerminalSleepingPaneOverlay.test.tsx b/src/renderer/src/components/terminal-pane/session-restore/spawn-deferral/TerminalSleepingPaneOverlay.test.tsx deleted file mode 100644 index cd70670a5af..00000000000 --- a/src/renderer/src/components/terminal-pane/session-restore/spawn-deferral/TerminalSleepingPaneOverlay.test.tsx +++ /dev/null @@ -1,45 +0,0 @@ -// @vitest-environment happy-dom - -import '@testing-library/jest-dom/vitest' -import { cleanup, render, screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' -import { afterEach, describe, expect, it, vi } from 'vitest' -import { TerminalSleepingPaneOverlay } from './TerminalSleepingPaneOverlay' - -vi.mock('@/i18n/i18n', () => ({ - translate: (_key: string, fallback: string) => fallback -})) - -afterEach(cleanup) - -describe('TerminalSleepingPaneOverlay', () => { - it('resumes once from the button and from anywhere on the pane', async () => { - const onResume = vi.fn() - const user = userEvent.setup() - render() - - await user.click(screen.getByRole('button', { name: 'Resume' })) - expect(onResume).toHaveBeenCalledOnce() - await user.click(screen.getByText('Sleeping — click to resume')) - expect(onResume).toHaveBeenCalledTimes(2) - }) - - it('offers to resume automatic restores only when the host can clear its pause', async () => { - const onResume = vi.fn() - const onResumeAutomaticRestores = vi.fn() - const user = userEvent.setup() - const { rerender } = render() - expect(screen.queryByRole('button', { name: 'Resume automatic restores' })).toBeNull() - - rerender( - - ) - await user.click(screen.getByRole('button', { name: 'Resume automatic restores' })) - expect(onResumeAutomaticRestores).toHaveBeenCalledOnce() - expect(onResume).not.toHaveBeenCalled() - }) -}) diff --git a/src/renderer/src/components/terminal-pane/snapshots/restored-snapshot-coverage.test.ts b/src/renderer/src/components/terminal-pane/snapshots/restored-snapshot-coverage.test.ts deleted file mode 100644 index 4a8938b1266..00000000000 --- a/src/renderer/src/components/terminal-pane/snapshots/restored-snapshot-coverage.test.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { restoredSnapshotPaintsPrintableContent } from './restored-snapshot-coverage' - -describe('restoredSnapshotPaintsPrintableContent', () => { - it('accepts a snapshot with cell content in the frame or the scrollback', () => { - expect(restoredSnapshotPaintsPrintableContent({ data: '\x1b[0m$ ls\r\n' })).toBe(true) - expect( - restoredSnapshotPaintsPrintableContent({ - data: '\x1b[H\x1b[2J', - scrollbackAnsi: 'older\r\n' - }) - ).toBe(true) - }) - - it('rejects a mode-rehydration-only image, which no amount of output renders to', () => { - expect( - restoredSnapshotPaintsPrintableContent({ - data: '\x1b[0m\x1b[?25h\x1b[?7h' - }) - ).toBe(false) - expect(restoredSnapshotPaintsPrintableContent({ data: '\x1b]0;title\x07' })).toBe(false) - expect(restoredSnapshotPaintsPrintableContent({})).toBe(false) - expect( - restoredSnapshotPaintsPrintableContent({ - data: '\x1b[2J', - scrollbackAnsi: ' \r\n\t' - }) - ).toBe(false) - }) -}) diff --git a/src/renderer/src/components/terminal-pane/snapshots/shutdown-buffer-captures.test.ts b/src/renderer/src/components/terminal-pane/snapshots/shutdown-buffer-captures.test.ts deleted file mode 100644 index af003ff1258..00000000000 --- a/src/renderer/src/components/terminal-pane/snapshots/shutdown-buffer-captures.test.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { afterEach, describe, expect, it, vi } from 'vitest' -import { - captureTerminalShutdownBuffersBestEffort, - shutdownBufferCaptures -} from './shutdown-buffer-captures' - -afterEach(() => { - shutdownBufferCaptures.clear() -}) - -describe('captureTerminalShutdownBuffersBestEffort', () => { - it('continues after one tab capture throws', () => { - const failed = vi.fn(() => { - throw new Error('layout capture failed') - }) - const succeeded = vi.fn() - shutdownBufferCaptures.set('tab-failed', failed) - shutdownBufferCaptures.set('tab-succeeded', succeeded) - - expect(() => - captureTerminalShutdownBuffersBestEffort(['tab-failed', 'tab-succeeded'], { - includeLocalBuffers: false - }) - ).not.toThrow() - expect(failed).toHaveBeenCalledWith({ includeLocalBuffers: false }) - expect(succeeded).toHaveBeenCalledWith({ includeLocalBuffers: false }) - }) - - it('reports incomplete coverage when a tab throws or has no registered capture', () => { - shutdownBufferCaptures.set('registered', vi.fn()) - shutdownBufferCaptures.set('throwing', () => { - throw new Error('layout capture failed') - }) - - expect( - captureTerminalShutdownBuffersBestEffort(['registered', 'throwing', 'unregistered']) - ).toEqual({ requested: 3, captured: 1 }) - }) -}) diff --git a/src/renderer/src/components/terminal-pane/titles/cache-timer-seeding.test.ts b/src/renderer/src/components/terminal-pane/titles/cache-timer-seeding.test.ts deleted file mode 100644 index 42f80cfbf92..00000000000 --- a/src/renderer/src/components/terminal-pane/titles/cache-timer-seeding.test.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { shouldSeedCacheTimerOnInitialTitle } from './cache-timer-seeding' - -describe('shouldSeedCacheTimerOnInitialTitle', () => { - it('does not seed for fresh Claude tabs that have not been restored', () => { - expect( - shouldSeedCacheTimerOnInitialTitle({ - rawTitle: '✳ Claude Code', - allowInitialIdleSeed: false, - existingTimerStartedAt: null, - promptCacheTimerEnabled: true - }) - ).toBe(false) - }) - - it('seeds for restored Claude tabs that are already idle', () => { - expect( - shouldSeedCacheTimerOnInitialTitle({ - rawTitle: '✳ Claude Code', - allowInitialIdleSeed: true, - existingTimerStartedAt: null, - promptCacheTimerEnabled: true - }) - ).toBe(true) - }) - - it('does not seed for restored Claude tabs that are still working', () => { - expect( - shouldSeedCacheTimerOnInitialTitle({ - rawTitle: '⠂ Claude Code', - allowInitialIdleSeed: true, - existingTimerStartedAt: null, - promptCacheTimerEnabled: true - }) - ).toBe(false) - }) - - it('does not seed when a timer already exists for the pane', () => { - expect( - shouldSeedCacheTimerOnInitialTitle({ - rawTitle: '✳ Claude Code', - allowInitialIdleSeed: true, - existingTimerStartedAt: Date.now(), - promptCacheTimerEnabled: true - }) - ).toBe(false) - }) - - it('treats null settings as provisionally enabled during startup hydration', () => { - expect( - shouldSeedCacheTimerOnInitialTitle({ - rawTitle: '✳ Claude Code', - allowInitialIdleSeed: true, - existingTimerStartedAt: null, - promptCacheTimerEnabled: null - }) - ).toBe(true) - }) -}) diff --git a/src/renderer/src/components/terminal-pane/titles/pane-title-overlay-rects.test.ts b/src/renderer/src/components/terminal-pane/titles/pane-title-overlay-rects.test.ts deleted file mode 100644 index 50f03e0611d..00000000000 --- a/src/renderer/src/components/terminal-pane/titles/pane-title-overlay-rects.test.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { - arePaneTitleOverlayRectsEqual, - clearPaneTitleOverlayRects -} from './pane-title-overlay-rects' - -describe('clearPaneTitleOverlayRects', () => { - // Stable identity prevents React #185 loops: a fresh empty object commits another render on every pass. - it('returns the same reference when already empty', () => { - const prev = {} - expect(clearPaneTitleOverlayRects(prev)).toBe(prev) - }) - - it('clears a populated map to a new empty object', () => { - const prev = { 1: { left: 10, top: 20, width: 30 } } - const next = clearPaneTitleOverlayRects(prev) - - expect(next).not.toBe(prev) - expect(next).toEqual({}) - }) - - it('is stable across repeated calls once empty', () => { - const first = clearPaneTitleOverlayRects({ 1: { left: 1, top: 2, width: 3 } }) - expect(clearPaneTitleOverlayRects(first)).toBe(first) - }) -}) - -describe('arePaneTitleOverlayRectsEqual', () => { - it('treats sub-pixel drift as equal', () => { - expect( - arePaneTitleOverlayRectsEqual( - { 1: { left: 10, top: 20, width: 30 } }, - { 1: { left: 10.4, top: 20.4, width: 30.4 } } - ) - ).toBe(true) - }) - - it('treats a half-pixel-or-greater move as different', () => { - expect( - arePaneTitleOverlayRectsEqual( - { 1: { left: 10, top: 20, width: 30 } }, - { 1: { left: 10.5, top: 20, width: 30 } } - ) - ).toBe(false) - }) - - it('treats differing pane counts as different', () => { - expect( - arePaneTitleOverlayRectsEqual( - { 1: { left: 0, top: 0, width: 10 } }, - { 1: { left: 0, top: 0, width: 10 }, 2: { left: 0, top: 0, width: 10 } } - ) - ).toBe(false) - }) - - it('reports two empty maps as equal', () => { - expect(arePaneTitleOverlayRectsEqual({}, {})).toBe(true) - }) -}) diff --git a/src/renderer/src/components/terminal-pane/titles/restored-pane-titles.test.ts b/src/renderer/src/components/terminal-pane/titles/restored-pane-titles.test.ts deleted file mode 100644 index 87e6b1303ca..00000000000 --- a/src/renderer/src/components/terminal-pane/titles/restored-pane-titles.test.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { mapRestoredPaneTitlesByPaneId } from './restored-pane-titles' - -describe('mapRestoredPaneTitlesByPaneId', () => { - it('restores persisted pane titles onto newly-created pane ids', () => { - const restoredPaneByLeafId = new Map([ - ['11111111-1111-4111-8111-111111111111', 7], - ['22222222-2222-4222-8222-222222222222', 3] - ]) - - expect( - mapRestoredPaneTitlesByPaneId( - { - '11111111-1111-4111-8111-111111111111': 'build logs', - '22222222-2222-4222-8222-222222222222': 'test runner' - }, - restoredPaneByLeafId - ) - ).toEqual({ - 7: 'build logs', - 3: 'test runner' - }) - }) - - it('ignores stale leaf ids and empty persisted titles', () => { - expect( - mapRestoredPaneTitlesByPaneId( - { - '11111111-1111-4111-8111-111111111111': 'build logs', - '22222222-2222-4222-8222-222222222222': '', - '33333333-3333-4333-8333-333333333333': 'closed pane' - }, - new Map([['11111111-1111-4111-8111-111111111111', 2]]) - ) - ).toEqual({ 2: 'build logs' }) - }) -}) diff --git a/src/renderer/src/components/terminal-pane/viewport/pane-visibility-identity.test.ts b/src/renderer/src/components/terminal-pane/viewport/pane-visibility-identity.test.ts deleted file mode 100644 index f64196e656b..00000000000 --- a/src/renderer/src/components/terminal-pane/viewport/pane-visibility-identity.test.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { - getPreviousVisibleForTerminalPane, - isTerminalPaneVisibilityResume -} from './pane-visibility-identity' - -describe('terminal pane visibility resume tracking', () => { - it('ignores previous visibility from a different terminal identity', () => { - expect( - getPreviousVisibleForTerminalPane({ - previous: { tabId: 'tab-old', cwd: '/repo', isVisible: false }, - tabId: 'tab-new', - cwd: '/repo' - }) - ).toBeNull() - expect( - getPreviousVisibleForTerminalPane({ - previous: { tabId: 'tab-1', cwd: '/repo-old', isVisible: false }, - tabId: 'tab-1', - cwd: '/repo-new' - }) - ).toBeNull() - expect( - getPreviousVisibleForTerminalPane({ - previous: { tabId: 'tab-1', cwd: '/repo', isVisible: false }, - tabId: 'tab-1', - cwd: '/repo' - }) - ).toBe(false) - }) - - it('identifies only hidden-to-visible changes as visibility resumes', () => { - expect(isTerminalPaneVisibilityResume({ previousIsVisible: null, isVisible: true })).toBe(false) - expect(isTerminalPaneVisibilityResume({ previousIsVisible: true, isVisible: true })).toBe(false) - expect(isTerminalPaneVisibilityResume({ previousIsVisible: true, isVisible: false })).toBe( - false - ) - expect(isTerminalPaneVisibilityResume({ previousIsVisible: false, isVisible: true })).toBe(true) - }) -}) diff --git a/src/renderer/src/components/terminal-pane/viewport/terminal-selection-fit-guard.test.ts b/src/renderer/src/components/terminal-pane/viewport/terminal-selection-fit-guard.test.ts deleted file mode 100644 index b74e0c9c2e8..00000000000 --- a/src/renderer/src/components/terminal-pane/viewport/terminal-selection-fit-guard.test.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import { installTerminalSelectionFitGuard } from './terminal-selection-fit-guard' - -function setup() { - const terminalElement = new EventTarget() - const ownerDocument = new EventTarget() - const ownerWindow = new EventTarget() - Object.assign(terminalElement, { ownerDocument }) - Object.assign(ownerDocument, { defaultView: ownerWindow }) - const terminal = { element: terminalElement } - const onSelectionEnd = vi.fn() - const guard = installTerminalSelectionFitGuard(terminal, onSelectionEnd) - return { terminalElement, ownerDocument, ownerWindow, guard, onSelectionEnd } -} - -function mouseEvent(button: number): Event { - const event = new Event('mousedown') - Object.defineProperty(event, 'button', { value: button }) - return event -} - -describe('terminal selection fit guard', () => { - it('stays active from primary mousedown through mouseup and requests convergence', () => { - const { terminalElement, ownerDocument, guard, onSelectionEnd } = setup() - - terminalElement.dispatchEvent(mouseEvent(0)) - expect(guard.isActive()).toBe(true) - ownerDocument.dispatchEvent(new Event('mouseup')) - expect(guard.isActive()).toBe(false) - expect(onSelectionEnd).toHaveBeenCalledOnce() - guard.dispose() - }) - - it('ignores non-primary buttons and clears an interrupted drag', () => { - const { terminalElement, ownerDocument, ownerWindow, guard, onSelectionEnd } = setup() - - terminalElement.dispatchEvent(mouseEvent(2)) - expect(guard.isActive()).toBe(false) - terminalElement.dispatchEvent(mouseEvent(0)) - ownerWindow.dispatchEvent(new Event('blur')) - ownerDocument.dispatchEvent(new Event('mouseup')) - expect(guard.isActive()).toBe(false) - expect(onSelectionEnd).not.toHaveBeenCalled() - guard.dispose() - }) -}) diff --git a/src/renderer/src/i18n/use-translate.test.tsx b/src/renderer/src/i18n/use-translate.test.tsx deleted file mode 100644 index b71102becf9..00000000000 --- a/src/renderer/src/i18n/use-translate.test.tsx +++ /dev/null @@ -1,39 +0,0 @@ -// @vitest-environment happy-dom -import { act, cleanup, render, screen } from '@testing-library/react' -import { memo } from 'react' -import { afterEach, expect, it } from 'vitest' -import { i18n } from './i18n' -import { TranslationScopeProvider } from './translation-scope-provider' -import { useTranslate, type Translate } from './use-translate' - -afterEach(async () => { - cleanup() - await i18n.changeLanguage('en') -}) - -it('gives memoized components a new translate function when the language switches', async () => { - i18n.addResourceBundle('de', 'translation', { 'test.useTranslate.greeting': 'Hallo' }, true, true) - const seen: Translate[] = [] - const Greeting = memo(function Greeting() { - const t = useTranslate() - seen.push(t) - return {t('test.useTranslate.greeting', 'Hello')} - }) - const view = render( - - - - ) - view.rerender( - - - - ) - expect(screen.getByText('Hello')).toBeTruthy() - const english = seen.at(-1) - - await act(() => i18n.changeLanguage('de')) - - expect(screen.getByText('Hallo')).toBeTruthy() - expect(seen.at(-1)).not.toBe(english) -}) diff --git a/src/renderer/src/lib/agent-session/launch/pane/agent-launch-pane-start.test.ts b/src/renderer/src/lib/agent-session/launch/pane/agent-launch-pane-start.test.ts deleted file mode 100644 index 237cf283c04..00000000000 --- a/src/renderer/src/lib/agent-session/launch/pane/agent-launch-pane-start.test.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { awaitAgentLaunchPaneStart, settleAgentLaunchPaneStart } from './agent-launch-pane-start' -import { noteAgentLaunchPaneClosedByUser } from './agent-launch-pane-closes' - -const TAB = '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d' -const LEAF = '3f2504e0-4f89-41d3-9a0c-0305e82c3301' - -describe("an AI button's pane says whether its agent started", () => { - it('once: the first answer stands, and only for that pane', async () => { - const started = awaitAgentLaunchPaneStart(TAB, LEAF) - settleAgentLaunchPaneStart(TAB, 'another-leaf', 'pty-other') - settleAgentLaunchPaneStart(TAB, LEAF, 'pty-1') - settleAgentLaunchPaneStart(TAB, LEAF, null) - await expect(started).resolves.toBe('pty-1') - }) - - it('no, when the user closes it before its spawn returns', async () => { - const started = awaitAgentLaunchPaneStart(TAB, LEAF) - noteAgentLaunchPaneClosedByUser(TAB, LEAF) - await expect(started).resolves.toBeNull() - }) -}) diff --git a/src/renderer/src/lib/browser/cookies/browser-cookie-import-error-copy.test.ts b/src/renderer/src/lib/browser/cookies/browser-cookie-import-error-copy.test.ts deleted file mode 100644 index 0cc7b877441..00000000000 --- a/src/renderer/src/lib/browser/cookies/browser-cookie-import-error-copy.test.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { afterEach, describe, expect, it } from 'vitest' -import { i18n } from '@/i18n/i18n' -import es from '@/i18n/locales/es.json' -import { browserCookieImportFailure } from '../../../../../shared/browser-cookie-import-failure-copy' -import { browserCookieImportFailureText } from './browser-cookie-import-error-copy' - -const originalLanguage = i18n.language - -afterEach(async () => { - await i18n.changeLanguage(originalLanguage) -}) - -describe('browserCookieImportFailureText', () => { - it('keeps diagnostic detail verbatim', async () => { - i18n.addResourceBundle('es', 'translation', es) - await i18n.changeLanguage('es') - const failed = browserCookieImportFailure( - 'importFailedWithLog', - { browser: 'Chrome', logPath: '/tmp/diag.log' }, - 'database is locked {{browser}}' - ) - expect(failed.reason).toBe( - 'Could not import cookies from Chrome: database is locked {{browser}}. Details were written to /tmp/diag.log.' - ) - expect(browserCookieImportFailureText(failed)).toContain('database is locked {{browser}}') - }) -}) diff --git a/src/renderer/src/lib/file-type-icons.test.ts b/src/renderer/src/lib/file-type-icons.test.ts deleted file mode 100644 index c406bd1a313..00000000000 --- a/src/renderer/src/lib/file-type-icons.test.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { parsePluginIconThemeArtifact } from '../../../shared/plugins/artifacts/plugin-icon-theme-artifact' -import type { ActivePluginIconTheme } from '../store/plugins/appearance/plugin-icon-themes' -import { getPluginFileTypeIconIndex } from './file-type-icons' - -const iconTheme = (maps: Partial): ActivePluginIconTheme => ({ - icons: {}, - fileNames: {}, - fileExtensions: {}, - folderNames: {}, - folderNamesExpanded: {}, - ...maps -}) - -describe('parsed artifact lookup', () => { - it('finds files named __proto__ and constructor from the parsed theme', () => { - const artifact = parsePluginIconThemeArtifact( - '{"schemaVersion":1,"fileNames":{"__proto__":"a.svg","Constructor":"b.svg"}}' - ) - const indexes = Object.fromEntries( - Object.keys(artifact.fileNames).map((key, index) => [key, index]) - ) - const theme = iconTheme({ fileNames: indexes }) - expect(getPluginFileTypeIconIndex(theme, '/a/__proto__')).toBe(0) - expect(getPluginFileTypeIconIndex(theme, '/a/CONSTRUCTOR')).toBe(1) - expect(getPluginFileTypeIconIndex(theme, '/a/other')).toBeNull() - }) -}) diff --git a/src/renderer/src/lib/left-sidebar-appearance.test.ts b/src/renderer/src/lib/left-sidebar-appearance.test.ts deleted file mode 100644 index d9e420f4bb1..00000000000 --- a/src/renderer/src/lib/left-sidebar-appearance.test.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { tintedSidebarHostPillOutlineMix } from './left-sidebar-appearance' -import type { ColorProbe } from './plugin-theme-tokens' - -const probe: ColorProbe = (value) => { - const hex = /^#([0-9a-f]{6})$/i.exec(value.trim())?.[1] - if (!hex) { - return null - } - const channel = (offset: number): number => Number.parseInt(hex.slice(offset, offset + 2), 16) - return [channel(0), channel(2), channel(4), 1] -} - -const tinted = { - leftSidebarAppearanceMode: 'tinted' as const, - leftSidebarTintColor: '#18181b', - leftSidebarTintOpacity: 0.08 -} - -describe('host pill outline in the tinted left sidebar', () => { - it('raises the outline to 2:1 on the selected wash when the app text is only 4.5:1', () => { - // #919191 on #2a2a2a under the default 8% tint: 40% is 1.6:1 on the wash, 53% is 2:1. - const app = { foreground: '#919191', background: '#2a2a2a', base: 'dark' as const } - expect(tintedSidebarHostPillOutlineMix(tinted, app, probe)).toBe(53) - }) - - it("keeps Orca's 40% outline over Orca's dark colors", () => { - const app = { foreground: '#f0f0f0', background: '#0a0a0a', base: 'dark' as const } - expect(tintedSidebarHostPillOutlineMix(tinted, app, probe)).toBe(40) - }) -}) diff --git a/src/renderer/src/lib/local-preflight-context-snapshot.test.ts b/src/renderer/src/lib/local-preflight-context-snapshot.test.ts deleted file mode 100644 index 71eff408a1c..00000000000 --- a/src/renderer/src/lib/local-preflight-context-snapshot.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { expect, it } from 'vitest' -import { createTestStore } from '../store/testing/app-store-test-fixture' -import { TEST_REPO } from '../store/repos/repo.test-fixture' -import { makeWorktree } from '../store/slices/worktrees/worktree.test-fixture' -import { getLocalPreflightContext } from './local-preflight-context' - -it('rebuilds against a replacement snapshot', () => { - const worktree = makeWorktree({ - id: 'repo1::/worktree', - repoId: TEST_REPO.id, - path: String.raw`\\wsl.localhost\Ubuntu\home\alice\worktree` - }) - const state = { - ...createTestStore().getState(), - activeRepoId: TEST_REPO.id, - activeWorktreeId: worktree.id, - repos: [TEST_REPO], - worktreesByRepo: { [TEST_REPO.id]: [worktree] } - } - - expect(getLocalPreflightContext(state, 'darwin')).toEqual({ wslDistro: 'Ubuntu' }) - expect( - getLocalPreflightContext( - { - ...state, - worktreesByRepo: { - [TEST_REPO.id]: [ - { ...worktree, path: String.raw`\\wsl.localhost\Debian\home\alice\moved` } - ] - } - }, - 'darwin' - ) - ).toEqual({ wslDistro: 'Debian' }) -}) diff --git a/src/renderer/src/lib/setup-script-prompt.test.ts b/src/renderer/src/lib/setup-script-prompt.test.ts deleted file mode 100644 index 373df6435ad..00000000000 --- a/src/renderer/src/lib/setup-script-prompt.test.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { - buildImportedHookSettings, - getDetectedSetupPreviewContent, - getSetupScriptFirstLine -} from './setup-script-prompt' -import { SETUP_SCRIPT_IMPORT_PROVIDERS } from '../../../shared/workspace-setup/setup-script-import-providers' -import type { Repo } from '../../../shared/repo-types' - -const repo: Repo = { - id: 'repo', - path: '/repo', - displayName: 'Repo', - badgeColor: '#000', - addedAt: 1 -} - -describe('getDetectedSetupPreviewContent', () => { - it.each(SETUP_SCRIPT_IMPORT_PROVIDERS)( - 'previews exactly what saving a %s candidate writes', - (provider) => { - const candidate = { - provider, - label: provider, - files: ['config'], - setup: `${provider} setup`, - archive: `${provider} archive` - } - const preview = getDetectedSetupPreviewContent(candidate, 'edited setup') - const saved = buildImportedHookSettings( - repo, - preview.editable ? { ...candidate, setup: preview.setup } : candidate, - false - ) - - expect(preview.editable).toBe(provider === 'package-manager') - expect(preview.setup).toBe(saved.scripts.setup) - expect(preview.archive).toBe(saved.scripts.archive) - } - ) -}) - -describe('getSetupScriptFirstLine', () => { - it('summarizes a multi-line script by its first command', () => { - expect(getSetupScriptFirstLine('\n pnpm install \n\npnpm build\n')).toEqual({ - firstLine: 'pnpm install', - hasMore: true - }) - expect(getSetupScriptFirstLine('bun install\n')).toEqual({ - firstLine: 'bun install', - hasMore: false - }) - }) -}) diff --git a/src/renderer/src/lib/sidebar-worktree-activation.test.ts b/src/renderer/src/lib/sidebar-worktree-activation.test.ts deleted file mode 100644 index 072444be816..00000000000 --- a/src/renderer/src/lib/sidebar-worktree-activation.test.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' - -const mocks = vi.hoisted(() => ({ - activateAndRevealFolderWorkspace: vi.fn(), - activateAndRevealWorktree: vi.fn() -})) - -vi.mock('@/lib/workspace/activation/worktree-activation', () => ({ - activateAndRevealFolderWorkspace: mocks.activateAndRevealFolderWorkspace, - activateAndRevealWorktree: mocks.activateAndRevealWorktree -})) - -import { activateWorktreeFromSidebar } from './sidebar-worktree-activation' - -describe('sidebar worktree activation', () => { - beforeEach(() => { - mocks.activateAndRevealWorktree.mockClear() - mocks.activateAndRevealFolderWorkspace.mockClear() - }) - - afterEach(() => { - vi.unstubAllGlobals() - }) - - it('switches immediately while an ephemeral runtime wake is pending', async () => { - let resolveResume: ((value: null) => void) | undefined - const resumeWorkspace = vi.fn( - () => - new Promise((resolve) => { - resolveResume = resolve - }) - ) - vi.stubGlobal('window', { - api: { ephemeralVm: { resumeWorkspace } } - }) - - const activation = activateWorktreeFromSidebar('wt-vm') - - expect(mocks.activateAndRevealWorktree).toHaveBeenCalledWith('wt-vm', { - navigationIntent: 'user-open', - revealInSidebar: false - }) - expect(resumeWorkspace).toHaveBeenCalledWith({ workspaceId: 'wt-vm' }) - - resolveResume?.(null) - await activation - }) -}) diff --git a/src/renderer/src/lib/ssh-workspace-browser-route-eligibility.test.ts b/src/renderer/src/lib/ssh-workspace-browser-route-eligibility.test.ts deleted file mode 100644 index b78be8873e6..00000000000 --- a/src/renderer/src/lib/ssh-workspace-browser-route-eligibility.test.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { toRuntimeExecutionHostId } from '../../../shared/execution-host' -import { resolveSshWorkspaceBrowserRouteEligibility } from './browser/workspace/ssh-workspace-browser-route-eligibility' - -const recipeEnvironment = { - id: 'env-recipe', - orcadDeployment: { sshTargetId: 'runtime-ssh-vm-1', sshTargetGeneration: 7 } -} - -describe('SSH workspace browser route eligibility', () => { - it('routes an environment recipe workspace through its runtime-owned SSH host', () => { - expect( - resolveSshWorkspaceBrowserRouteEligibility(toRuntimeExecutionHostId('env-recipe'), {}, [ - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: eligibility reads only the deployment link. - recipeEnvironment as never - ]) - ).toEqual({ targetId: 'runtime-ssh-vm-1', expectedSshTargetGeneration: 7, eligible: true }) - }) - - it('never treats a recipe VM target as a direct SSH workspace host', () => { - expect(resolveSshWorkspaceBrowserRouteEligibility('ssh:runtime-ssh-vm-1', {})).toBeNull() - }) -}) diff --git a/src/renderer/src/runtime/hosted-terminals/mounted-surfaces/focus-runtime-terminal-surface-readiness.test.ts b/src/renderer/src/runtime/hosted-terminals/mounted-surfaces/focus-runtime-terminal-surface-readiness.test.ts deleted file mode 100644 index 4bbfd3cd856..00000000000 --- a/src/renderer/src/runtime/hosted-terminals/mounted-surfaces/focus-runtime-terminal-surface-readiness.test.ts +++ /dev/null @@ -1,50 +0,0 @@ -// @vitest-environment happy-dom -import { afterEach, describe, expect, it, vi } from 'vitest' -import type { PaneManager } from '@/lib/pane-manager/pane-manager' -import { - focusRuntimeTerminalSurface, - registerRuntimeTerminalTab -} from './mounted-terminal-tab-registry' - -let unregister: (() => void) | undefined - -afterEach(() => { - unregister?.() - document.body.replaceChildren() -}) - -describe('terminal focus readiness', () => { - function register(hasPane: boolean, hasTextarea = true) { - const textarea = document.createElement('textarea') - const pane = { - id: 1, - container: document.createElement('div'), - terminal: { - textarea: hasTextarea ? textarea : undefined, - focus: vi.fn(() => textarea.focus()) - } - } - const manager = { - getActivePane: () => (hasPane ? pane : undefined), - getPanes: () => (hasPane ? [pane] : []) - } - unregister = registerRuntimeTerminalTab({ - tabId: 'restoring-tab', - worktreeId: 'restoring-workspace', - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: Focus reads only getActivePane/getPanes and the pane's container/terminal. - getManager: () => manager as unknown as PaneManager, - getContainer: () => null, - getPtyIdForPane: () => null, - getTabWideAgentHintLeafId: () => null - }) - return textarea - } - - it('does not consume focus until the terminal can receive it', () => { - const textarea = register(true) - expect(focusRuntimeTerminalSurface('restoring-tab', null, 'restoring-workspace')).toBe(false) - document.body.append(textarea) - expect(focusRuntimeTerminalSurface('restoring-tab', null, 'restoring-workspace')).toBe(true) - expect(document.activeElement).toBe(textarea) - }) -}) diff --git a/src/renderer/src/runtime/runtime-legacy-recent-freshness.test.ts b/src/renderer/src/runtime/runtime-legacy-recent-freshness.test.ts deleted file mode 100644 index c5a64a2ebd6..00000000000 --- a/src/renderer/src/runtime/runtime-legacy-recent-freshness.test.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { expect, it } from 'vitest' -import { listRuntimeFiles } from './files/search/runtime-file-search-client' -import { - installRuntimeFileClientEnvironment, - runtimeEnvironmentCall -} from './files/runtime-file-client-test-harness' -installRuntimeFileClientEnvironment() -for (const version of [1, 2]) { - it(`refreshes candidate eligibility after deletion on version ${version}`, async () => { - let files = [{ relativePath: 'src/recent.ts', basename: 'recent.ts', kind: 'text' }] - runtimeEnvironmentCall.mockImplementation(({ method }) => - Promise.resolve({ - id: 'fresh', - ok: true, - _meta: { runtimeId: 'host' }, - result: - method === 'files.searchPaths' - ? { files: [], truncated: false, quickOpenSearchVersion: version } - : { - worktree: 'freshness', - rootPath: '/host/repo', - files: [...files], - totalCount: files.length, - truncated: false - } - }) - ) - const context = { - target: { kind: 'environment' as const, environmentId: 'env-1' }, - worktreeId: `freshness-${version}`, - worktreePath: '/host/repo' - } - const options = { rootPath: '/host/repo', candidatePaths: ['src/recent.ts'], maxResults: 1 } - expect(await listRuntimeFiles(context, options)).toEqual(['src/recent.ts']) - files = [] - expect(await listRuntimeFiles(context, options)).toEqual([]) - expect( - runtimeEnvironmentCall.mock.calls.filter(([args]) => args.method === 'files.list') - ).toHaveLength(2) - }) -} diff --git a/src/renderer/src/store/slices/worktrees/create/worktree-create-cross-store-parent.test.ts b/src/renderer/src/store/slices/worktrees/create/worktree-create-cross-store-parent.test.ts deleted file mode 100644 index 1e0f8f62c72..00000000000 --- a/src/renderer/src/store/slices/worktrees/create/worktree-create-cross-store-parent.test.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { RuntimeRpcCallError } from '../../../../runtime/rpc/calls/runtime-rpc-result' -import type { CrossStoreParentRef } from '../../../../../../shared/worktree/lineage-types' -import { withoutRefusedInferredParent } from './worktree-create-cross-store-parent' - -const refusal = (code: string) => - new RuntimeRpcCallError({ - id: '1', - ok: false, - error: { code, message: code }, - _meta: { runtimeId: 'r' } - }) -const parent: CrossStoreParentRef = { - installationId: 'desktop', - workspaceKey: 'folder:f-1', - instanceId: 'f-1' -} - -describe('withoutRefusedInferredParent', () => { - it('drops an inferred parent the server refused, so the create retries unnested', () => { - expect( - withoutRefusedInferredParent( - { - name: 'w', - crossStoreParent: parent, - crossStoreParentInferredFrom: 'orchestration-context' - }, - refusal('LINEAGE_PARENT_CONTEXT_CONFLICT') - ) - ).toEqual({ name: 'w' }) - }) - - it('never retries a picked parent or a create that failed otherwise', () => { - expect( - withoutRefusedInferredParent( - { name: 'w', crossStoreParent: parent }, - refusal('LINEAGE_PARENT_CONTEXT_CONFLICT') - ) - ).toBeNull() - expect( - withoutRefusedInferredParent( - { - name: 'w', - crossStoreParent: parent, - crossStoreParentInferredFrom: 'orchestration-context' - }, - refusal('runtime_timeout') - ) - ).toBeNull() - }) -}) diff --git a/src/renderer/src/store/slices/worktrees/metadata/cross-store-lineage-state.test.ts b/src/renderer/src/store/slices/worktrees/metadata/cross-store-lineage-state.test.ts deleted file mode 100644 index 443cc1e9c42..00000000000 --- a/src/renderer/src/store/slices/worktrees/metadata/cross-store-lineage-state.test.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { withStoreCrossStoreLineage } from './cross-store-lineage-state' - -const RECORD = { childWorkspaceKey: 'worktree:repo::/srv/child', childInstanceId: 'child' } -const OTHER = { childWorkspaceKey: 'worktree:repo::/srv/other', childInstanceId: 'other' } - -describe('withStoreCrossStoreLineage', () => { - it('keeps a Remove Parent made after the list request started', () => { - const atStart = { - 'env-1': { 'worktree:repo::/srv/child': RECORD, 'worktree:repo::/srv/other': OTHER } - } - const afterRemove = { 'env-1': { 'worktree:repo::/srv/other': OTHER } } - const patch = withStoreCrossStoreLineage( - { crossStoreLineageByStoreKey: afterRemove, ownLineageInstallationId: 'mac' }, - 'env-1', - { - worktreeLineageById: {}, - workspaceLineageByChildKey: {}, - crossStoreLineageByChildKey: atStart['env-1'] - }, - { crossStoreLineageByStoreKey: atStart } - ) - expect(patch).toEqual({}) - }) -}) diff --git a/src/renderer/src/store/slices/worktrees/metadata/cross-store-parent-ref.test.ts b/src/renderer/src/store/slices/worktrees/metadata/cross-store-parent-ref.test.ts deleted file mode 100644 index 7dadb354802..00000000000 --- a/src/renderer/src/store/slices/worktrees/metadata/cross-store-parent-ref.test.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { AppState } from '../../../types' -import type { Worktree } from '../../../../../../shared/worktree/types' -import { WORKTREE_CROSS_STORE_LINEAGE_RUNTIME_CAPABILITY } from '../../../../../../shared/worktree-runtime-capabilities' - -const callRuntimeRpc = vi.hoisted(() => vi.fn()) -vi.mock('../../../../runtime/rpc/calls/runtime-rpc-call', () => ({ - callRuntimeRpc -})) - -import { buildCrossStoreParentRef } from './cross-store-parent-ref' - -// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the ref reads only id, hostId and instanceId. -const PARENT = { - id: 'srv::/work/parent', - hostId: 'runtime:env-1', - instanceId: 'parent-instance' -} as unknown as Worktree - -function stateWithServerInstall(installationId: string): AppState { - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the ref reads only these slices. - return { - runtimeEnvironments: [], - crossStoreLineageByStoreKey: {}, - ownLineageInstallationId: 'mac-install', - removedRuntimeEnvironmentIds: new Set(), - runtimeStatusByEnvironmentId: new Map([ - ['env-1', { status: { hostDescriptor: { installationId } }, checkedAt: 1 }] - ]) - } as unknown as AppState -} - -describe('buildCrossStoreParentRef', () => { - beforeEach(() => { - callRuntimeRpc.mockReset() - callRuntimeRpc.mockResolvedValue({ - capabilities: [WORKTREE_CROSS_STORE_LINEAGE_RUNTIME_CAPABILITY] - }) - }) - - it("names the parent by its server's verified install", async () => { - await expect( - buildCrossStoreParentRef(stateWithServerInstall('srv-install'), { kind: 'local' }, PARENT) - ).resolves.toEqual({ - installationId: 'srv-install', - workspaceKey: 'worktree:srv::/work/parent', - instanceId: 'parent-instance' - }) - }) -}) diff --git a/src/renderer/src/store/slices/worktrees/session/worktree-no-op-notifications.test.ts b/src/renderer/src/store/slices/worktrees/session/worktree-no-op-notifications.test.ts deleted file mode 100644 index c50582a4626..00000000000 --- a/src/renderer/src/store/slices/worktrees/session/worktree-no-op-notifications.test.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import { createTestStore } from '../worktrees-slice-test-harness' -import { makeWorktree } from '../worktree.test-fixture' - -vi.mock('sonner', () => ({ - toast: { warning: vi.fn(), info: vi.fn(), success: vi.fn(), error: vi.fn(), dismiss: vi.fn() } -})) -vi.mock('@/components/worktree-base-fallback-notice', () => ({ - requestWorktreeBaseFallbackNotice: vi.fn() -})) - -describe('worktree no-op notifications', () => { - it.each(['local', 'ssh:test'] as const)( - 'keeps repeated %s deletion and visit updates silent', - (hostId) => { - const store = createTestStore() - const worktree = makeWorktree({ id: 'repo1::/path/wt', repoId: 'repo1', hostId }) - store.setState({ worktreesByRepo: { repo1: [worktree] } }) - const target = { id: worktree.id, hostId } - store.getState().markWorktreesQueuedForDeletion([target]) - store.getState().markWorktreeVisited(worktree.id, 100, hostId) - const before = store.getState() - const listener = vi.fn() - store.subscribe(listener) - - before.markWorktreesQueuedForDeletion([target]) - before.markWorktreeVisited(worktree.id, 100, hostId) - before.markWorktreeVisited(worktree.id, 99, hostId) - expect(store.getState()).toBe(before) - expect(listener).not.toHaveBeenCalled() - - before.markWorktreesDeleting([target]) - expect(listener).toHaveBeenCalledTimes(1) - const deleting = store.getState() - deleting.markWorktreesDeleting([target]) - expect(store.getState()).toBe(deleting) - expect(listener).toHaveBeenCalledTimes(1) - deleting.clearWorktreeDeleteState(worktree.id, hostId) - expect(listener).toHaveBeenCalledTimes(2) - } - ) -}) diff --git a/src/shared/agent-launch/picker/agent-launch-picker-search.test.ts b/src/shared/agent-launch/picker/agent-launch-picker-search.test.ts deleted file mode 100644 index eb7988c3f3d..00000000000 --- a/src/shared/agent-launch/picker/agent-launch-picker-search.test.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { expect, it } from 'vitest' -import { searchAgentPickerSetups } from './agent-launch-picker-search' -import type { AgentPickerEntry } from './agent-launch-picker' - -it('searches the fallback models the submenu offers while the host catalog is unknown', () => { - const codex: AgentPickerEntry = { - agent: 'codex', - label: 'Codex', - rows: [{ agent: 'codex', kind: 'cli' }], - surfaces: ['terminal'], - defaultSurface: 'terminal', - terminal: {}, - structured: {}, - catalog: { origin: 'unknown' } - } - - const setups = searchAgentPickerSetups([codex], 'gpt') - - expect(setups.length).toBeGreaterThan(0) - expect(setups.every((setup) => setup.model.id.startsWith('gpt'))).toBe(true) -}) diff --git a/src/shared/telemetry-payload-contracts.test.ts b/src/shared/telemetry-payload-contracts.test.ts index 552fd6ed0d8..7c1229b7691 100644 --- a/src/shared/telemetry-payload-contracts.test.ts +++ b/src/shared/telemetry-payload-contracts.test.ts @@ -1,6 +1,5 @@ import './telemetry-orca-cli-feature-tip.spec' import './telemetry-events-feature-education.spec' import './telemetry-feature-wall-events.spec' -import './workspace-setup/setup-script-telemetry-events.spec' import './profile-state-telemetry-schema.spec' import './onboarding-tour-telemetry-events.spec' diff --git a/src/shared/workspace-setup/setup-script-telemetry-events.spec.ts b/src/shared/workspace-setup/setup-script-telemetry-events.spec.ts deleted file mode 100644 index 5ee19706e76..00000000000 --- a/src/shared/workspace-setup/setup-script-telemetry-events.spec.ts +++ /dev/null @@ -1,117 +0,0 @@ -import { describe, expect, it } from 'vitest' -import '../telemetry-events' -import { eventSchemas } from '../telemetry-event-registry' - -describe('setup script prompt schemas', () => { - it('accepts a bucketed candidate prompt exposure', () => { - const parsed = eventSchemas.setup_script_prompt_shown.safeParse({ - mode: 'import_available', - provider: 'codex', - file_count_bucket: '1', - unsupported_field_count_bucket: '2-3', - has_shared_hooks: false - }) - expect(parsed.success).toBe(true) - }) - - it('accepts configure prompt actions without a provider', () => { - const parsed = eventSchemas.setup_script_prompt_action.safeParse({ - action: 'configure_clicked', - mode: 'configure_needed', - file_count_bucket: '0', - unsupported_field_count_bucket: '0', - has_shared_hooks: true - }) - expect(parsed.success).toBe(true) - }) - - it.each([ - 'save_detected_setup_clicked', - 'save_detected_setup_completed', - 'save_detected_setup_failed' - ])('accepts %s detected setup save actions', (action) => { - const parsed = eventSchemas.setup_script_prompt_action.safeParse({ - action, - mode: 'import_available', - provider: 'package-manager', - file_count_bucket: '2-3', - unsupported_field_count_bucket: '0', - has_shared_hooks: false, - edited_before_save: true - }) - expect(parsed.success).toBe(true) - }) - - it('rejects detected setup save actions without edit state', () => { - const parsed = eventSchemas.setup_script_prompt_action.safeParse({ - action: 'save_detected_setup_completed', - mode: 'import_available', - provider: 'package-manager', - file_count_bucket: '2-3', - unsupported_field_count_bucket: '0', - has_shared_hooks: false - }) - expect(parsed.success).toBe(false) - }) - - it('rejects detected setup save actions for non-package-manager imports', () => { - const parsed = eventSchemas.setup_script_prompt_action.safeParse({ - action: 'save_detected_setup_completed', - mode: 'import_available', - provider: 'codex', - file_count_bucket: '1', - unsupported_field_count_bucket: '0', - has_shared_hooks: false, - edited_before_save: false - }) - expect(parsed.success).toBe(false) - }) - - it('rejects candidate prompt exposure without a provider', () => { - const parsed = eventSchemas.setup_script_prompt_shown.safeParse({ - mode: 'import_available', - file_count_bucket: '1', - unsupported_field_count_bucket: '0', - has_shared_hooks: false - }) - expect(parsed.success).toBe(false) - }) - - it('rejects configure prompt actions with a provider', () => { - const parsed = eventSchemas.setup_script_prompt_action.safeParse({ - action: 'configure_clicked', - mode: 'configure_needed', - provider: 'codex', - file_count_bucket: '0', - unsupported_field_count_bucket: '0', - has_shared_hooks: false - }) - expect(parsed.success).toBe(false) - }) - - it('rejects edit state on non-save actions', () => { - const parsed = eventSchemas.setup_script_prompt_action.safeParse({ - action: 'configure_clicked', - mode: 'configure_needed', - file_count_bucket: '0', - unsupported_field_count_bucket: '0', - has_shared_hooks: false, - edited_before_save: true - }) - expect(parsed.success).toBe(false) - }) - - it('rejects raw setup import details via .strict()', () => { - const parsed = eventSchemas.setup_script_prompt_action.safeParse({ - action: 'import_completed', - mode: 'import_available', - provider: 'codex', - file_count_bucket: '1', - unsupported_field_count_bucket: '0', - has_shared_hooks: false, - files: ['.codex/environments/environment.toml'], - setup: 'npm install' - }) - expect(parsed.success).toBe(false) - }) -})