From bbac4a28596a1cdbc4cc9dc2afd062b274b626a4 Mon Sep 17 00:00:00 2001 From: OrcaWin <293788423+OrcaWin@users.noreply.github.com> Date: Mon, 9 Nov 2026 01:09:39 -0800 Subject: [PATCH] test: remove low-value renderer and budget suites --- config/reliability-gates.jsonc | 16 +-- ...workspace-pane-normalization-index.test.ts | 82 -------------- .../orca-runtime-files-preview-budget.test.ts | 14 --- .../crew/crew-read-model-performance.test.ts | 27 ----- ...agent-session-receipt-frame-budget.test.ts | 103 ------------------ .../dashboard-agent-status-patch.test.ts | 59 ---------- .../dictation/dictation-toasts.test.ts | 17 --- .../editor-clean-tab-draft-invariant.test.ts | 61 ----------- .../editor/image-png-export.test.ts | 58 ---------- .../use-gitlab-primary-actions.test.ts | 57 ---------- ...tive-chat-live-message-preparation.test.ts | 61 ----------- .../work-item-source-selection.test.ts | 58 ---------- .../resource-session-inventory.test.ts | 61 ----------- .../src/lib/agent-draft-readiness.test.ts | 58 ---------- .../terminal-complex-script.test.ts | 58 ---------- .../source-control-remote-error.test.ts | 43 +------- .../sync-runtime-graph-chat-tab-order.test.ts | 61 ----------- ...mote-runtime-session-tabs-inflight.test.ts | 60 ---------- .../wsl-stopped-distro-poll-refusal.test.ts | 59 ---------- .../agent-status-ack-cleanup.test.ts | 58 ---------- .../editor-buffer-reconcile-joins.test.ts | 59 ---------- 21 files changed, 9 insertions(+), 1121 deletions(-) delete mode 100644 src/main/persistence/restoring-sessions/workspace-pane-normalization-index.test.ts delete mode 100644 src/main/runtime/orchestration/crew/crew-read-model-performance.test.ts delete mode 100644 src/main/runtime/rpc/methods/structured-sessions/subscriptions/structured-agent-session-receipt-frame-budget.test.ts delete mode 100644 src/renderer/src/components/dashboard-popout/dashboard-agent-status-patch.test.ts delete mode 100644 src/renderer/src/components/dictation/dictation-toasts.test.ts delete mode 100644 src/renderer/src/components/editor/external-changes/editor-clean-tab-draft-invariant.test.ts delete mode 100644 src/renderer/src/components/editor/image-png-export.test.ts delete mode 100644 src/renderer/src/components/gitlab-item-dialog/use-gitlab-primary-actions.test.ts delete mode 100644 src/renderer/src/components/native-chat/session/terminal/assembly/native-chat-live-message-preparation.test.ts delete mode 100644 src/renderer/src/components/new-workspace/work-item-source-selection.test.ts delete mode 100644 src/renderer/src/components/status-bar/resource-session-inventory.test.ts delete mode 100644 src/renderer/src/lib/agent-draft-readiness.test.ts delete mode 100644 src/renderer/src/lib/pane-manager/terminal-complex-script.test.ts delete mode 100644 src/renderer/src/runtime/sync-runtime-graph/sync-runtime-graph-chat-tab-order.test.ts delete mode 100644 src/renderer/src/runtime/web-session-tabs-sync/inventory/remote-runtime-session-tabs-inflight.test.ts delete mode 100644 src/renderer/src/store/github/repositories/wsl-stopped-distro-poll-refusal.test.ts delete mode 100644 src/renderer/src/store/slices/agent-status/agent-status-ack-cleanup.test.ts delete mode 100644 src/renderer/src/store/slices/editor/buffers/editor-buffer-reconcile-joins.test.ts diff --git a/config/reliability-gates.jsonc b/config/reliability-gates.jsonc index 909e02c33fb..406884c510d 100644 --- a/config/reliability-gates.jsonc +++ b/config/reliability-gates.jsonc @@ -7371,7 +7371,7 @@ "providers": ["local", "daemon", "ssh", "wsl", "remote-runtime"], "coveredPlatforms": ["macos"], "coveredProviders": ["local", "daemon", "ssh", "wsl", "remote-runtime"], - "coverageNotes": "Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): 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. Historical prior account (preserved verbatim): Audit1983: Delete the mocked agent-session suite and its prospective selector and aliases. Retire all3 whole dated changed-selector receipts, preserving their original raw objects in historical gaps without transferring counts or durations. Preserve5 unrelated receipts. 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): Partial agent-operation service suite retains only concurrent retry joining with changed-fingerprint conflict. Retire its complete three-title assertion object: old-owner legacy fallback before side effects, nested SSH Pi transcript refusal and completed/ambiguous physical-commit replay fences are no longer backed. Other probe/launch option/ledger/failure/remote-inventory examples disappear as detailed below. No actual provider spawn, live SSH or physical commit proof is retained by this source. 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): Audit1911: The complete provider PTY-inspection mock suite is removed: missing-provider rejection, stale-PTY renderer unverifiable mapping, preserved supplied renderer failures, and supplied transport-loss mapping alarms are intentionally lost. No actual terminal teardown, daemon error or remote transport was exercised. Only the deleted explicit source tokens, testFile and whole assertionRef are removed. Meaningful remaining source selectors/assertions and unaffected dated receipts retain their original scope. No equivalent replacement, fresh reduced-gate, native/platform/provider, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1623 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1495 intentionally deletes the orphan-owner suite: explicit owner/host predicate examples are retired; no equivalent replacement coverage or fresh result is claimed. Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Audit1417 intentionally deletes src/renderer/src/components/terminal-pane/agent-completion-coordinator-pending-title-inspection.test.ts: Loses obsolete pending title process races, inspection failure suppression, explicit completion precedence and delayed remote inspection alarms. No equivalent replacement coverage or fresh result is claimed. Historical coverage account: 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): Audits1301 and1308 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 macOS tests cover controller claims, daemon and SSH/relay operation replay, mixed-version selection, runtime ownership, exact provisional handoff, durable terminal retirement, two independent viewer mirrors, guarded adoption of legacy live PTYs, and completion classification when either the outer remote transport or authoritative host/provider process inspection becomes unreachable. The adoption harness models v1.4.150 agent/setup/shell tabs, current-generation restart and reconnect, exact handle/incarnation/worktree/host checks, topology CAS, competing clients, split-pane/group restoration, WSL ownership, and SSH owner rejection. The secondary parity repro runs independent clients against one headless remote Orca runtime over encrypted pairing and a real daemon-backed PTY, with tokened fixture-process identity separated from unrelated Codex app-server startup probes. The automated primary topology runs an isolated headed macOS Orca desktop server plus a separate paired web client and proves viewer-local fresh/resume focus, exact legacy placement, writable PTYs, unrelated-terminal survival, and host/client cleanup. SSH coverage is provider/relay contract and fault-injection coverage only; it does not substitute for paired-server coverage. Live Windows, Linux, WSL, SSH, and physical paired-Linux hosts remain gaps. The isolated intent-owner ledger suite was removed. web-runtime-session.test.ts retains exact post-create handoff confirmation only; its previous fresh/resume presentation and publication-replay assertions are no longer current references. Those direct owner-partition, cap and RPC/focus alarms are lost; other agent-session evidence does not establish equivalence. Structured handoff and adopted-leaf focus references now point to their dedicated surviving fixtures. Mixed-version recovery retains actual old-host recovery followed by a new CLI tab; its unsupported/missing-evidence tables are removed. Orphan recovery retains in-flight adoption-conflict serialization only; previous topology/pruning and absence/adoption examples are removed. These removed projection, capability and adoption-shape alarms are lost; retained cases do not replace them. 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. Audit1308: src/renderer/src/runtime/web-session-tabs-sync-agent-handoff.test.ts removed. Exact provisional replacement and post-create exit confirmation handoff pipeline alarms disappear. No equivalent replacement coverage is claimed. Audit1313: src/main/runtime/terminal-orphan-topology.test.ts: Retain actual topology merge algorithms preserving disjoint subtrees and grafted/ambiguous shared anchors with independent expected trees. Remove duplicate leaf validator and empty/no-change passthrough examples. Lose basic validation and no-group/noop characterization; no renderer layout proof. Reduced selectors require fresh validation; prior full-suite receipts do not validate removed or changed coverage. No equivalent replacement or physical-provider claim. Audit1342: src/renderer/src/components/terminal-pane/pty-connection-completion-and-notification.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. 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. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. 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. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", + "coverageNotes": "Audit2709 removes src/renderer/src/runtime/web-session-tabs-sync/inventory/remote-runtime-session-tabs-inflight.test.ts: intentionally retire waiting out an older inventory and sharing a fresh post-operation request among concurrent callers. No equivalent replacement or fresh execution is claimed. Dated receipts remain historical evidence for their unchanged selectors only; they do not validate the reduced commands or full current gate. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): 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. Historical prior account (preserved verbatim): Audit1983: Delete the mocked agent-session suite and its prospective selector and aliases. Retire all3 whole dated changed-selector receipts, preserving their original raw objects in historical gaps without transferring counts or durations. Preserve5 unrelated receipts. 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): Partial agent-operation service suite retains only concurrent retry joining with changed-fingerprint conflict. Retire its complete three-title assertion object: old-owner legacy fallback before side effects, nested SSH Pi transcript refusal and completed/ambiguous physical-commit replay fences are no longer backed. Other probe/launch option/ledger/failure/remote-inventory examples disappear as detailed below. No actual provider spawn, live SSH or physical commit proof is retained by this source. 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): Audit1911: The complete provider PTY-inspection mock suite is removed: missing-provider rejection, stale-PTY renderer unverifiable mapping, preserved supplied renderer failures, and supplied transport-loss mapping alarms are intentionally lost. No actual terminal teardown, daemon error or remote transport was exercised. Only the deleted explicit source tokens, testFile and whole assertionRef are removed. Meaningful remaining source selectors/assertions and unaffected dated receipts retain their original scope. No equivalent replacement, fresh reduced-gate, native/platform/provider, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1623 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1495 intentionally deletes the orphan-owner suite: explicit owner/host predicate examples are retired; no equivalent replacement coverage or fresh result is claimed. Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Audit1417 intentionally deletes src/renderer/src/components/terminal-pane/agent-completion-coordinator-pending-title-inspection.test.ts: Loses obsolete pending title process races, inspection failure suppression, explicit completion precedence and delayed remote inspection alarms. No equivalent replacement coverage or fresh result is claimed. Historical coverage account: 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): Audits1301 and1308 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 macOS tests cover controller claims, daemon and SSH/relay operation replay, mixed-version selection, runtime ownership, exact provisional handoff, durable terminal retirement, two independent viewer mirrors, guarded adoption of legacy live PTYs, and completion classification when either the outer remote transport or authoritative host/provider process inspection becomes unreachable. The adoption harness models v1.4.150 agent/setup/shell tabs, current-generation restart and reconnect, exact handle/incarnation/worktree/host checks, topology CAS, competing clients, split-pane/group restoration, WSL ownership, and SSH owner rejection. The secondary parity repro runs independent clients against one headless remote Orca runtime over encrypted pairing and a real daemon-backed PTY, with tokened fixture-process identity separated from unrelated Codex app-server startup probes. The automated primary topology runs an isolated headed macOS Orca desktop server plus a separate paired web client and proves viewer-local fresh/resume focus, exact legacy placement, writable PTYs, unrelated-terminal survival, and host/client cleanup. SSH coverage is provider/relay contract and fault-injection coverage only; it does not substitute for paired-server coverage. Live Windows, Linux, WSL, SSH, and physical paired-Linux hosts remain gaps. The isolated intent-owner ledger suite was removed. web-runtime-session.test.ts retains exact post-create handoff confirmation only; its previous fresh/resume presentation and publication-replay assertions are no longer current references. Those direct owner-partition, cap and RPC/focus alarms are lost; other agent-session evidence does not establish equivalence. Structured handoff and adopted-leaf focus references now point to their dedicated surviving fixtures. Mixed-version recovery retains actual old-host recovery followed by a new CLI tab; its unsupported/missing-evidence tables are removed. Orphan recovery retains in-flight adoption-conflict serialization only; previous topology/pruning and absence/adoption examples are removed. These removed projection, capability and adoption-shape alarms are lost; retained cases do not replace them. 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. Audit1308: src/renderer/src/runtime/web-session-tabs-sync-agent-handoff.test.ts removed. Exact provisional replacement and post-create exit confirmation handoff pipeline alarms disappear. No equivalent replacement coverage is claimed. Audit1313: src/main/runtime/terminal-orphan-topology.test.ts: Retain actual topology merge algorithms preserving disjoint subtrees and grafted/ambiguous shared anchors with independent expected trees. Remove duplicate leaf validator and empty/no-change passthrough examples. Lose basic validation and no-group/noop characterization; no renderer layout proof. Reduced selectors require fresh validation; prior full-suite receipts do not validate removed or changed coverage. No equivalent replacement or physical-provider claim. Audit1342: src/renderer/src/components/terminal-pane/pty-connection-completion-and-notification.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. 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. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. 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. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", "motivatingLinks": [ "https://github.com/stablyai/orca/issues/8878", "https://github.com/stablyai/orca/issues/9151", @@ -7384,7 +7384,7 @@ "oracle": "Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): 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. Historical prior account (preserved verbatim): Audit1983: Delete the mocked agent-session suite and its prospective selector and aliases. Retire all3 whole dated changed-selector receipts, preserving their original raw objects in historical gaps without transferring counts or durations. Preserve5 unrelated receipts. 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): Partial agent-operation service suite retains only concurrent retry joining with changed-fingerprint conflict. Retire its complete three-title assertion object: old-owner legacy fallback before side effects, nested SSH Pi transcript refusal and completed/ambiguous physical-commit replay fences are no longer backed. Other probe/launch option/ledger/failure/remote-inventory examples disappear as detailed below. No actual provider spawn, live SSH or physical commit proof is retained by this source. 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): Audit1911: The complete provider PTY-inspection mock suite is removed: missing-provider rejection, stale-PTY renderer unverifiable mapping, preserved supplied renderer failures, and supplied transport-loss mapping alarms are intentionally lost. No actual terminal teardown, daemon error or remote transport was exercised. Only the deleted explicit source tokens, testFile and whole assertionRef are removed. Meaningful remaining source selectors/assertions and unaffected dated receipts retain their original scope. No equivalent replacement, fresh reduced-gate, native/platform/provider, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Historical pre-audit oracle account for changed sources: 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): Race independent clients and repeated operation IDs, then assert one physical spawn and one canonical PTY/surface; inject exit-before-reply, provider disconnect, conflicting claim scope, old daemon/relay capabilities, reused handles, stale incarnations, owner mismatch, and topology revision conflict; assert safe adoption or explicit failure without a second spawn or wrong-process attachment. Run fresh/resume with activate true/false against an isolated headed desktop host and a separate paired client, then against isolated headless serve: assert host presentation stays background, only the requesting viewer focuses the exact leaf, inactive calls preserve client/DOM focus, a same-version publication replay cannot lose focus intent, and sibling-first split publication cannot consume exact-leaf intent. Restore legacy split panes and groups beside a newer host-owned tab, preserving exact predecessor/new/successor order, output, input, resize, titles, tab/leaf identity, active group, and multi-client convergence. For completion, drive a known running agent through outer transport loss, authoritative provider rejection, reconnect, explicit stop, real exit status, and successful hook completion; assert unavailable evidence never dispatches completion and two fresh authoritative idle samples are required after the gap. After exact exit, assert terminal and tab listings omit the surface, a stale publication cannot restore it, restart cannot resurrect it, exact tokened fixture PIDs are dead, and unrelated tabs/processes survive until scoped cleanup.", "commands": [ "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/runtime/web-session-tabs-sync/inventory/web-runtime-session.test.ts src/renderer/src/runtime/web-session-tabs-sync/navigation/web-session-tabs-sync-focus-intent.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/shared/claimed-agent-pty-owner.test.ts src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts src/main/runtime/session-construction/agent-session/orca-runtime-agent-session-operation.test.ts src/main/runtime/session-construction/agent-session/remote-agent-session-host-authority.integration.test.ts src/main/runtime/terminal/surface/orca-runtime-terminal-retirement.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-host-session-launch.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-create-handoff.test.ts src/renderer/src/runtime/web-session-tabs-sync/inventory/remote-runtime-session-tabs-inflight.test.ts src/renderer/src/runtime/web-session-tabs-sync/inventory/web-runtime-session.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/shared/claimed-agent-pty-owner.test.ts src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts src/main/runtime/session-construction/agent-session/orca-runtime-agent-session-operation.test.ts src/main/runtime/session-construction/agent-session/remote-agent-session-host-authority.integration.test.ts src/main/runtime/terminal/surface/orca-runtime-terminal-retirement.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-host-session-launch.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-create-handoff.test.ts src/renderer/src/runtime/web-session-tabs-sync/inventory/web-runtime-session.test.ts", "pnpm exec vitest run --config config/vitest.config.ts tests/e2e/remote-terminal-tab-retirement.unit.test.ts", "pnpm run build:cli && pnpm run build:electron-vite && node config/scripts/diagnostics/remote-agent-authority/remote-agent-session-authority-repro.mjs", "node --check config/scripts/development/remote-session-cleanup/remote-agent-session-process-cleanup.mjs && node config/scripts/diagnostics/remote-agent-authority/remote-agent-session-authority-repro.mjs", @@ -7413,7 +7413,6 @@ "src/main/runtime/terminal/surface/orca-runtime-terminal-retirement.test.ts", "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-host-session-launch.test.ts", "src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-create-handoff.test.ts", - "src/renderer/src/runtime/web-session-tabs-sync/inventory/remote-runtime-session-tabs-inflight.test.ts", "src/renderer/src/runtime/web-session-tabs-sync/inventory/web-runtime-session.test.ts", "tests/e2e/remote-agent-session-focus-authority.spec.ts", "config/scripts/diagnostics/remote-agent-authority/remote-agent-session-authority-repro.mjs", @@ -7643,7 +7642,8 @@ "Audit2056 (sources2054/2055): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/mobile-session-tabs-part-14.spec'). src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts: arms the stale-title timer for a seeded working title; arms the Command Code scrape from the noted spawn command; prefers the tracked title over a stale renderer lastTitle in the hydration seed; writes recent output into the current runtime output map; uses a later title handler replacement with the runtime receiver; calls the current injected listener with the runtime receiver; keeps optional reconciliation lazy after its callback is removed. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-14.spec.ts: lists them, so a paired client can mirror a migrated editor; closes one by retiring it from the host session; keeps an unsaved draft unless the close is forced; shares aggregate work but leaves a replacement pending promise alone; lets a targeted refresh finish while an aggregate refresh waits; refuses a close when the store lacks %s before the guard; keeps a later missing %s on the original caught failure path. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed.", "Audit2061 (sources2059/2060): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/mobile-session-tabs-headless-chat-rebuild.spec'); await import('./orca-runtime-tests/mobile-session-tabs-cold-serve-hydrate.spec'); await import('./orca-runtime-tests/worktree-removal-execution-host.spec'); await import('./orca-runtime-tests/terminal-spawn-dispatch.spec'). src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-completion-and-notification.test.ts: ordinary registration cleanup removes only import { registerPtyConnectionSshHookStatusAuthorityTests } from '../host-ownership/pty-connection-ssh-hook-status-authority.spec'; registerPtyConnectionSshHookStatusAuthorityTests(). src/main/runtime/orca-runtime-tests/headless-snapshots-part-02.spec.ts: replaces a cwd parsed before late WSL context with the provider cwd; keeps a live WSL cwd that arrives during late-context snapshot recovery; infers local reconstructed WSL context from a WSL UNC worktree; clears stale terminal file URI hostnames after empty-host OSC7 cwd updates; serializes SSH headless OSC7 cwd as POSIX when the desktop runtime is on Windows; keeps Windows SSH OSC7 cwd as a drive path when the desktop runtime is POSIX; serializes Windows SSH headless OSC7 cwd as a drive path on POSIX desktops; infers restored SSH connection identity from app-scoped PTY ids. src/main/runtime/orca-runtime-tests/mobile-session-tabs-headless-chat-rebuild.spec.ts: survives the rebuild that closing a saved editor tab forces; keeps its place in the tab order when the host lists the workspace again; lists tabs to phones in the order desktop clients draw after a rebuild; keeps the place a window gave a chat across a graph resend before the chat is restored. src/main/runtime/orca-runtime-tests/mobile-session-tabs-cold-serve-hydrate.spec.ts: lists every persisted terminal of a windowless host after a cold restart; lists every persisted terminal in the all-worktrees inventory after a cold restart; lists persisted editor tabs beside the terminals after a cold restart; restores a persisted split group layout on the cold rebuild; restores the saved active group of a split even when it is not the first group; falls back to the active tab group when the saved active group was not restored; keeps the headless group active when there is no persisted split; keeps phone and CLI creates in the group they joined across a cold restart. src/main/runtime/orca-runtime-tests/worktree-removal-failed-retry.spec.ts: lists the leftover with its error, though Git no longer does; takes the normal delete once Git registers a checkout at the path again; joins a retry another client started while this Delete listed Git; shows the failed row with its error, not the scan cached before the delete. src/main/runtime/orca-runtime-tests/worktree-removal-execution-host.spec.ts: refuses an SSH row whose host is unreachable instead of deleting here; refuses a runtime row with no nested SSH target rather than deleting locally; refuses a runtime row that also names a nested SSH target; retains runtime purge dispatch in a recovery job; uses the runtime helper override before resuming an interrupted removal; uses the runtime helper override before retrying a failed removal; captures the watcher callback and retains its job-host receiver; reads the current runtime removal queue. src/main/runtime/orca-runtime-tests/terminal-spawn-dispatch.spec.ts: reports the spawn request before it leaves for the pty controller; reports it even when the spawn itself then fails; does not report it when the create fails before any spawn request; captures the admission method before reading the incarnation; captures the record method before evaluating its state object; skips database payload serialization when no database exists; skips a throwing database payload when no database exists; keeps the database method and receiver captured before its payload; captures the canonical map method before a binding getter changes it; completes the captured replacement fence without another map lookup. src/renderer/src/components/terminal-pane/pty-connection/host-ownership/pty-connection-ssh-hook-status-authority.spec.ts: leaves SSH IPC OSC 9999 status ownership in the main runtime. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed.", "Module layout policy correction: retire the remaining program-status-osc.spec.ts event-projection case (production/mock-derived pane-key oracle) and sign-in timeout case (real setTimeout wait with Date-only fake clocks). The runtime test registrar no longer imports that file. No replacement coverage or fresh execution is claimed for these losses; historical receipts retain their original source scope.", - "Module layout policy correction: retire the two remaining worktree-ps-agent-row-dismissal.spec.ts registrations. The remint/dismissal/exit case computed expected snapshotVersion increments from a production snapshot and used real-clock vi.waitFor; the legacy OSC case derived its expected paneKey from the production layout-owner switch. The runtime registrar no longer imports this file. These public projection scenarios have no replacement coverage or fresh execution claimed; all historical receipts and earlier loss notes retain their original source scope." + "Module layout policy correction: retire the two remaining worktree-ps-agent-row-dismissal.spec.ts registrations. The remint/dismissal/exit case computed expected snapshotVersion increments from a production snapshot and used real-clock vi.waitFor; the legacy OSC case derived its expected paneKey from the production layout-owner switch. The runtime registrar no longer imports this file. These public projection scenarios have no replacement coverage or fresh execution claimed; all historical receipts and earlier loss notes retain their original source scope.", + "Audit2709 removes src/renderer/src/runtime/web-session-tabs-sync/inventory/remote-runtime-session-tabs-inflight.test.ts: intentionally retire waiting out an older inventory and sharing a fresh post-operation request among concurrent callers. No equivalent replacement or fresh execution is claimed. Dated receipts remain historical evidence for their unchanged selectors only; they do not validate the reduced commands or full current gate. Original prospective command before removal: pnpm exec vitest run --config config/vitest.config.ts src/shared/claimed-agent-pty-owner.test.ts src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts src/main/runtime/session-construction/agent-session/orca-runtime-agent-session-operation.test.ts src/main/runtime/session-construction/agent-session/remote-agent-session-host-authority.integration.test.ts src/main/runtime/terminal/surface/orca-runtime-terminal-retirement.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-host-session-launch.test.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-create-handoff.test.ts src/renderer/src/runtime/web-session-tabs-sync/inventory/remote-runtime-session-tabs-inflight.test.ts src/renderer/src/runtime/web-session-tabs-sync/inventory/web-runtime-session.test.ts" ], "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." }, @@ -9622,7 +9622,7 @@ "providers": ["ssh", "remote-runtime", "wsl"], "coveredPlatforms": ["macos"], "coveredProviders": ["ssh", "remote-runtime"], - "coverageNotes": "Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/ssh/connection/ssh-connection-manager.test.ts: tears a failed startup down quietly, so its error is not replaced by a disconnect; marks a dial that never reached the host, so setup reports SSH’s reason; removes the registration when bulk teardown fails; leaves a connection whose own reconnect is asking the user alone; clears the pool entry when the closed connection is still the registered one; still reuses a connection that is already up; dials a user's connection test. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): 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.", + "coverageNotes": "Audit2709 removes src/renderer/src/runtime/web-session-tabs-sync/inventory/remote-runtime-session-tabs-inflight.test.ts: intentionally retire waiting out an older inventory and sharing a fresh post-operation request among concurrent callers. No equivalent replacement or fresh execution is claimed. Dated receipts remain historical evidence for their unchanged selectors only; they do not validate the reduced commands or full current gate. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/ssh/connection/ssh-connection-manager.test.ts: tears a failed startup down quietly, so its error is not replaced by a disconnect; marks a dial that never reached the host, so setup reports SSH’s reason; removes the registration when bulk teardown fails; leaves a connection whose own reconnect is asking the user alone; clears the pool entry when the closed connection is still the registered one; still reuses a connection that is already up; dials a user's connection test. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): 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", @@ -9640,7 +9640,7 @@ "oracle": "Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/ssh/connection/ssh-connection-manager.test.ts: tears a failed startup down quietly, so its error is not replaced by a disconnect; marks a dial that never reached the host, so setup reports SSH’s reason; removes the registration when bulk teardown fails; leaves a connection whose own reconnect is asking the user alone; clears the pool entry when the closed connection is still the registered one; still reuses a connection that is already up; dials a user's connection test. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): 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/web-session-tabs-sync/agent-status/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/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/web-session-tabs-sync/inventory/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/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", @@ -9668,7 +9668,6 @@ "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/renderer/src/runtime/web-session-tabs-sync/inventory/remote-runtime-session-tabs-inflight.test.ts", "src/renderer/src/store/terminals/terminal-pty-identity-replacement.test.ts", "src/shared/remote-runtime/remote-runtime-socket-liveness.test.ts", "src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts", @@ -9927,7 +9926,8 @@ "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\"", "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.", - "Audit2195 removes the low-value startup admission boolean and host deferral predicate inventories from background-terminal-worktree-mount.test.ts. The reduced source retains concrete targeted mount, prune and reveal ownership transitions, not those oracle assertions. Existing selectors remain unexecuted here; no equivalent replacement or new runtime/provider/platform/budget result is claimed. Original retired assertion object verbatim:\n{\n \"file\": \"src/renderer/src/components/terminal/background-terminal-worktree-mount.test.ts\",\n \"assertions\": [\n \"startup waits for hydration before mounting terminal panes while degraded mode remains interactive\",\n \"only an explicit local execution host can defer cold activation\",\n \"SSH, remote-runtime, and unresolved owners remain eager\"\n ]\n }" + "Audit2195 removes the low-value startup admission boolean and host deferral predicate inventories from background-terminal-worktree-mount.test.ts. The reduced source retains concrete targeted mount, prune and reveal ownership transitions, not those oracle assertions. Existing selectors remain unexecuted here; no equivalent replacement or new runtime/provider/platform/budget result is claimed. Original retired assertion object verbatim:\n{\n \"file\": \"src/renderer/src/components/terminal/background-terminal-worktree-mount.test.ts\",\n \"assertions\": [\n \"startup waits for hydration before mounting terminal panes while degraded mode remains interactive\",\n \"only an explicit local execution host can defer cold activation\",\n \"SSH, remote-runtime, and unresolved owners remain eager\"\n ]\n }", + "Audit2709 removes src/renderer/src/runtime/web-session-tabs-sync/inventory/remote-runtime-session-tabs-inflight.test.ts: intentionally retire waiting out an older inventory and sharing a fresh post-operation request among concurrent callers. No equivalent replacement or fresh execution is claimed. Dated receipts remain historical evidence for their unchanged selectors only; they do not validate the reduced commands or full current gate. Original prospective command before removal: 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/web-session-tabs-sync/inventory/remote-runtime-session-tabs-inflight.test.ts src/renderer/src/store/terminals/terminal-pty-identity-replacement.test.ts" ], "demotionRule": "Cannot promote if provider failure can close panes or if the oracle is screenshot-only." }, diff --git a/src/main/persistence/restoring-sessions/workspace-pane-normalization-index.test.ts b/src/main/persistence/restoring-sessions/workspace-pane-normalization-index.test.ts deleted file mode 100644 index 99092636ab5..00000000000 --- a/src/main/persistence/restoring-sessions/workspace-pane-normalization-index.test.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { - TerminalLayoutSnapshot, - TerminalTab -} from '../../../shared/workspace-layout/terminal-tab-types' -import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' -import { normalizeWorkspaceSessionPaneIdentities } from './workspace-pane-normalization' - -const { registerPaneKeyAliasMock } = vi.hoisted(() => ({ - registerPaneKeyAliasMock: vi.fn() -})) - -vi.mock('../../agent-hooks/server/agent-hook-server', () => ({ - agentHookServer: { - registerPaneKeyAlias: registerPaneKeyAliasMock - } -})) - -function terminalTab(id: string, worktreeId: string, ptyId: string | null): TerminalTab { - return { - id, - worktreeId, - ptyId, - title: 'Terminal', - customTitle: null, - color: null, - sortOrder: 0, - createdAt: 1 - } -} - -function workspaceSession( - tabsByWorktree: Record, - terminalLayoutsByTabId: Record -): WorkspaceSessionState { - return { - activeRepoId: null, - activeWorktreeId: null, - activeTabId: null, - tabsByWorktree, - terminalLayoutsByTabId - } -} - -function legacyLayout(): TerminalLayoutSnapshot { - return { - root: { type: 'leaf', leafId: 'pane:1' }, - activeLeafId: 'pane:1', - expandedLeafId: null - } -} - -describe('workspace pane normalization tab index', () => { - beforeEach(() => { - registerPaneKeyAliasMock.mockReset() - }) - - it('keeps the first tab when duplicate ids occur across worktrees', () => { - const result = normalizeWorkspaceSessionPaneIdentities( - workspaceSession( - { - first: [terminalTab('duplicate-tab', 'first', 'first-pty')], - second: [terminalTab('duplicate-tab', 'second', 'second-pty')] - }, - { 'duplicate-tab': legacyLayout() } - ) - ) - - expect(result.legacyPaneKeyAliasEntries).not.toHaveLength(0) - expect(result.legacyPaneKeyAliasEntries.every((entry) => entry.ptyId === 'first-pty')).toBe( - true - ) - }) - - it('keeps missing tab ids without inventing persisted aliases', () => { - const result = normalizeWorkspaceSessionPaneIdentities( - workspaceSession({}, { 'missing-tab': legacyLayout() }) - ) - - expect(result.legacyPaneKeyAliasEntries).toEqual([]) - }) -}) diff --git a/src/main/runtime/files/orca-runtime-files-preview-budget.test.ts b/src/main/runtime/files/orca-runtime-files-preview-budget.test.ts index ad8c4f9e7da..d32321234c0 100644 --- a/src/main/runtime/files/orca-runtime-files-preview-budget.test.ts +++ b/src/main/runtime/files/orca-runtime-files-preview-budget.test.ts @@ -59,20 +59,6 @@ describe('RuntimeFileReads', () => { ).rejects.toThrow('file_too_large') }) - it('keeps local previews above the remote cap available without a request budget', async () => { - const size = RUNTIME_PREVIEWABLE_BINARY_MAX_BYTES + 1 - const dir = await previewFixture(size) - const { commands } = createFileReads({ path: dir }) - resolveAuthorizedPathMock.mockImplementation(async (p: string) => p) - - await expect(commands.readFileExplorerPreview('id:wt-1', 'logo.png')).resolves.toEqual({ - content: Buffer.alloc(size, 0x61).toString('base64'), - isBinary: true, - isImage: true, - mimeType: 'image/png' - }) - }) - // Phones read images a chat names by host path; only image files on this machine qualify. it('reads a chat image outside every project root but never another file type', async () => { const dir = await previewFixture() diff --git a/src/main/runtime/orchestration/crew/crew-read-model-performance.test.ts b/src/main/runtime/orchestration/crew/crew-read-model-performance.test.ts deleted file mode 100644 index fe4789364d8..00000000000 --- a/src/main/runtime/orchestration/crew/crew-read-model-performance.test.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { afterEach, expect, it, vi } from 'vitest' - -import { CrewReadModel } from './crew-read-model' - -import { fixture } from './crew-read-model.test-fixture' - -afterEach(() => vi.useRealTimers()) - -it.each([ - ['x'.repeat(1024), 'x'.repeat(1024)], - ['x'.repeat(1025), `${'x'.repeat(1021)}…`], - [`${'x'.repeat(1020)}🙂tail`, `${'x'.repeat(1020)}…`], - [`${'x'.repeat(1017)}🙂tail`, `${'x'.repeat(1017)}🙂…`] -])('preserves the existing UTF-8 preview boundary for %#', (body, expected) => { - const { db, deps, run, assign } = fixture() - const dispatch = assign('term_worker') - db.createQuestion({ - runId: run.id, - dispatchId: dispatch.id, - askerHandle: 'term_worker', - question: body - }) - const row = new CrewReadModel(() => deps, db.crewChanges.subscribe).read('term_coord').sections - .managing[0] - expect(row.latest?.preview).toBe(expected) - expect(row.pendingQuestion?.preview).toBe(expected) -}) diff --git a/src/main/runtime/rpc/methods/structured-sessions/subscriptions/structured-agent-session-receipt-frame-budget.test.ts b/src/main/runtime/rpc/methods/structured-sessions/subscriptions/structured-agent-session-receipt-frame-budget.test.ts deleted file mode 100644 index 368f34bb52a..00000000000 --- a/src/main/runtime/rpc/methods/structured-sessions/subscriptions/structured-agent-session-receipt-frame-budget.test.ts +++ /dev/null @@ -1,103 +0,0 @@ -import { join } from 'node:path' -import { afterEach, beforeEach, expect, it } from 'vitest' -import { AGENT_JOURNAL_THREAD_SCOPE } from '../../../../../../shared/agent-session/journal/agent-session-journal-types' -import type { AgentSessionSubscribeEvent } from '../../../../../../shared/agent-session/agent-session-wire' -import { codexProviderHandle } from '../../../../../../shared/agent-session/lifecycle/agent-session-provider-handle-encoding' -import { MOBILE_BRIDGE_MAX_FRAME_BYTES } from '../../../../../../shared/mobile-bridge-frame-bytes' -import { AgentSessionSubscribers } from '../../../../../native-chat/agent-session-wire/publication/subscribers/structured-agent-session-subscribers' - -import type { AgentSessionSubscribeInput } from '../../../../../native-chat/agent-session-wire/publication/subscribers/agent-session-subscribe-input' -import { - fixture, - journals -} from '../../../../../native-chat/agent-session-wire/publication/subscribers/testing/structured-agent-session-subscriber-contract-test-fixture' -import { - clearStructuredHostStub, - hostCalls, - installStructuredHostStub, - openStream -} from '../protocol/structured-agent-session-rpc.test-fixture' - -import { - SESSION, - STRUCTURED_MOBILE_CLIENT -} from '../protocol/structured-agent-session-rpc-client.test-fixture' - -beforeEach(installStructuredHostStub) -afterEach(clearStructuredHostStub) - -it.each(['snapshot', 'reset', 'batch'] as const)( - 'keeps near-limit %s delivery readable when receipt names do not fit', - async (type) => { - const journal = await journals.open({ - identity: { - sessionId: SESSION, - workspaceId: 'workspace-1', - hostId: 'local', - agent: 'codex', - providerHandle: codexProviderHandle('thread-1') - }, - stateDirectory: join(fixture.root, 'receipts') - }) - const start = journal.cursor() - for (let ordinal = 1; ordinal <= 200; ordinal++) { - await journal.appendItem( - { provider: 'codex', threadId: 'thread-1', turnId: 'turn-1', ordinal }, - { - kind: 'approval', - title: `Approval ${ordinal}`, - detail: 'x'.repeat(2500), - options: [{ id: 'yes', label: 'Allow' }], - resolution: { - state: 'resolved', - selectedOptionId: 'yes', - resolvedBy: 'desktop-renderer', - resolvedAt: 10 - } - }, - { fence: 7, turnScope: AGENT_JOURNAL_THREAD_SCOPE } - ) - } - const base: AgentSessionSubscribeEvent[] = [] - const subscribers = new AgentSessionSubscribers() - hostCalls.subscribe.mockImplementation((input: AgentSessionSubscribeInput) => - subscribers.open({ - ...input, - journal, - fence: 7, - emit: (event) => { - base.push(event) - input.emit(event) - } - }) - ) - const cursor = type === 'reset' ? { epoch: 'old', sequence: 0 } : start - const responses = await openStream( - 'agentSession.subscribe', - { sessionId: SESSION, ...(type === 'snapshot' ? {} : { cursor }) }, - { ...STRUCTURED_MOBILE_CLIENT, clientId: 'reader-phone' }, - { readMachineName: () => '界'.repeat(255) } - ) - expect(base[0]?.type).toBe(type) - expect(Buffer.byteLength(JSON.stringify(base[0]), 'utf8')).toBeGreaterThan(540 * 1024) - expect(responses).toHaveLength(base.length) - for (const [index, response] of responses.entries()) { - expect(response).toMatchObject({ ok: true, result: base[index] }) - if (!response.ok) { - throw new Error('expected receipt delivery') - } - const frame = { - v: 1, - type: 'event', - id: 'receipt-stream', - seq: 2 ** 31, - payload: response.result - } - expect(Buffer.byteLength(JSON.stringify(frame), 'utf8')).toBeLessThanOrEqual( - MOBILE_BRIDGE_MAX_FRAME_BYTES - ) - } - expect(journal.snapshot().items).toHaveLength(200) - expect(JSON.stringify(journal.snapshot().items)).not.toContain('resolvedByDevice') - } -) diff --git a/src/renderer/src/components/dashboard-popout/dashboard-agent-status-patch.test.ts b/src/renderer/src/components/dashboard-popout/dashboard-agent-status-patch.test.ts deleted file mode 100644 index ca62630dae8..00000000000 --- a/src/renderer/src/components/dashboard-popout/dashboard-agent-status-patch.test.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { describe, expect, it } from 'vitest' -import type { AgentStatusIpcPayload } from '../../../../shared/agent-status/contracts/agent-status-ipc-payload' -import type { DashboardCard, DashboardSnapshot } from '../../../../shared/dashboard-snapshot' -import { patchDashboardSnapshotFromAgentStatus } from './dashboard-agent-status-patch' - -function card(overrides: Partial = {}): DashboardCard { - return { - paneKey: 'tab-1:leaf-1', - ptyId: 'pty-1', - agentType: 'codex', - bucket: 'working', - dotState: 'working', - task: 'old task', - repoId: 'repo-1', - worktreeId: 'worktree-1', - tabId: 'tab-1', - leafId: 'leaf-1', - repoName: 'Repo', - worktreeName: 'Worktree', - startedAt: 100, - finishedAt: null, - stateChangedAt: 100, - statusUpdatedAt: 150, - unseen: false, - ...overrides - } -} - -function event(overrides: Partial = {}): AgentStatusIpcPayload { - return { - paneKey: 'tab-1:leaf-1', - state: 'blocked', - prompt: 'Need a decision', - connectionId: null, - receivedAt: 300, - stateStartedAt: 250, - interactivePrompt: '{"question":"Continue?"}', - ...overrides - } -} - -function snapshot(cards: DashboardCard[] = [card()]): DashboardSnapshot { - return { generatedAt: 200, cards } -} - -describe('patchDashboardSnapshotFromAgentStatus', () => { - it('ignores stale, wrong-workspace, and session-only events', () => { - const original = snapshot() - expect( - patchDashboardSnapshotFromAgentStatus(original, event({ receivedAt: 150 })).snapshot - ).toBe(original) - expect( - patchDashboardSnapshotFromAgentStatus(original, event({ worktreeId: 'other' })).snapshot - ).toBe(original) - expect( - patchDashboardSnapshotFromAgentStatus(original, event({ providerSessionOnly: true })).snapshot - ).toBe(original) - }) -}) diff --git a/src/renderer/src/components/dictation/dictation-toasts.test.ts b/src/renderer/src/components/dictation/dictation-toasts.test.ts deleted file mode 100644 index b22a3e0ab36..00000000000 --- a/src/renderer/src/components/dictation/dictation-toasts.test.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { dictationStartFailureKind } from './dictation-toasts' - -const startError = (detail: string): string => - `Error: Error invoking remote method 'speech:startDictation': Error: ${detail}` - -describe('dictationStartFailureKind', () => { - it.each([ - [startError('Model not ready: not-downloaded'), 'settings'], - [startError('The speech engine stopped unexpectedly. Try again.'), 'settings'], - ['NotAllowedError: Permission denied', null], - [startError('Microphone access not granted. Open System Settings.'), null], - ['Error: dictation_model_busy', null] - ])('%s → %s', (message, kind) => { - expect(dictationStartFailureKind(message)).toBe(kind) - }) -}) diff --git a/src/renderer/src/components/editor/external-changes/editor-clean-tab-draft-invariant.test.ts b/src/renderer/src/components/editor/external-changes/editor-clean-tab-draft-invariant.test.ts deleted file mode 100644 index 5583a882650..00000000000 --- a/src/renderer/src/components/editor/external-changes/editor-clean-tab-draft-invariant.test.ts +++ /dev/null @@ -1,61 +0,0 @@ -// Clean tabs must not retain disk-text drafts that could later overwrite a shared model. -import { afterEach, beforeEach, expect, it, vi } from 'vitest' - -import { __clearSelfWriteRegistryForTests } from './editor-self-write-registry' -import { createEditorStore } from '../autosave/editor-autosave-controller-test-fixture' - -import { stampCleanTabDiskBaseline } from './editor-clean-tab-disk-baseline' -import { getDiskBaselineSignature } from '../../../../../shared/file-write/disk-baseline-signature' -import { GUARDED_PATH, stubGuardedDisk } from '../save/queue/editor-save-guarded-disk-fixture' - -const storeRef = vi.hoisted((): { current: ReturnType | null } => ({ - current: null -})) - -vi.mock('sonner', () => ({ toast: Object.assign(vi.fn(), { error: vi.fn() }) })) -vi.mock('@/lib/connection-context', () => ({ getConnectionIdForFile: () => undefined })) -vi.mock('@/store/index', () => ({ useAppStore: { getState: () => storeRef.current?.getState() } })) - -function openCleanTab(disk: string, language = 'typescript') { - const store = createEditorStore() - storeRef.current = store - store.getState().openFile({ - filePath: GUARDED_PATH, - relativePath: 'file.ts', - worktreeId: 'wt-1', - language, - mode: 'edit' - }) - const id = store.getState().openFiles[0].id - store.getState().setLastKnownDiskSignature(id, getDiskBaselineSignature(disk)) - return { store, id } -} - -beforeEach(() => { - vi.useFakeTimers() - stubGuardedDisk({ [GUARDED_PATH]: 'disk' }) -}) - -afterEach(() => { - vi.useRealTimers() - vi.unstubAllGlobals() - __clearSelfWriteRegistryForTests() -}) - -it("a reload keeps a clean Markdown tab's trailing-whitespace draft, but not one over older text", () => { - const { store, id } = openCleanTab('# notes', 'markdown') - store.getState().setEditorDraft(id, '# notes\n\n') - stampCleanTabDiskBaseline(id, { content: '# notes', isBinary: false }) - expect(store.getState().editorDrafts[id]).toBe('# notes\n\n') - - stampCleanTabDiskBaseline(id, { content: '# newer notes', isBinary: false }) - expect(store.getState().editorDrafts[id]).toBeUndefined() -}) - -it('a reload drops a whitespace-only Markdown draft when disk moved, even by whitespace alone', () => { - const { store, id } = openCleanTab('# notes', 'markdown') - store.getState().setEditorDraft(id, '# notes\n\n') - // An outside write added a trailing newline; keeping the draft would undo it. - stampCleanTabDiskBaseline(id, { content: '# notes\n', isBinary: false }) - expect(store.getState().editorDrafts[id]).toBeUndefined() -}) diff --git a/src/renderer/src/components/editor/image-png-export.test.ts b/src/renderer/src/components/editor/image-png-export.test.ts deleted file mode 100644 index 3b57e227fc9..00000000000 --- a/src/renderer/src/components/editor/image-png-export.test.ts +++ /dev/null @@ -1,58 +0,0 @@ -// @vitest-environment happy-dom - -import { afterEach, describe, expect, it, vi } from 'vitest' -import { imageClipboardPngDataUrl, imagePngLayout } from './image-png-export' - -const PNG_BASE64 = - 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+jRZkAAAAASUVORK5CYII=' - -describe('imagePngLayout', () => { - it('doubles small images for crisp text', () => { - expect(imagePngLayout({ width: 300, height: 100 })).toEqual({ - width: 600, - height: 200, - pixelRatio: 2 - }) - }) - - it('scales down to stay inside the clipboard pixel budget and canvas side limit', () => { - const budget = imagePngLayout({ width: 4000, height: 4000 }, 1_000_000) - expect(budget!.width * budget!.height).toBeLessThanOrEqual(1_000_000) - const wide = imagePngLayout({ width: 40_000, height: 10 }) - expect(wide!.width).toBeLessThanOrEqual(16384) - }) - - it('refuses an image with no size', () => { - expect(imagePngLayout({ width: 0, height: 10 })).toBeNull() - }) -}) - -describe('imageClipboardPngDataUrl', () => { - afterEach(() => { - vi.unstubAllGlobals() - vi.restoreAllMocks() - }) - - it('copies a raster PNG as its own bytes instead of a 2x render', async () => { - const bytes = Uint8Array.from(atob(PNG_BASE64), (character) => character.charCodeAt(0)) - vi.stubGlobal( - 'fetch', - vi.fn(async () => new Response(new Blob([bytes], { type: 'image/png' }))) - ) - vi.stubGlobal( - 'Image', - class { - src = '' - naturalWidth = 1 - naturalHeight = 1 - decode = async (): Promise => undefined - } - ) - vi.spyOn(URL, 'createObjectURL').mockReturnValue('blob:decode') - vi.spyOn(URL, 'revokeObjectURL').mockImplementation(() => undefined) - - await expect( - imageClipboardPngDataUrl('blob:image', { width: 1, height: 1 }, null) - ).resolves.toBe(`data:image/png;base64,${PNG_BASE64}`) - }) -}) diff --git a/src/renderer/src/components/gitlab-item-dialog/use-gitlab-primary-actions.test.ts b/src/renderer/src/components/gitlab-item-dialog/use-gitlab-primary-actions.test.ts deleted file mode 100644 index c964523c52f..00000000000 --- a/src/renderer/src/components/gitlab-item-dialog/use-gitlab-primary-actions.test.ts +++ /dev/null @@ -1,57 +0,0 @@ -// @vitest-environment happy-dom - -import { act, renderHook } from '@testing-library/react' -import { describe, expect, it, vi } from 'vitest' -import type { GitLabWorkItem } from '../../../../shared/gitlab-types' -import type { GitLabItemDialogState } from './use-gitlab-item-dialog-state' -import { useGitLabPrimaryActions } from './use-gitlab-primary-actions' - -const mocks = vi.hoisted(() => ({ - mergeMR: vi.fn(), - toastError: vi.fn() -})) - -vi.mock('@/runtime/repository-gitlab/gitlab-owner-api', () => ({ - gitLabApiFor: () => ({ mergeMR: mocks.mergeMR }) -})) - -vi.mock('sonner', () => ({ toast: { error: mocks.toastError, success: vi.fn() } })) - -const item: GitLabWorkItem = { - id: 'mr:7', - type: 'mr', - number: 7, - title: 'MR 7', - state: 'opened', - url: 'https://gitlab.example.test/g/p/-/merge_requests/7', - labels: [], - updatedAt: '2026-11-01T00:00:00Z', - author: null, - repoId: 'repo-1' -} - -describe('useGitLabPrimaryActions', () => { - it('rereads after a returned merge failure and keeps the error toast', async () => { - mocks.mergeMR.mockResolvedValue({ ok: false, error: 'Connection lost' }) - const events: string[] = [] - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: handleMerge reads only these dialog-state fields; the rest of the dialog state is unused here. - const state = { - claimDetailsOwner: () => () => true, - commentDraft: '', - mountedRef: { current: true }, - setActionInFlight: (value: string | null) => events.push(`inFlight:${value}`), - setCommentDraftState: vi.fn(), - setCommentSubmitting: vi.fn() - } as unknown as GitLabItemDialogState - const { result } = renderHook(() => - useGitLabPrimaryActions(item, 'mr:7', { repoPath: '/repo' }, state, () => - events.push('reread') - ) - ) - - await act(async () => result.current.handleMerge()) - - expect(mocks.toastError).toHaveBeenCalledWith('Connection lost') - expect(events).toEqual(['inFlight:merge', 'inFlight:null', 'reread']) - }) -}) diff --git a/src/renderer/src/components/native-chat/session/terminal/assembly/native-chat-live-message-preparation.test.ts b/src/renderer/src/components/native-chat/session/terminal/assembly/native-chat-live-message-preparation.test.ts deleted file mode 100644 index 765021e2549..00000000000 --- a/src/renderer/src/components/native-chat/session/terminal/assembly/native-chat-live-message-preparation.test.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { describe, expect, it } from 'vitest' -import type { NativeChatMessage } from '../../../../../../../shared/native-chat/native-chat-types' -import { prepareNativeChatLiveMessages } from './native-chat-live-message-preparation' -import { createNativeChatMessageListProjection } from '../../../conversation/projection/native-chat-message-list-projection' - -const row = (id: string, text: string, source: NativeChatMessage['source'] = 'transcript') => ({ - id, - role: 'user' as const, - blocks: [{ type: 'text' as const, text }], - timestamp: 100, - source -}) - -const CONTEXT_ROWS: NativeChatMessage[] = [ - row('b-envelope', '/context\n'), - { - ...row( - 'a-stdout', - ' \u001b[1mContext Usage\u001b[22m' - ), - parentId: 'b-envelope' - } -] - -function visibleText(agent: 'openclaude' | 'claude', messages: NativeChatMessage[]): string[] { - return createNativeChatMessageListProjection()( - prepareNativeChatLiveMessages(messages, agent) - ).conversation.flatMap((message) => - message.blocks.map((block) => (block.type === 'text' ? block.text : '')) - ) -} - -describe('prepareNativeChatLiveMessages command output', () => { - it("lists OpenClaude's /context report in the chat", () => { - expect(visibleText('openclaude', CONTEXT_ROWS)).toEqual(['Context Usage']) - // A live hook preview alongside the transcript takes the reassembly path. - expect( - visibleText('openclaude', [...CONTEXT_ROWS, row('hook', 'next prompt', 'hook')]) - ).toEqual(['Context Usage', 'next prompt']) - }) - - it('keeps a later /model reply hidden after a /context report', () => { - const modelRows = [ - { ...row('d-envelope', '/model'), timestamp: 300 }, - { - ...row('c-stdout', 'Set model to gpt-4o'), - timestamp: 300, - parentId: 'd-envelope' - } - ] - // Unsupported command envelopes surface as typed turns while their linked replies stay hidden. - expect(visibleText('openclaude', [...CONTEXT_ROWS, ...modelRows])).toEqual([ - 'Context Usage', - '/model' - ]) - }) - - it('keeps the reply row hidden for Claude', () => { - expect(visibleText('claude', CONTEXT_ROWS)).toEqual(['/context']) - }) -}) diff --git a/src/renderer/src/components/new-workspace/work-item-source-selection.test.ts b/src/renderer/src/components/new-workspace/work-item-source-selection.test.ts deleted file mode 100644 index 0476f3db425..00000000000 --- a/src/renderer/src/components/new-workspace/work-item-source-selection.test.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { describe, expect, it } from 'vitest' -import type { JiraIssue, JiraSite } from '../../../../shared/jira/jira-types' -import type { TaskSourceContext } from '../../../../shared/work-items/task-source-context' -import { bindJiraIssueSourceContext } from './use-jira-url-source' -import { resolveWorkItemSourceRow } from './work-item-source-selection' - -const source: TaskSourceContext = { - kind: 'task-source', - provider: 'jira', - projectId: 'project', - hostId: 'ssh:box', - repoId: null, - providerIdentity: null, - accountLabel: null -} -const site: JiraSite = { - id: 'site', - siteUrl: 'https://company.atlassian.net', - email: 'account@example.com', - displayName: 'Account', - accountId: 'account' -} -const issue: JiraIssue = { - id: 'issue', - key: 'ENG-1', - title: 'Issue', - url: `${site.siteUrl}/browse/ENG-1`, - siteId: site.id, - project: { id: 'project', key: 'ENG', name: 'Engineering' }, - issueType: { id: 'bug', name: 'Bug' }, - status: { id: 'open', name: 'Open', categoryKey: 'new', categoryName: 'To do' }, - labels: [], - updatedAt: '', - createdAt: '' -} -const contexts = { github: null, gitlab: null, linear: null, jira: source } - -describe('shared work-item source resolution', () => { - it.each([{ siteId: 'another-account' }, { url: 'https://other.atlassian.net/browse/ENG-1' }])( - 'rejects a pre-bound account that does not match the result: %j', - (overrides) => { - const bound = bindJiraIssueSourceContext(source, site, issue) - expect( - resolveWorkItemSourceRow( - { kind: 'jira', value: 'jira', issue: { ...issue, ...overrides } }, - { ...contexts, jira: bound } - ) - ).toBeNull() - } - ) - it('accepts the callback-bound account when no connection list is available', () => { - const bound = bindJiraIssueSourceContext(source, site, issue) - expect( - resolveWorkItemSourceRow({ kind: 'jira', value: 'jira', issue }, { ...contexts, jira: bound }) - ?.taskSourceContext - ).toEqual(bound) - }) -}) diff --git a/src/renderer/src/components/status-bar/resource-session-inventory.test.ts b/src/renderer/src/components/status-bar/resource-session-inventory.test.ts deleted file mode 100644 index 89b144fff38..00000000000 --- a/src/renderer/src/components/status-bar/resource-session-inventory.test.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { PtyListedSession as DaemonSession } from '../../../../shared/terminal/pty/lifecycle/pty-listed-session' -import { ResourceSessionInventoryCache } from './resource-session-inventory-cache' - -function session(id: string, incarnationId?: string): DaemonSession { - return { id, incarnationId, cwd: '/workspace', title: id, agentOwnership: 'absent' as const } -} - -function deferredListing() { - let resolve!: (sessions: DaemonSession[]) => void - let reject!: (error: Error) => void - const promise = new Promise((done, fail) => { - resolve = done - reject = fail - }) - return { promise, resolve, reject } -} - -describe('resource session inventory request-scoped exits', () => { - beforeEach(() => vi.useFakeTimers()) - afterEach(() => vi.useRealTimers()) - - it('associates loading notifications with the request they can invalidate', async () => { - const original = session('one', 'A') - const list = vi.fn().mockResolvedValue([original]) - const cache = new ResourceSessionInventoryCache(list, true) - let exited = false - cache.subscribe(() => { - if (!exited && cache.getSnapshot().loading) { - exited = true - cache.exited({ code: 0, ...original, hostId: 'local' }) - } - }) - - cache.setActive(true) - await vi.advanceTimersByTimeAsync(0) - expect(list).toHaveBeenCalledTimes(1) - expect(cache.getSnapshot().sessionInventory.count).toBe(0) - }) - - it('absorbs pending exit publications into an in-flight listing without resurrecting its incarnation', async () => { - const original = session('one', 'A') - const replacement = session('one', 'B') - const slow = deferredListing() - const list = vi.fn().mockResolvedValueOnce([original]).mockReturnValueOnce(slow.promise) - const cache = new ResourceSessionInventoryCache(list, true) - cache.setActive(true) - await vi.advanceTimersByTimeAsync(100) - void cache.refresh() - await vi.advanceTimersByTimeAsync(0) - - cache.exited({ code: 0, ...original, hostId: 'local' }) - slow.resolve([original, replacement]) - await vi.advanceTimersByTimeAsync(0) - const settled = cache.getSnapshot().sessionInventory - expect(settled.sessions).toEqual([replacement]) - await vi.advanceTimersByTimeAsync(50) - expect(cache.getSnapshot().sessionInventory).toBe(settled) - expect(vi.getTimerCount()).toBe(0) - }) -}) diff --git a/src/renderer/src/lib/agent-draft-readiness.test.ts b/src/renderer/src/lib/agent-draft-readiness.test.ts deleted file mode 100644 index 22b7e0c2488..00000000000 --- a/src/renderer/src/lib/agent-draft-readiness.test.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { afterEach, describe, expect, it, vi } from 'vitest' -import { - bufferPreHandlerPtyData, - clearPreHandlerPtyState, - drainPreHandlerPtyData -} from '@/components/terminal-pane/pty-transport/delivery/pty-pre-handler-buffer' -import { waitForAgentDraftInputReady } from './agent-draft-readiness' -import type * as RemoteRuntimePtyIdModule from '../../../shared/remote-runtime/remote-runtime-pty-id' - -const testState = vi.hoisted(() => ({ - observer: null as ((data: string) => void) | null, - unsubscribe: vi.fn() -})) - -vi.mock('@/components/terminal-pane/pty-transport/delivery/pty-data-sidecar-subscriptions', () => ({ - subscribeToPtyData: (_ptyId: string, observer: (data: string) => void) => { - testState.observer = observer - return testState.unsubscribe - } -})) - -vi.mock('../../../shared/remote-runtime/remote-runtime-pty-id', async (importOriginal) => ({ - ...(await importOriginal()), - isRemoteRuntimePtyId: () => false -})) - -const PTY_ID = 'pty-buffered-codex' -const CODEX_COMPOSER = '\x1b[?1049h\x1b[1m›\x1b[0m Implement {feature}' -const DECSET_BRACKETED_PASTE = '\x1b[?2004h' - -describe('waitForAgentDraftInputReady', () => { - afterEach(() => { - clearPreHandlerPtyState(PTY_ID) - testState.observer = null - testState.unsubscribe.mockReset() - vi.unstubAllGlobals() - vi.useRealTimers() - }) - - it('observes buffered startup bytes without consuming the primary drain', async () => { - vi.useFakeTimers() - bufferPreHandlerPtyData(PTY_ID, CODEX_COMPOSER) - bufferPreHandlerPtyData(PTY_ID, DECSET_BRACKETED_PASTE) - const primary = vi.fn() - - await expect( - waitForAgentDraftInputReady(PTY_ID, 20_000, 'codex-composer-prompt') - ).resolves.toBe(true) - drainPreHandlerPtyData(PTY_ID, primary) - - expect(testState.unsubscribe).toHaveBeenCalledOnce() - expect(primary.mock.calls).toEqual([ - [CODEX_COMPOSER, undefined], - [DECSET_BRACKETED_PASTE, undefined] - ]) - expect(vi.getTimerCount()).toBe(0) - }) -}) diff --git a/src/renderer/src/lib/pane-manager/terminal-complex-script.test.ts b/src/renderer/src/lib/pane-manager/terminal-complex-script.test.ts deleted file mode 100644 index 0dc145be89c..00000000000 --- a/src/renderer/src/lib/pane-manager/terminal-complex-script.test.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { expect, it, vi } from 'vitest' -import { terminalOutputPrefersRenderRefresh } from './terminal-complex-script' - -it.each(['\x1b[32mx\x1b[0m', '\x1b[38m'])( - 'keeps parameter scanning linear for repeated simple SGR %j', - (sequence) => { - for (const repetitions of [1_000, 10_000]) { - const data = sequence.repeat(repetitions) - let examinedCharacters = 0 - const indexOf = String.prototype.indexOf - const charCodeAt = String.prototype.charCodeAt - const indexOfSpy = vi.spyOn(String.prototype, 'indexOf').mockImplementation(function ( - this: string, - search, - position = 0 - ) { - const result = indexOf.call(this, search, position) - if (String(this) === data) { - examinedCharacters += - result < 0 ? this.length - position : result - position + search.length - } - return result - }) - const charCodeAtSpy = vi.spyOn(String.prototype, 'charCodeAt').mockImplementation(function ( - this: string, - position - ) { - if (String(this) === data) { - examinedCharacters += 1 - } - return charCodeAt.call(this, position) - }) - let prefersRefresh: boolean - try { - prefersRefresh = terminalOutputPrefersRenderRefresh(data) - } finally { - indexOfSpy.mockRestore() - charCodeAtSpy.mockRestore() - } - expect(prefersRefresh).toBe(false) - expect(examinedCharacters).toBeLessThan(data.length * 12) - } - } -) - -it.each([ - ['\x1b[38;2;1;2;44m', false], - ['\x1b[38;2;1;2;3;41m', true], - ['\x1b[38:5:1;44m', true], - ['\x1b[38;5;41m', false], - ['\x1b[38;41m', false], - ['\x1b[0041m', true], - ['\x1b[4:41m', false], - ['\x1b[48m', true], - ['\x1b[\x1b[41m', true] -])('classifies background SGR parameters in %j as %s', (data, expected) => { - expect(terminalOutputPrefersRenderRefresh(data)).toBe(expected) -}) diff --git a/src/renderer/src/lib/source-control/remote/source-control-remote-error.test.ts b/src/renderer/src/lib/source-control/remote/source-control-remote-error.test.ts index 2497bf017e7..2737c94e9ea 100644 --- a/src/renderer/src/lib/source-control/remote/source-control-remote-error.test.ts +++ b/src/renderer/src/lib/source-control/remote/source-control-remote-error.test.ts @@ -1,23 +1,7 @@ import { describe, expect, it } from 'vitest' -import { - isNonFastForwardRemoteError, - resolveRemoteOperationErrorMessage -} from './source-control-remote-error' +import { resolveRemoteOperationErrorMessage } from './source-control-remote-error' describe('source-control remote error formatting', () => { - it.each(['fatal', 'remote'])( - 'redacts ANSI-bearing credentials in %s details from older remote hosts', - (prefix) => { - const error = new Error( - `git.push failed:\n${prefix}: Access denied to https://user:sec\x1b[1 qret@example.com/repo.git` - ) - - expect(resolveRemoteOperationErrorMessage(error, { isPush: true })).toBe( - 'Push failed. Access denied to https://example.com/repo.git. Check your remote access and try again.' - ) - } - ) - it.each([ [{ isFetch: true }, 'Fetch failed. '], [{ isFastForward: true }, 'Fast-forward failed. '], @@ -31,29 +15,4 @@ describe('source-control remote error formatting', () => { ) expect(error.message).toContain('user:sec\x1b[1 qret@') }) - - it.each([ - [{ publish: true }, 'Publish Branch'], - [{ isSync: true }, 'Sync'], - [{ isForcePush: true }, 'Force Push'], - [{ isPush: true }, 'Push'] - ])('sanitizes and classifies older-host submodule errors for %j', (options, operation) => { - const error = new Error( - "Unable to push sub\x1b[1 qmodule 'https://user:sec\x1b[1 qret@example.com/repo.git'\n" + - ' ! [rejected] main -> main (fetch\x1b[1 q first)' - ) - - expect(resolveRemoteOperationErrorMessage(error, options)).toBe( - `${operation} failed. Submodule 'https://example.com/repo.git' has remote changes. Pull inside the submodule, then try again.` - ) - expect(isNonFastForwardRemoteError(error)).toBe(true) - expect( - resolveRemoteOperationErrorMessage( - new Error("Unable to push submodule 'https://user:sec\x1b[1 qret@example.com/repo.git'"), - options - ) - ).toBe( - `${operation} failed. Submodule 'https://example.com/repo.git' could not be pushed. Resolve the submodule push error, then try again.` - ) - }) }) diff --git a/src/renderer/src/runtime/sync-runtime-graph/sync-runtime-graph-chat-tab-order.test.ts b/src/renderer/src/runtime/sync-runtime-graph/sync-runtime-graph-chat-tab-order.test.ts deleted file mode 100644 index 585f6968a75..00000000000 --- a/src/renderer/src/runtime/sync-runtime-graph/sync-runtime-graph-chat-tab-order.test.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { expect, it } from 'vitest' -import type { Tab } from '../../../../shared/tab-types' -import { buildMobileSessionTabSnapshots } from './mobile-session-snapshots' -import { makeState } from './testing/sync-runtime-graph-test-harness' - -function makeTab(overrides: Pick): Tab { - return { - groupId: 'group-1', - worktreeId: 'wt-1', - label: overrides.id, - customLabel: null, - color: null, - sortOrder: 0, - createdAt: 1, - ...overrides - } -} - -it('invalidates the production snapshot cache when the selected host chat lifetime changes', async () => { - const { setHostSessionTabIdMapping, clearHostSessionTabIdMappings } = - await import('../web-session-tabs-sync/tracking-mappings') - const chat = makeTab({ id: 'window-chat', entityId: 'chat-0001', contentType: 'agent-session' }) - const state = makeState({ - unifiedTabsByWorktree: { 'wt-1': [chat] }, - groupsByWorktree: { - 'wt-1': [ - { - id: 'group-1', - worktreeId: 'wt-1', - activeTabId: chat.id, - tabOrder: [chat.id], - recentTabIds: [chat.id] - } - ] - } - }) - try { - const legacy = buildMobileSessionTabSnapshots(state)[0] - setHostSessionTabIdMapping( - { environmentId: 'local', worktreeId: 'wt-1', tabId: chat.id }, - 'agent-chat-tab-v1-a' - ) - const issued = buildMobileSessionTabSnapshots(state)[0] - expect(issued).not.toBe(legacy) - expect(issued?.tabGroups?.[0]).toMatchObject({ - tabOrder: ['agent-chat-tab-v1-a'], - activeTabId: 'agent-chat-tab-v1-a', - recentTabIds: ['agent-chat-tab-v1-a'] - }) - expect(buildMobileSessionTabSnapshots(state)[0]).toBe(issued) - setHostSessionTabIdMapping( - { environmentId: 'local', worktreeId: 'wt-1', tabId: chat.id }, - 'agent-chat-tab-v1-b' - ) - expect(buildMobileSessionTabSnapshots(state)[0]?.tabGroups?.[0]?.tabOrder).toEqual([ - 'agent-chat-tab-v1-b' - ]) - } finally { - clearHostSessionTabIdMappings('local', 'wt-1') - } -}) diff --git a/src/renderer/src/runtime/web-session-tabs-sync/inventory/remote-runtime-session-tabs-inflight.test.ts b/src/renderer/src/runtime/web-session-tabs-sync/inventory/remote-runtime-session-tabs-inflight.test.ts deleted file mode 100644 index 33274178b37..00000000000 --- a/src/renderer/src/runtime/web-session-tabs-sync/inventory/remote-runtime-session-tabs-inflight.test.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import type { RuntimeMobileSessionTabsResult } from '../../../../../shared/runtime-session-contracts' -import { - listRemoteRuntimeSessionTabsAfterCurrentInFlight, - listRemoteRuntimeSessionTabsDeduped -} from './remote-runtime-session-tabs-inflight' - -const SNAPSHOT = { - worktree: 'wt-1', - publicationEpoch: 'epoch-1', - snapshotVersion: 1, - activeGroupId: null, - activeTabId: null, - activeTabType: null, - tabs: [] -} satisfies RuntimeMobileSessionTabsResult - -describe('remote runtime session-tabs in-flight requests', () => { - it('waits out an older request before sharing a post-operation inventory', async () => { - let resolveCurrent: (answer: { snapshot: RuntimeMobileSessionTabsResult }) => void = () => {} - const currentLoad = vi.fn( - () => - new Promise<{ snapshot: RuntimeMobileSessionTabsResult }>((resolve) => { - resolveCurrent = resolve - }) - ) - let resolveFresh: (answer: { snapshot: RuntimeMobileSessionTabsResult }) => void = () => {} - const freshLoad = vi.fn( - () => - new Promise<{ snapshot: RuntimeMobileSessionTabsResult }>((resolve) => { - resolveFresh = resolve - }) - ) - const ownership = { environmentId: 'env-1', worktreeId: 'wt-1' } - - const current = listRemoteRuntimeSessionTabsDeduped({ ...ownership, load: currentLoad }) - const firstFresh = listRemoteRuntimeSessionTabsAfterCurrentInFlight({ - ...ownership, - load: freshLoad - }) - const secondFresh = listRemoteRuntimeSessionTabsAfterCurrentInFlight({ - ...ownership, - load: freshLoad - }) - - expect(freshLoad).not.toHaveBeenCalled() - resolveCurrent({ snapshot: SNAPSHOT }) - await expect(current.then((answer) => answer.snapshot)).resolves.toBe(SNAPSHOT) - await vi.waitFor(() => expect(freshLoad).toHaveBeenCalledOnce()) - resolveFresh({ snapshot: { ...SNAPSHOT, snapshotVersion: 2 } }) - await expect( - Promise.all([firstFresh, secondFresh]).then((answers) => - answers.map((answer) => answer.snapshot) - ) - ).resolves.toEqual([ - { ...SNAPSHOT, snapshotVersion: 2 }, - { ...SNAPSHOT, snapshotVersion: 2 } - ]) - }) -}) diff --git a/src/renderer/src/store/github/repositories/wsl-stopped-distro-poll-refusal.test.ts b/src/renderer/src/store/github/repositories/wsl-stopped-distro-poll-refusal.test.ts deleted file mode 100644 index 31299939c23..00000000000 --- a/src/renderer/src/store/github/repositories/wsl-stopped-distro-poll-refusal.test.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { PRCheckDetail } from '../../../../../shared/github/check-types' -import { createTestStore, mockApi, resetRemoteRuntimeMocks } from '../github-slice-test-harness' - -// What main's gate rejects with, as IPC delivers it to the renderer. -const refusal = new Error( - "Error invoking remote method 'gh:issue': WslDistroStoppedError: WSL distro 'Ubuntu' is not running. Retry, or open a terminal in it, to start it." -) -const issue = { number: 7, title: 'Linked', state: 'open', url: 'https://example.test/7' } -const checks: PRCheckDetail[] = [{ name: 'Build', status: 'queued', conclusion: null, url: null }] - -let consoleError: ReturnType -beforeEach(() => { - vi.clearAllMocks() - resetRemoteRuntimeMocks() - consoleError = vi.spyOn(console, 'error').mockImplementation(() => undefined) -}) -afterEach(() => { - vi.useRealTimers() - vi.restoreAllMocks() -}) - -describe('GitHub polls refused for a stopped WSL distro', () => { - it('keeps the linked issue a card already shows, without logging a failure', async () => { - vi.useFakeTimers() - const store = createTestStore() - mockApi.gh.issue.mockResolvedValueOnce(issue) - await store.getState().fetchIssue('/repo', 7) - // Past the issue cache's freshness window, so the next card poll asks main again. - vi.advanceTimersByTime(24 * 60 * 60 * 1000) - mockApi.gh.issue.mockRejectedValueOnce(refusal) - - await expect(store.getState().fetchIssue('/repo', 7)).resolves.toEqual(issue) - - expect(Object.values(store.getState().issueCache).map((entry) => entry.data)).toEqual([issue]) - expect(consoleError).not.toHaveBeenCalled() - }) - - it('sends Refresh as a user act and does not join a poll already in flight', async () => { - const store = createTestStore() - const poll = Promise.withResolvers() - mockApi.gh.prChecks.mockReturnValueOnce(poll.promise).mockResolvedValueOnce(checks) - - const polled = store.getState().fetchPRChecks('/repo', 1, 'main', 'sha', undefined, { - force: true - }) - const refreshed = store.getState().fetchPRChecks('/repo', 1, 'main', 'sha', undefined, { - force: true, - wakeWslDistro: true - }) - poll.reject(refusal) - - await expect(refreshed).resolves.toEqual(checks) - await polled - - expect(mockApi.gh.prChecks.mock.calls[0][0]).not.toHaveProperty('wakeWslDistro') - expect(mockApi.gh.prChecks.mock.calls[1][0]).toMatchObject({ wakeWslDistro: true }) - }) -}) diff --git a/src/renderer/src/store/slices/agent-status/agent-status-ack-cleanup.test.ts b/src/renderer/src/store/slices/agent-status/agent-status-ack-cleanup.test.ts deleted file mode 100644 index 310a4b53263..00000000000 --- a/src/renderer/src/store/slices/agent-status/agent-status-ack-cleanup.test.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { afterEach, describe, expect, it, vi } from 'vitest' -import { createTestStore } from '../../testing/app-store-test-fixture' - -// Directly test paneKey reuse: minted IDs make ordinary collisions rare, but stale closed-pane acks must never suppress a future unvisited signal. - -describe('acknowledgedAgentsByPaneKey cleanup on teardown', () => { - afterEach(() => { - vi.useRealTimers() - }) - - it('removeAgentStatusByTabPrefix drops every ack entry whose paneKey starts with the tab prefix', () => { - vi.useFakeTimers() - const store = createTestStore() - store - .getState() - .setAgentStatus('tab-1:0', { state: 'working', prompt: 'p', agentType: 'claude' }) - store - .getState() - .setAgentStatus('tab-1:1', { state: 'working', prompt: 'p', agentType: 'claude' }) - store - .getState() - .setAgentStatus('tab-10:0', { state: 'working', prompt: 'p', agentType: 'claude' }) - store.getState().acknowledgeAgents(['tab-1:0', 'tab-1:1', 'tab-10:0']) - store.setState({ - activityClearedAtByPaneKey: { 'tab-1:0': 100, 'tab-10:0': 300 }, - manuallyUnreadTurnsByPaneKey: { 'tab-1:1': 200, 'tab-10:0': 400 } - }) - - store.getState().removeAgentStatusByTabPrefix('tab-1') - - const ack = store.getState().acknowledgedAgentsByPaneKey - expect(ack['tab-1:0']).toBeUndefined() - expect(ack['tab-1:1']).toBeUndefined() - // Delimiter prevents tab-1 prefixes matching tab-10. - expect(ack['tab-10:0']).toBeGreaterThan(0) - expect(store.getState().activityClearedAtByPaneKey).toEqual({ 'tab-10:0': 300 }) - expect(store.getState().manuallyUnreadTurnsByPaneKey).toEqual({ 'tab-10:0': 400 }) - }) - - it('removeAgentStatus leaves read state alone for a retained-only pane (unverified SSH exit)', () => { - vi.useFakeTimers() - const store = createTestStore() - // Unconditional PTY exit may be unverified SSH loss; preserve retained read state so reconnect does not rebold acked rows or replay cleared history. - store.getState().acknowledgeAgents(['tab-6:0']) - store.setState({ - activityClearedAtByPaneKey: { 'tab-6:0': 100 }, - manuallyUnreadTurnsByPaneKey: { 'tab-6:0': 200 } - }) - const epochBefore = store.getState().agentStatusEpoch - - store.getState().removeAgentStatus('tab-6:0') - - expect(store.getState().acknowledgedAgentsByPaneKey['tab-6:0']).toBeGreaterThan(0) - expect(store.getState().activityClearedAtByPaneKey['tab-6:0']).toBe(100) - expect(store.getState().manuallyUnreadTurnsByPaneKey['tab-6:0']).toBe(200) - expect(store.getState().agentStatusEpoch).toBe(epochBefore) - }) -}) diff --git a/src/renderer/src/store/slices/editor/buffers/editor-buffer-reconcile-joins.test.ts b/src/renderer/src/store/slices/editor/buffers/editor-buffer-reconcile-joins.test.ts deleted file mode 100644 index c7dce739055..00000000000 --- a/src/renderer/src/store/slices/editor/buffers/editor-buffer-reconcile-joins.test.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { beforeEach, expect, it } from 'vitest' -import { useAppStore } from '@/store' -import { assertEditorBufferInvariant } from './editor-buffer-record-lifecycle' -import { makeWorktree } from '../../worktrees/worktree.test-fixture' -import type { OpenFile } from '../types/open-file' - -function tab(id: string, patch: Partial = {}): OpenFile { - return { - id, - filePath: '/repo/a.ts', - relativePath: 'a.ts', - worktreeId: 'wt-1', - language: 'typescript', - isDirty: false, - mode: 'edit', - lastKnownDiskSignature: 'sig', - ...patch - } -} - -const view = (id: string) => useAppStore.getState().openFiles.find((file) => file.id === id) - -beforeEach(() => { - useAppStore.setState(useAppStore.getInitialState(), true) - useAppStore.setState({ - worktreesByRepo: { - 'repo-1': [makeWorktree({ id: 'wt-1', repoId: 'repo-1', path: '/repo', hostId: 'local' })] - } - }) -}) - -it('a view with an identical draft merges and mirrors the record as dirty', () => { - useAppStore.setState({ - openFiles: [tab('a', { isDirty: true })], - editorDrafts: { a: 'same edits' } - }) - // The joining view holds the same draft but its own flag reads clean. - useAppStore.setState((s) => ({ - openFiles: [...s.openFiles, tab('b')], - editorDrafts: { ...s.editorDrafts, b: 'same edits' } - })) - - const state = useAppStore.getState() - expect(state.editorBufferIdOf.b).toBe(state.editorBufferIdOf.a) - expect(view('b')?.isDirty).toBe(true) - expect(() => assertEditorBufferInvariant(state)).not.toThrow() -}) - -it('a clean view that saw the file deleted keeps the deleted banner on every view when it joins', () => { - useAppStore.setState({ openFiles: [tab('a')] }) - useAppStore.setState((s) => ({ - openFiles: [...s.openFiles, tab('b', { externalMutation: 'deleted' })] - })) - - const state = useAppStore.getState() - expect(state.editorBufferIdOf.b).toBe(state.editorBufferIdOf.a) - expect(view('a')?.externalMutation).toBe('deleted') - expect(view('b')?.externalMutation).toBe('deleted') -})