diff --git a/config/flaky-test-pattern-baseline.txt b/config/flaky-test-pattern-baseline.txt index c3d615157ed..f1521605603 100644 --- a/config/flaky-test-pattern-baseline.txt +++ b/config/flaky-test-pattern-baseline.txt @@ -530,7 +530,6 @@ 3 test-no-wall-clock:src/renderer/src/components/activity/activity-auto-mark-read-loop.react185.test.tsx 2 test-no-wall-clock:src/renderer/src/components/artifacts/ArtifactCollection.test.tsx 1 test-no-wall-clock:src/renderer/src/components/browser-pane/assemble-chrome/browser-workspace-pane.adoption-chrome.test.tsx -3 test-no-wall-clock:src/renderer/src/components/native-chat/conversation/turns/NativeChatResolvedView.turn-status.test.tsx 2 test-no-wall-clock:src/renderer/src/components/native-chat/tools/tasks/NativeChatStructuredSessionStatus.test.tsx 1 test-no-wall-clock:src/renderer/src/components/sidebar/workspace-card/review/use-workspace-reference-details.test.tsx 1 test-no-wall-clock:src/renderer/src/components/sidebar/worktree-list/listing/WorktreeList.lineage-agent-expansion-coupling.test.tsx diff --git a/config/reliability-gates.jsonc b/config/reliability-gates.jsonc index 300f51e506d..14e8b371ddb 100644 --- a/config/reliability-gates.jsonc +++ b/config/reliability-gates.jsonc @@ -454,22 +454,19 @@ "providers": ["local", "daemon", "ssh", "wsl", "remote-runtime", "mobile-relay"], "coveredPlatforms": ["macos"], "coveredProviders": [], - "coverageNotes": "Audits3764/3766 retire16 authored/27 expanded mobile cases, including entire HTML-image syntax, Mermaid routing, table styles, file-query encoding, workspace naming and fresh-Git-status adapter suites. Accepted losses include image width/icon filtering, partial-heading streaming, mocked Mermaid key/identity checks, generated table widths/counts, selected-text caret placement, tiny Base64 chunk encoding, twelve query-path roundtrips, locale-import fallback, apostrophe slugging, fresh-status fallback and an intermediate reviewed marker. These are deliberate removals for marginal value; remaining tests are not equivalent replacements. Earlier receipts are historical and do not validate these deleted/reduced drivers. Audit3748 intentionally removes ten authored/ten finite registrations from the surviving media-handle-registry.test.ts driver selected by this full-mobile command. Retired real alarms: nominal minted handle uniqueness/metadata and dimensions; ordinary range/EOF/overread/empty-file/direct chunk-clamp samples; nominal successful release, expired-release false, exact millisecond TTL boundary and ordinary releaseAll replay. Deterministic registry code runs; these examples are removed on marginal value without replacement or fresh execution claims. Seven owner cases retain cap refusal/disposal and sweep-before-admission, nonempty EOF and unknown/released/expired refusal, read TTL refresh, idempotent explicit release and continuation after discard failure. Existing commands, assertions, unrelated wire receipt and timing remain; the driver survives. Audits3738/3742/3743/3744 intentionally remove15 authored/21 finite registrations from six surviving drivers, with no equivalent replacement or fresh execution claim. This gate retains an unfiltered mobile Vitest command. Its mobile/src include patterns admit the partial live-input-commit and native-media drivers:5 authored/5 finite removals. Accepted losses: two Android-labeled replay samples after mocked composition conversion, an immediate Backspace absence check that does not wait for pending commit or prove local edit, and released-handle/double-release adapter examples. Real hook, registry and adapter logic run; no equivalent replacement or native Android/iOS exercise is claimed. Both drivers and selector stay. The unchanged wire-specific dated receipt does not validate these reduced mobile sources. Audit3666 removes30 authored/36 finite mobile cases, including7 whole drivers. It retires direct consent/channel/token/header-payload/fingerprint/route-object inventories, background legacy-dismissal filtering, the two-row520-entry watermark retention workload, reentrant write-batch example, font-before-ready projection, and legacy-segmenter/scrollback/wrap selection examples. Actual policy, parsing, hashing, tray matching, serialization and xterm buffers execute in these tests; their stated alarms are deliberately lost without replacement. Twelve unchanged authored/19 finite cases retain compact browser geometry regressions, an independent fingerprint-to-host protocol vector, serialized watermark/reload isolation, OSC52 live/replay gating, queue boundaries/reset/generation, disposed font completion and Unicode cell mapping. Pairing classification2/2 was already approved by3657 and receives no3666 delta or credit. Static review only; no runtime, native, provider, browser rendering, OS, remote, mobile/folder parity or new historical fault evidence. Previous account (preserved verbatim): Audit3663 removes the complete mobile scan-error message suite (two authored/two finite callbacks). Its4URL assertion loop is one registration. Accept loss of Orca new/legacy Android-download URL classification and other-page invalid-code translated-key mapping. Real URL parsing/classification runs, but the only output observed is an identity-translator key. No camera scan, pairing offer admission, connection or device/UI action is exercised. No equivalent replacement or physical/mobile/mixed-version result claimed. Preserve all historical evidence and metadata bytes. Audit3460 final-v2 composes accepted AUTHOR3454/PEER3455 on actual post263 main: intentionally removes99 authored/106 potential expanded cases across16 selected drivers, including7 whole suites, retaining24 authored/26 potential cases. No equivalent replacement or fresh runtime is claimed. The broad mobile runner loses retired-name sequencing and PR action samples while retaining the editor-lifetime and original PR action keeper; commit-message generation is unchanged. Audit3456 composes ROOT-adopted3449/independent3450: intentionally removes62 authored/82 potential expanded cases from16 selected drivers, including7 whole suites, while13 authored/13 potential cases remain. Delete the unused48line legacy workspace-session JSON fixture with zero test credit. These are source-only reductions without equivalent replacement or fresh runtime claims. The broad mobile command loses the entire three-case mocked diff-review controller suite and the stale layout-sequence comparator sample. Keep only the direct layout-versus-scrollback counter distinction; the unchanged dictation retry hook retains complete recording replay. No rendered app, native capture, actual process death or remote execution is claimed. Audit3451 composes ROOT-adopted3444/independent3445: intentionally removes101 authored registrations across16 reviewed sources, deleting7 whole suites and reducing8; one reviewed source is unchanged. Fresh main has123 authored registrations before and22 after because an upstream direct-child shell regression remains verbatim with zero removal credit. Registered removals are100+7*S and explicit-active removals99+7*S, where S is the unprobed count0..3 of admitted bash/zsh/fish shells. No equivalent replacement or fresh execution is claimed. Broad mobile discovery loses whole prompt-presentation, Jira-URL and folder-source-repository suites. The prompt suite exercised presentation projections; it did not provide native mobile prompt acknowledgment acceptance. Existing direct prompt-controller selectors are unchanged. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. The stale-leaf-liveness suite and its exact command/testFiles selector are removed; its fake terminal refusal/liveness alarms are intentionally lost. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The entire mocked mobile failure-banner suite and its sole send/previous-banner/new-notice ordering alarm are retired. Its filenames are removed from active selectors. Desktop prompt roots and the independent unchanged terminal wire-codec receipt remain at their stated scopes; no mobile send/recovery proof is claimed. Audit2251 narrows agent-paste-draft.test.ts from 25 authored cases (26 literal cases) to four. Retained cases cover buffered readiness on PTY binding, separate spawn/composer lifetimes, real per-PTY paste/Enter serialization against a competing paste, and frame closure/no Enter after a rejected content chunk. Intentionally lost alarms include agent marker and fallback examples, direct-write failure/rejection, missing-PTY and Codex process-only timeout paths, exact nonprimary-PTY routing, full large-body chunk reconstruction, escaping/CRLF samples, internal laziness/yield work assertions, oversized preflight refusal, and exact configured delay/budget counts. No equivalent replacement, new execution, real PTY/provider delivery, rendered/native UI, deployment, measured performance or cross-platform result is claimed. Historical prior account (preserved verbatim): Mobile owner-layout policy retires whole tests and mixed registrations without equivalent replacement coverage. Retained callbacks and reduced selectors need fresh execution at their stated scope; prior measurements do not validate them. Affected sources: mobile/src/session/mobile-prompt-controller.test.ts, tests/e2e/native-chat-ssh-delivery.unit.test.ts, mobile/src/session/native-chat/use-mobile-native-chat-controller.test.ts, mobile/src/session/native-chat/input/use-mobile-native-chat-cancel-ask.test.ts, mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.test.ts, mobile/src/session/native-chat/transcript/use-mobile-native-chat-message-send.test.ts. Historical scope: Audit2003: Remove agent-prompt absence routing, throwing/live/missing-probe and cached-probe-count examples from the stale-leaf source. Controller-proven absence, unknown-liveness admission, obsolete-absence clearing and same-ID respawn fences remain at a supplied provider/row seam. Preserve the independent wire-codec receipt only in its original scope. 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): Audit1991: Remove partial-runtime terminal-send guard/status/floor/query projection and argument-inventory samples. Retained RPC viewport admission, authenticated-client spoof refusal, text admission and stale-binding fences remain bounded mock-boundary behavior. The unchanged wire-codec receipt remains valid only for its original command; it does not validate this reduced RPC selector. 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): Audit1908 removes the complete prompt-presentation hook and literal interactive-protocol mapping suites and narrows the interactive card and prompt-card input suites. Lost alarms include replacement approval A settling after answered B; collapse/expand composer ownership and partial-answer presentation; identical new waits after an unmounted view; collapsed transcript re-reads; answered/dismissed status-backed persistence and retirement; and literal answer-to-PTY byte arrays. The retained stale-PTY acknowledgment, cancellation/answer retry, and answered-approval remount/rebind assertions remain meaningful but are not equivalent replacement coverage. No fresh reduced-selector result, physical provider, rendered/native-focus, mixed-version deployment, soak, or measured-budget validation is claimed. The unchanged wire-codec receipt remains valid only for its exact command. Historical prior account (preserved verbatim): 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: Audit1471 removes the entire interactive-send hook suite. Its mock-writer routing, cancellation-handle, option-digit, interrupt, supplied settlement and inference-argument alarms are retired. No actual PTY bytes, replacement question lifetime or agent delivery were exercised. No equivalent replacement or fresh execution of the reduced reliability selector is claimed; historical receipts retain their original scope. Audit1468 removes the entire runtime-send suite. Its mock PTY clear/body/Enter byte-order, nominal timing, queue cancellation/serialization, attachment escaping, key-group pacing and deferred acceptance callback alarms are intentionally retired. No actual receiving agent or physical terminal delivery was exercised. No equivalent replacement or fresh execution of the reduced reliability selector is claimed; historical receipts retain their original scope. Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Audit1417 intentionally reduces src/renderer/src/lib/agent-paste-draft-submit-retry.test.ts: Loses configured retry gap and single-Enter agent selection alarms alongside forbidden timer-count checks. No equivalent replacement coverage or fresh result is claimed. Historical coverage account: Audit1383 changes referenced sources; no new execution result validates reduced selectors. Retained unchanged receipts apply only to unchanged commands. Historical coverage: Audits1340 and1348 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): Audit1316 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): Production mobile controller, parser, presentation, overlay, view, question, permission and composer run with native surfaces mocked on macOS. Desktop selector groups traverse the real observed-write queue, verified helper, IPC chunker, SSH provider and transport callbacks; paired sends traverse the real dispatcher and runtime writer into that provider. Local/daemon contracts and released-version terminal codecs are covered. Provider labels describe contracts, not physical deployments; physical WSL/Linux/Windows remain gaps. Audit885 removes the isolated observed-send mock-call suite; no replacement-equivalence claim is made. Audit1107 removes the small healthy ordinary SSH-send byte/callback sample. Its exact clear/body/Enter sample alarm is lost; retained slow-answer, cancellation and simulated older-host sequence checks are not claimed as equivalent replacement coverage. The SSH delivery fixture uses controlled fake provider settlement, and its paired path uses the real runtime/dispatcher without a physical SSH or paired wire transport. Audit1278 removes the mobile Stop display/disabled/placeholder suite; its local Stop presentation, repeat-stop and dispatch-visibility alarms are intentionally lost. No equivalent replacement or runtime stopping proof is claimed. Audit1292: The blind OpenCode readiness warning and late launch success/failure content-plus-submit write samples are removed. Their mocked readiness/inspection/delivery alarms are lost; no real PTY delivery or equivalent replacement coverage is claimed. Audit1294 removes mobile/src/session/native-chat/input/mobile-native-chat-permission-send.test.ts. Its mock-only request/capability/private-state/copy alarms are intentionally lost. Remaining tests are not equivalent replacement coverage. Narrowed commands require fresh parent-owned validation; no new runtime, platform or physical mobile evidence is claimed. Audit1302: src/main/ipc/pty/ipc/write-input-acceptance.test.ts: Provider registry and write acceptance/refusal/unverifiable receipts are supplied by fixture; local/daemon/WSL/SSH labels use the same fake provider. Chunking/settlement/remount cases inspect delegated calls or canned receipts without actual provider acceptance/acknowledgement. Lose chunk/refusal/pending/remount and raw-pane routing alarms; no equivalent replacement. Reduced selectors require fresh validation; prior full-suite receipts do not validate removed or changed coverage. No equivalent replacement or physical-provider claim. Audit1303 intentionally removes supplied-state/mock-callback component and hook examples in mobile/src/session/native-chat/input/use-mobile-native-chat-ask-dismiss.test.ts, mobile/src/session/native-chat/input/MobileNativeChatPromptCard.test.tsx. Their exact retired alarms are not equivalent to retained coverage; no new runtime, physical phone or deployed mixed-version evidence is claimed. Audit1310 removes the supplied-geometry/direct-callback chat history-paging suite. Its prepend/scroll-position examples are intentionally lost; no real rendered anchoring, equivalent replacement or physical phone proof is claimed. Narrowed commands need fresh validation. Audit1315 removes/narrows mobile/src/session/native-chat/MobileNativeChatView.composer-lock.test.ts, mobile/src/session/native-chat/MobileNativeChatView.prompt-presentation.test.ts. Exact retired scenarios are intentionally lost; surviving assertions are limited to unchanged retained authored cases. No equivalent replacement, physical phone or deployed mixed-host claim. Fresh validation is required for narrowed commands. Audit1316: src/renderer/src/lib/agent-followup-delivery.test.ts removed. Interpreter wrapper/live child/shell readiness and final readiness recheck delivery mock samples lose alarms. No equivalent replacement coverage is claimed. Audit1322 removes/narrows mobile/src/session/native-chat/MobileNativeChatView.tail-follow.test.ts. Exact retired scenarios are intentionally lost; surviving assertions are limited to unchanged retained authored cases. No equivalent replacement, physical phone or deployed mixed-host claim. Fresh validation is required for narrowed commands. Audit1341 scope1334 removes/narrows mobile/src/session/native-chat/mobile-native-chat-send.test.ts, mobile/src/session/native-chat/transcript/use-mobile-native-chat-message-send.test.ts. Exact retired scenarios are intentionally lost; surviving assertions are limited to unchanged retained authored cases. No equivalent replacement, physical phone or deployed mixed-host claim. Fresh validation is required for narrowed commands. Audit1341 scope1335 removes/narrows mobile/src/session/native-chat/use-mobile-native-chat-controller.test.ts, mobile/src/session/mobile-prompt-controller.test.ts, mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.test.ts. Exact retired scenarios are intentionally lost; surviving assertions are limited to unchanged retained authored cases. No equivalent replacement, physical phone or deployed mixed-host claim. Fresh validation is required for narrowed commands. Audit1340: src/main/daemon/daemon-pty-write-settlement-recovery.test.ts removed. Ambiguous handoff settlement remains unverifiable when listener throws. No equivalent replacement coverage is claimed. Audit1348: src/main/ipc/pty/ipc/write-input-chunk-yield.test.ts removed. Check-phase yielding and no-yield single-chunk scheduling work. No equivalent replacement coverage is claimed. Audit1352: focused Linux unit selections validated on source head b638e07d395b76af3ba6b03761a1a0fe7e5e026e. Historical statements above retain their original scope. Intentional test losses are recorded in knownGaps; these runs claim no physical-provider, p95, rendered E2E or cross-platform validation. Audit1360: focused Linux unit selections validated on source head 415c9cffc2d10024131ec4b6721767a22195de6d. Historical statements above retain their original scope. Intentional test losses are recorded in knownGaps; these runs claim no physical-provider, p95, rendered E2E or cross-platform validation. Audit1383: src/main/ipc/pty/ipc/write-input-user-input.test.ts reduced. Lose admission provenance spy, direct local Escape write outcome matrix and separate client-side SSH no-evidence control. Provider writes mocked; retained tests protect observation order/facts only. No equivalent replacement coverage is claimed. Audit1401: src/main/ipc/pty/ipc/write-input-user-input.test.ts reduced. Loses local-only post-accept observation and refused/unverifiable settlement delivery alarms. 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. Audit1402: src/renderer/src/components/native-chat/native-chat-runtime-send-launch-draft.test.ts removed. Intentionally loses clear-confirmation/body/submit and maximal-clear ordering, queued text/image send ordering, ordinary cursor-spanning draft replacement and oversized refusal/queue settlement alarms. No equivalent replacement or real terminal delivery claim. 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. Audit1426 removes NativeChatComposer.test.tsx. Local pane-remount, draft/cancel/confirmation sequencing and manual IME callback alarms are lost. No equivalent replacement coverage or provider delivery is claimed; historical receipts retain their original scope and the reduced selector has no new execution result. Audit2450 removes the MobileNativeChatView failure-banner callback-only example whose old banner is supplied unchanged by its props. Retain fatal-read gating and the ordering test that preserves a new delivery notice. The removed false-send/old-banner combination has no equivalent replacement; prior raw receipts and budgets retain their original source scope. No new soak, platform, performance or red/green claim.", + "coverageNotes": "Audit3984 retires all four remaining viewport-fixture suites (14 authored/15 finite cases) and the fixture after composing the sender-host deletion. Accepted source-alarm losses include live-region/disclosure continuity, task/question/approval history and revision handling, stale turn status, prompt-dismissal remount/rebind, and pending-send cancellation when approval arrives between body and Enter. No equivalent replacement or fresh runtime validation is claimed. Audits3764/3766 retire16 authored/27 expanded mobile cases, including entire HTML-image syntax, Mermaid routing, table styles, file-query encoding, workspace naming and fresh-Git-status adapter suites. Accepted losses include image width/icon filtering, partial-heading streaming, mocked Mermaid key/identity checks, generated table widths/counts, selected-text caret placement, tiny Base64 chunk encoding, twelve query-path roundtrips, locale-import fallback, apostrophe slugging, fresh-status fallback and an intermediate reviewed marker. These are deliberate removals for marginal value; remaining tests are not equivalent replacements. Earlier receipts are historical and do not validate these deleted/reduced drivers. Audit3748 intentionally removes ten authored/ten finite registrations from the surviving media-handle-registry.test.ts driver selected by this full-mobile command. Retired real alarms: nominal minted handle uniqueness/metadata and dimensions; ordinary range/EOF/overread/empty-file/direct chunk-clamp samples; nominal successful release, expired-release false, exact millisecond TTL boundary and ordinary releaseAll replay. Deterministic registry code runs; these examples are removed on marginal value without replacement or fresh execution claims. Seven owner cases retain cap refusal/disposal and sweep-before-admission, nonempty EOF and unknown/released/expired refusal, read TTL refresh, idempotent explicit release and continuation after discard failure. Existing commands, assertions, unrelated wire receipt and timing remain; the driver survives. Audits3738/3742/3743/3744 intentionally remove15 authored/21 finite registrations from six surviving drivers, with no equivalent replacement or fresh execution claim. This gate retains an unfiltered mobile Vitest command. Its mobile/src include patterns admit the partial live-input-commit and native-media drivers:5 authored/5 finite removals. Accepted losses: two Android-labeled replay samples after mocked composition conversion, an immediate Backspace absence check that does not wait for pending commit or prove local edit, and released-handle/double-release adapter examples. Real hook, registry and adapter logic run; no equivalent replacement or native Android/iOS exercise is claimed. Both drivers and selector stay. The unchanged wire-specific dated receipt does not validate these reduced mobile sources. Audit3666 removes30 authored/36 finite mobile cases, including7 whole drivers. It retires direct consent/channel/token/header-payload/fingerprint/route-object inventories, background legacy-dismissal filtering, the two-row520-entry watermark retention workload, reentrant write-batch example, font-before-ready projection, and legacy-segmenter/scrollback/wrap selection examples. Actual policy, parsing, hashing, tray matching, serialization and xterm buffers execute in these tests; their stated alarms are deliberately lost without replacement. Twelve unchanged authored/19 finite cases retain compact browser geometry regressions, an independent fingerprint-to-host protocol vector, serialized watermark/reload isolation, OSC52 live/replay gating, queue boundaries/reset/generation, disposed font completion and Unicode cell mapping. Pairing classification2/2 was already approved by3657 and receives no3666 delta or credit. Static review only; no runtime, native, provider, browser rendering, OS, remote, mobile/folder parity or new historical fault evidence. Previous account (preserved verbatim): Audit3663 removes the complete mobile scan-error message suite (two authored/two finite callbacks). Its4URL assertion loop is one registration. Accept loss of Orca new/legacy Android-download URL classification and other-page invalid-code translated-key mapping. Real URL parsing/classification runs, but the only output observed is an identity-translator key. No camera scan, pairing offer admission, connection or device/UI action is exercised. No equivalent replacement or physical/mobile/mixed-version result claimed. Preserve all historical evidence and metadata bytes. Audit3460 final-v2 composes accepted AUTHOR3454/PEER3455 on actual post263 main: intentionally removes99 authored/106 potential expanded cases across16 selected drivers, including7 whole suites, retaining24 authored/26 potential cases. No equivalent replacement or fresh runtime is claimed. The broad mobile runner loses retired-name sequencing and PR action samples while retaining the editor-lifetime and original PR action keeper; commit-message generation is unchanged. Audit3456 composes ROOT-adopted3449/independent3450: intentionally removes62 authored/82 potential expanded cases from16 selected drivers, including7 whole suites, while13 authored/13 potential cases remain. Delete the unused48line legacy workspace-session JSON fixture with zero test credit. These are source-only reductions without equivalent replacement or fresh runtime claims. The broad mobile command loses the entire three-case mocked diff-review controller suite and the stale layout-sequence comparator sample. Keep only the direct layout-versus-scrollback counter distinction; the unchanged dictation retry hook retains complete recording replay. No rendered app, native capture, actual process death or remote execution is claimed. Audit3451 composes ROOT-adopted3444/independent3445: intentionally removes101 authored registrations across16 reviewed sources, deleting7 whole suites and reducing8; one reviewed source is unchanged. Fresh main has123 authored registrations before and22 after because an upstream direct-child shell regression remains verbatim with zero removal credit. Registered removals are100+7*S and explicit-active removals99+7*S, where S is the unprobed count0..3 of admitted bash/zsh/fish shells. No equivalent replacement or fresh execution is claimed. Broad mobile discovery loses whole prompt-presentation, Jira-URL and folder-source-repository suites. The prompt suite exercised presentation projections; it did not provide native mobile prompt acknowledgment acceptance. Existing direct prompt-controller selectors are unchanged. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. The stale-leaf-liveness suite and its exact command/testFiles selector are removed; its fake terminal refusal/liveness alarms are intentionally lost. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The entire mocked mobile failure-banner suite and its sole send/previous-banner/new-notice ordering alarm are retired. Its filenames are removed from active selectors. Desktop prompt roots and the independent unchanged terminal wire-codec receipt remain at their stated scopes; no mobile send/recovery proof is claimed. Audit2251 narrows agent-paste-draft.test.ts from 25 authored cases (26 literal cases) to four. Retained cases cover buffered readiness on PTY binding, separate spawn/composer lifetimes, real per-PTY paste/Enter serialization against a competing paste, and frame closure/no Enter after a rejected content chunk. Intentionally lost alarms include agent marker and fallback examples, direct-write failure/rejection, missing-PTY and Codex process-only timeout paths, exact nonprimary-PTY routing, full large-body chunk reconstruction, escaping/CRLF samples, internal laziness/yield work assertions, oversized preflight refusal, and exact configured delay/budget counts. No equivalent replacement, new execution, real PTY/provider delivery, rendered/native UI, deployment, measured performance or cross-platform result is claimed. Historical prior account (preserved verbatim): Mobile owner-layout policy retires whole tests and mixed registrations without equivalent replacement coverage. Retained callbacks and reduced selectors need fresh execution at their stated scope; prior measurements do not validate them. Affected sources: mobile/src/session/mobile-prompt-controller.test.ts, tests/e2e/native-chat-ssh-delivery.unit.test.ts, mobile/src/session/native-chat/use-mobile-native-chat-controller.test.ts, mobile/src/session/native-chat/input/use-mobile-native-chat-cancel-ask.test.ts, mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.test.ts, mobile/src/session/native-chat/transcript/use-mobile-native-chat-message-send.test.ts. Historical scope: Audit2003: Remove agent-prompt absence routing, throwing/live/missing-probe and cached-probe-count examples from the stale-leaf source. Controller-proven absence, unknown-liveness admission, obsolete-absence clearing and same-ID respawn fences remain at a supplied provider/row seam. Preserve the independent wire-codec receipt only in its original scope. 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): Audit1991: Remove partial-runtime terminal-send guard/status/floor/query projection and argument-inventory samples. Retained RPC viewport admission, authenticated-client spoof refusal, text admission and stale-binding fences remain bounded mock-boundary behavior. The unchanged wire-codec receipt remains valid only for its original command; it does not validate this reduced RPC selector. 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): Audit1908 removes the complete prompt-presentation hook and literal interactive-protocol mapping suites and narrows the interactive card and prompt-card input suites. Lost alarms include replacement approval A settling after answered B; collapse/expand composer ownership and partial-answer presentation; identical new waits after an unmounted view; collapsed transcript re-reads; answered/dismissed status-backed persistence and retirement; and literal answer-to-PTY byte arrays. The retained stale-PTY acknowledgment, cancellation/answer retry, and answered-approval remount/rebind assertions remain meaningful but are not equivalent replacement coverage. No fresh reduced-selector result, physical provider, rendered/native-focus, mixed-version deployment, soak, or measured-budget validation is claimed. The unchanged wire-codec receipt remains valid only for its exact command. Historical prior account (preserved verbatim): 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: Audit1471 removes the entire interactive-send hook suite. Its mock-writer routing, cancellation-handle, option-digit, interrupt, supplied settlement and inference-argument alarms are retired. No actual PTY bytes, replacement question lifetime or agent delivery were exercised. No equivalent replacement or fresh execution of the reduced reliability selector is claimed; historical receipts retain their original scope. Audit1468 removes the entire runtime-send suite. Its mock PTY clear/body/Enter byte-order, nominal timing, queue cancellation/serialization, attachment escaping, key-group pacing and deferred acceptance callback alarms are intentionally retired. No actual receiving agent or physical terminal delivery was exercised. No equivalent replacement or fresh execution of the reduced reliability selector is claimed; historical receipts retain their original scope. Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Audit1417 intentionally reduces src/renderer/src/lib/agent-paste-draft-submit-retry.test.ts: Loses configured retry gap and single-Enter agent selection alarms alongside forbidden timer-count checks. No equivalent replacement coverage or fresh result is claimed. Historical coverage account: Audit1383 changes referenced sources; no new execution result validates reduced selectors. Retained unchanged receipts apply only to unchanged commands. Historical coverage: Audits1340 and1348 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): Audit1316 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): Production mobile controller, parser, presentation, overlay, view, question, permission and composer run with native surfaces mocked on macOS. Desktop selector groups traverse the real observed-write queue, verified helper, IPC chunker, SSH provider and transport callbacks; paired sends traverse the real dispatcher and runtime writer into that provider. Local/daemon contracts and released-version terminal codecs are covered. Provider labels describe contracts, not physical deployments; physical WSL/Linux/Windows remain gaps. Audit885 removes the isolated observed-send mock-call suite; no replacement-equivalence claim is made. Audit1107 removes the small healthy ordinary SSH-send byte/callback sample. Its exact clear/body/Enter sample alarm is lost; retained slow-answer, cancellation and simulated older-host sequence checks are not claimed as equivalent replacement coverage. The SSH delivery fixture uses controlled fake provider settlement, and its paired path uses the real runtime/dispatcher without a physical SSH or paired wire transport. Audit1278 removes the mobile Stop display/disabled/placeholder suite; its local Stop presentation, repeat-stop and dispatch-visibility alarms are intentionally lost. No equivalent replacement or runtime stopping proof is claimed. Audit1292: The blind OpenCode readiness warning and late launch success/failure content-plus-submit write samples are removed. Their mocked readiness/inspection/delivery alarms are lost; no real PTY delivery or equivalent replacement coverage is claimed. Audit1294 removes mobile/src/session/native-chat/input/mobile-native-chat-permission-send.test.ts. Its mock-only request/capability/private-state/copy alarms are intentionally lost. Remaining tests are not equivalent replacement coverage. Narrowed commands require fresh parent-owned validation; no new runtime, platform or physical mobile evidence is claimed. Audit1302: src/main/ipc/pty/ipc/write-input-acceptance.test.ts: Provider registry and write acceptance/refusal/unverifiable receipts are supplied by fixture; local/daemon/WSL/SSH labels use the same fake provider. Chunking/settlement/remount cases inspect delegated calls or canned receipts without actual provider acceptance/acknowledgement. Lose chunk/refusal/pending/remount and raw-pane routing alarms; no equivalent replacement. Reduced selectors require fresh validation; prior full-suite receipts do not validate removed or changed coverage. No equivalent replacement or physical-provider claim. Audit1303 intentionally removes supplied-state/mock-callback component and hook examples in mobile/src/session/native-chat/input/use-mobile-native-chat-ask-dismiss.test.ts, mobile/src/session/native-chat/input/MobileNativeChatPromptCard.test.tsx. Their exact retired alarms are not equivalent to retained coverage; no new runtime, physical phone or deployed mixed-version evidence is claimed. Audit1310 removes the supplied-geometry/direct-callback chat history-paging suite. Its prepend/scroll-position examples are intentionally lost; no real rendered anchoring, equivalent replacement or physical phone proof is claimed. Narrowed commands need fresh validation. Audit1315 removes/narrows mobile/src/session/native-chat/MobileNativeChatView.composer-lock.test.ts, mobile/src/session/native-chat/MobileNativeChatView.prompt-presentation.test.ts. Exact retired scenarios are intentionally lost; surviving assertions are limited to unchanged retained authored cases. No equivalent replacement, physical phone or deployed mixed-host claim. Fresh validation is required for narrowed commands. Audit1316: src/renderer/src/lib/agent-followup-delivery.test.ts removed. Interpreter wrapper/live child/shell readiness and final readiness recheck delivery mock samples lose alarms. No equivalent replacement coverage is claimed. Audit1322 removes/narrows mobile/src/session/native-chat/MobileNativeChatView.tail-follow.test.ts. Exact retired scenarios are intentionally lost; surviving assertions are limited to unchanged retained authored cases. No equivalent replacement, physical phone or deployed mixed-host claim. Fresh validation is required for narrowed commands. Audit1341 scope1334 removes/narrows mobile/src/session/native-chat/mobile-native-chat-send.test.ts, mobile/src/session/native-chat/transcript/use-mobile-native-chat-message-send.test.ts. Exact retired scenarios are intentionally lost; surviving assertions are limited to unchanged retained authored cases. No equivalent replacement, physical phone or deployed mixed-host claim. Fresh validation is required for narrowed commands. Audit1341 scope1335 removes/narrows mobile/src/session/native-chat/use-mobile-native-chat-controller.test.ts, mobile/src/session/mobile-prompt-controller.test.ts, mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.test.ts. Exact retired scenarios are intentionally lost; surviving assertions are limited to unchanged retained authored cases. No equivalent replacement, physical phone or deployed mixed-host claim. Fresh validation is required for narrowed commands. Audit1340: src/main/daemon/daemon-pty-write-settlement-recovery.test.ts removed. Ambiguous handoff settlement remains unverifiable when listener throws. No equivalent replacement coverage is claimed. Audit1348: src/main/ipc/pty/ipc/write-input-chunk-yield.test.ts removed. Check-phase yielding and no-yield single-chunk scheduling work. No equivalent replacement coverage is claimed. Audit1352: focused Linux unit selections validated on source head b638e07d395b76af3ba6b03761a1a0fe7e5e026e. Historical statements above retain their original scope. Intentional test losses are recorded in knownGaps; these runs claim no physical-provider, p95, rendered E2E or cross-platform validation. Audit1360: focused Linux unit selections validated on source head 415c9cffc2d10024131ec4b6721767a22195de6d. Historical statements above retain their original scope. Intentional test losses are recorded in knownGaps; these runs claim no physical-provider, p95, rendered E2E or cross-platform validation. Audit1383: src/main/ipc/pty/ipc/write-input-user-input.test.ts reduced. Lose admission provenance spy, direct local Escape write outcome matrix and separate client-side SSH no-evidence control. Provider writes mocked; retained tests protect observation order/facts only. No equivalent replacement coverage is claimed. Audit1401: src/main/ipc/pty/ipc/write-input-user-input.test.ts reduced. Loses local-only post-accept observation and refused/unverifiable settlement delivery alarms. 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. Audit1402: src/renderer/src/components/native-chat/native-chat-runtime-send-launch-draft.test.ts removed. Intentionally loses clear-confirmation/body/submit and maximal-clear ordering, queued text/image send ordering, ordinary cursor-spanning draft replacement and oversized refusal/queue settlement alarms. No equivalent replacement or real terminal delivery claim. 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. Audit1426 removes NativeChatComposer.test.tsx. Local pane-remount, draft/cancel/confirmation sequencing and manual IME callback alarms are lost. No equivalent replacement coverage or provider delivery is claimed; historical receipts retain their original scope and the reduced selector has no new execution result. Audit2450 removes the MobileNativeChatView failure-banner callback-only example whose old banner is supplied unchanged by its props. Retain fatal-read gating and the ordering test that preserves a new delivery notice. The removed false-send/old-banner combination has no equivalent replacement; prior raw receipts and budgets retain their original source scope. No new soak, platform, performance or red/green claim.", "motivatingLinks": ["https://github.com/stablyai/orca/pull/25761"], "invariant": "A prompt occurrence leaves the input region only when an accepted reply answers it (a current host's provider acknowledgment, or an older host's whole-write acceptance as before) or the user collapses it to a strip above the composer, which writes nothing and keeps the card mounted with its partial answer; status-backed occurrences are told apart by the host wait's start, so view toggles and remounts preserve them while real clear/replacement supersedes them, and a transcript-only one is dropped when the view stops observing it; obsolete results cannot change replacements; selector groups wait for complete writes before pacing; refusal or unknown handoff never causes replay; a card retires an unsubmitted composer send without writing under it or losing its text, and the hidden composer cannot send or interrupt; Collapse or Escape folds a card without writing, never during an in-flight answer, and a new occurrence shows expanded again; the phone blocks only Send while a card is expanded and shows one card per occurrence; cancellation stops unsent groups and active dictation can stop.", "oracle": "Audits3764/3766 retire16 authored/27 expanded mobile cases, including entire HTML-image syntax, Mermaid routing, table styles, file-query encoding, workspace naming and fresh-Git-status adapter suites. Accepted losses include image width/icon filtering, partial-heading streaming, mocked Mermaid key/identity checks, generated table widths/counts, selected-text caret placement, tiny Base64 chunk encoding, twelve query-path roundtrips, locale-import fallback, apostrophe slugging, fresh-status fallback and an intermediate reviewed marker. These are deliberate removals for marginal value; remaining tests are not equivalent replacements. Earlier receipts are historical and do not validate these deleted/reduced drivers. Audit3748 intentionally removes ten authored/ten finite registrations from the surviving media-handle-registry.test.ts driver selected by this full-mobile command. Retired real alarms: nominal minted handle uniqueness/metadata and dimensions; ordinary range/EOF/overread/empty-file/direct chunk-clamp samples; nominal successful release, expired-release false, exact millisecond TTL boundary and ordinary releaseAll replay. Deterministic registry code runs; these examples are removed on marginal value without replacement or fresh execution claims. Seven owner cases retain cap refusal/disposal and sweep-before-admission, nonempty EOF and unknown/released/expired refusal, read TTL refresh, idempotent explicit release and continuation after discard failure. Existing commands, assertions, unrelated wire receipt and timing remain; the driver survives. Audits3738/3742/3743/3744 intentionally remove15 authored/21 finite registrations from six surviving drivers, with no equivalent replacement or fresh execution claim. This gate retains an unfiltered mobile Vitest command. Its mobile/src include patterns admit the partial live-input-commit and native-media drivers:5 authored/5 finite removals. Accepted losses: two Android-labeled replay samples after mocked composition conversion, an immediate Backspace absence check that does not wait for pending commit or prove local edit, and released-handle/double-release adapter examples. Real hook, registry and adapter logic run; no equivalent replacement or native Android/iOS exercise is claimed. Both drivers and selector stay. The unchanged wire-specific dated receipt does not validate these reduced mobile sources. Audit3666 removes30 authored/36 finite mobile cases, including7 whole drivers. It retires direct consent/channel/token/header-payload/fingerprint/route-object inventories, background legacy-dismissal filtering, the two-row520-entry watermark retention workload, reentrant write-batch example, font-before-ready projection, and legacy-segmenter/scrollback/wrap selection examples. Actual policy, parsing, hashing, tray matching, serialization and xterm buffers execute in these tests; their stated alarms are deliberately lost without replacement. Twelve unchanged authored/19 finite cases retain compact browser geometry regressions, an independent fingerprint-to-host protocol vector, serialized watermark/reload isolation, OSC52 live/replay gating, queue boundaries/reset/generation, disposed font completion and Unicode cell mapping. Pairing classification2/2 was already approved by3657 and receives no3666 delta or credit. Static review only; no runtime, native, provider, browser rendering, OS, remote, mobile/folder parity or new historical fault evidence. Previous oracle (preserved verbatim): Audit3663 removes the complete mobile scan-error message suite (two authored/two finite callbacks). Its4URL assertion loop is one registration. Accept loss of Orca new/legacy Android-download URL classification and other-page invalid-code translated-key mapping. Real URL parsing/classification runs, but the only output observed is an identity-translator key. No camera scan, pairing offer admission, connection or device/UI action is exercised. No equivalent replacement or physical/mobile/mixed-version result claimed. Preserve all historical evidence and metadata bytes. Audit3460 final-v2 composes accepted AUTHOR3454/PEER3455 on actual post263 main: intentionally removes99 authored/106 potential expanded cases across16 selected drivers, including7 whole suites, retaining24 authored/26 potential cases. No equivalent replacement or fresh runtime is claimed. The broad mobile runner loses retired-name sequencing and PR action samples while retaining the editor-lifetime and original PR action keeper; commit-message generation is unchanged. Audit3456 composes ROOT-adopted3449/independent3450: intentionally removes62 authored/82 potential expanded cases from16 selected drivers, including7 whole suites, while13 authored/13 potential cases remain. Delete the unused48line legacy workspace-session JSON fixture with zero test credit. These are source-only reductions without equivalent replacement or fresh runtime claims. The broad mobile command loses the entire three-case mocked diff-review controller suite and the stale layout-sequence comparator sample. Keep only the direct layout-versus-scrollback counter distinction; the unchanged dictation retry hook retains complete recording replay. No rendered app, native capture, actual process death or remote execution is claimed. Audit3451 composes ROOT-adopted3444/independent3445: intentionally removes101 authored registrations across16 reviewed sources, deleting7 whole suites and reducing8; one reviewed source is unchanged. Fresh main has123 authored registrations before and22 after because an upstream direct-child shell regression remains verbatim with zero removal credit. Registered removals are100+7*S and explicit-active removals99+7*S, where S is the unprobed count0..3 of admitted bash/zsh/fish shells. No equivalent replacement or fresh execution is claimed. Broad mobile discovery loses whole prompt-presentation, Jira-URL and folder-source-repository suites. The prompt suite exercised presentation projections; it did not provide native mobile prompt acknowledgment acceptance. Existing direct prompt-controller selectors are unchanged. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. The stale-leaf-liveness suite and its exact command/testFiles selector are removed; its fake terminal refusal/liveness alarms are intentionally lost. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The entire mocked mobile failure-banner suite and its sole send/previous-banner/new-notice ordering alarm are retired. Its filenames are removed from active selectors. Desktop prompt roots and the independent unchanged terminal wire-codec receipt remain at their stated scopes; no mobile send/recovery proof is claimed. Audit2251 narrows agent-paste-draft.test.ts from 25 authored cases (26 literal cases) to four. Retained cases cover buffered readiness on PTY binding, separate spawn/composer lifetimes, real per-PTY paste/Enter serialization against a competing paste, and frame closure/no Enter after a rejected content chunk. Intentionally lost alarms include agent marker and fallback examples, direct-write failure/rejection, missing-PTY and Codex process-only timeout paths, exact nonprimary-PTY routing, full large-body chunk reconstruction, escaping/CRLF samples, internal laziness/yield work assertions, oversized preflight refusal, and exact configured delay/budget counts. No equivalent replacement, new execution, real PTY/provider delivery, rendered/native UI, deployment, measured performance or cross-platform result is claimed. Historical prior account (preserved verbatim): Mobile owner-layout policy retires whole tests and mixed registrations without equivalent replacement coverage. Retained callbacks and reduced selectors need fresh execution at their stated scope; prior measurements do not validate them. Historical oracle: Audit2003: Remove agent-prompt absence routing, throwing/live/missing-probe and cached-probe-count examples from the stale-leaf source. Controller-proven absence, unknown-liveness admission, obsolete-absence clearing and same-ID respawn fences remain at a supplied provider/row seam. Preserve the independent wire-codec receipt only in its original scope. 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): Audit1991: Remove partial-runtime terminal-send guard/status/floor/query projection and argument-inventory samples. Retained RPC viewport admission, authenticated-client spoof refusal, text admission and stale-binding fences remain bounded mock-boundary behavior. The unchanged wire-codec receipt remains valid only for its original command; it does not validate this reduced RPC selector. 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): Audit1908 removes the complete prompt-presentation hook and literal interactive-protocol mapping suites and narrows the interactive card and prompt-card input suites. Lost alarms include replacement approval A settling after answered B; collapse/expand composer ownership and partial-answer presentation; identical new waits after an unmounted view; collapsed transcript re-reads; answered/dismissed status-backed persistence and retirement; and literal answer-to-PTY byte arrays. The retained stale-PTY acknowledgment, cancellation/answer retry, and answered-approval remount/rebind assertions remain meaningful but are not equivalent replacement coverage. No fresh reduced-selector result, physical provider, rendered/native-focus, mixed-version deployment, soak, or measured-budget validation is claimed. The unchanged wire-codec receipt remains valid only for its exact command. 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: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Retained unchanged-selector receipts are the only current execution evidence. Reduced-source assertions await validation. Historical prior oracle: 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): After acknowledged phone replies with stale host status, the exact card disappears and Send is enabled; unknown, refused or unverifiable-settlement replies retain enabled choices, while an older host's accepted reply dismisses like an acknowledged one; a same-occurrence view toggle retains pending acknowledgment and real replacements discard it. A slow 32 KiB SSH answer completes all chunks before Enter; cancellation preserves issued bytes but omits remaining groups. Paired settlement invokes the actual provider and lost callbacks remain unknown; older hosts deliver ordinary messages, launch and selector groups once and their accepted answers dismiss as before. An answered card stays hidden across a view remount; a collapsed card is a strip that frees the composer and expands back; an identical question in a new wait shows again; a composer send caught by a new card keeps its bubble without submitting or clearing the line under it. Audit2450 removes the MobileNativeChatView failure-banner callback-only example whose old banner is supplied unchanged by its props. Retain fatal-read gating and the ordering test that preserves a new delivery notice. The removed false-send/old-banner combination has no equivalent replacement; prior raw receipts and budgets retain their original source scope. No new soak, platform, performance or red/green claim.", "commands": [ - "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/renderer/src/components/native-chat/prompts/NativeChatInteractiveCard.test.tsx src/renderer/src/components/native-chat/prompts/NativeChatResolvedView.prompt-card-input.test.tsx src/renderer/src/components/native-chat/surfaces/integration/NativeChatResolvedView.prompt-card-composer.test.tsx src/renderer/src/components/native-chat/conversation/turns/NativeChatResolvedView.turn-status.test.tsx src/renderer/src/runtime/hosted-terminals/inspection/runtime-terminal-inspection.test.ts src/renderer/src/lib/agent-session/messaging/paste/agent-paste-draft.test.ts src/renderer/src/lib/agent-session/messaging/paste/agent-paste-draft-submit-retry.test.ts src/main/ipc/pty/ipc/write-input-user-input.test.ts src/main/ipc/pty/pty-write-ipc-validation.test.ts src/main/runtime/terminal/input/runtime-terminal-writer.test.ts --maxWorkers=2", + "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/renderer/src/components/native-chat/prompts/NativeChatInteractiveCard.test.tsx src/renderer/src/runtime/hosted-terminals/inspection/runtime-terminal-inspection.test.ts src/renderer/src/lib/agent-session/messaging/paste/agent-paste-draft.test.ts src/renderer/src/lib/agent-session/messaging/paste/agent-paste-draft-submit-retry.test.ts src/main/ipc/pty/ipc/write-input-user-input.test.ts src/main/ipc/pty/pty-write-ipc-validation.test.ts src/main/runtime/terminal/input/runtime-terminal-writer.test.ts --maxWorkers=2", "ORCA_BACKGROUND_LAUNCH=1 mobile/node_modules/.bin/vitest run --config mobile/vitest.config.ts mobile/src/session/native-chat/input/mobile-prompt-controller.test.ts --maxWorkers=2", "ORCA_BACKGROUND_LAUNCH=1 pnpm test tests/e2e/cross-version-wire/cross-version-terminal-wire.unit.test.ts --maxWorkers=1", - "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/renderer/src/components/native-chat/prompts/NativeChatInteractiveCard.test.tsx src/renderer/src/components/native-chat/prompts/NativeChatResolvedView.prompt-card-input.test.tsx src/renderer/src/components/native-chat/conversation/turns/NativeChatResolvedView.turn-status.test.tsx src/renderer/src/runtime/hosted-terminals/inspection/runtime-terminal-inspection.test.ts src/renderer/src/lib/agent-session/messaging/paste/agent-paste-draft.test.ts src/renderer/src/lib/agent-session/messaging/paste/agent-paste-draft-submit-retry.test.ts src/main/ipc/pty/ipc/write-input-user-input.test.ts src/main/ipc/pty/pty-write-ipc-validation.test.ts --maxWorkers=2", + "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/renderer/src/components/native-chat/prompts/NativeChatInteractiveCard.test.tsx src/renderer/src/runtime/hosted-terminals/inspection/runtime-terminal-inspection.test.ts src/renderer/src/lib/agent-session/messaging/paste/agent-paste-draft.test.ts src/renderer/src/lib/agent-session/messaging/paste/agent-paste-draft-submit-retry.test.ts src/main/ipc/pty/ipc/write-input-user-input.test.ts src/main/ipc/pty/pty-write-ipc-validation.test.ts --maxWorkers=2", "ORCA_BACKGROUND_LAUNCH=1 mobile/node_modules/.bin/vitest run --config mobile/vitest.config.ts --maxWorkers=2" ], "testFiles": [ "src/renderer/src/components/native-chat/prompts/NativeChatInteractiveCard.test.tsx", - "src/renderer/src/components/native-chat/prompts/NativeChatResolvedView.prompt-card-input.test.tsx", - "src/renderer/src/components/native-chat/surfaces/integration/NativeChatResolvedView.prompt-card-composer.test.tsx", - "src/renderer/src/components/native-chat/conversation/turns/NativeChatResolvedView.turn-status.test.tsx", "src/renderer/src/runtime/hosted-terminals/inspection/runtime-terminal-inspection.test.ts", "src/renderer/src/lib/agent-session/messaging/paste/agent-paste-draft.test.ts", "src/renderer/src/lib/agent-session/messaging/paste/agent-paste-draft-submit-retry.test.ts", @@ -498,19 +495,6 @@ "keeps structured answer controls after a thrown send" ] }, - { - "file": "src/renderer/src/components/native-chat/surfaces/integration/NativeChatResolvedView.prompt-card-composer.test.tsx", - "assertions": [ - "keeps an in-flight message visible and never submits it into the approval", - "routes no typing to the hidden composer until the card is answered" - ] - }, - { - "file": "src/renderer/src/components/native-chat/prompts/NativeChatResolvedView.prompt-card-input.test.tsx", - "assertions": [ - "keeps an answered approval hidden across a chat view remount and a PTY rebind" - ] - }, { "file": "src/main/runtime/terminal/input/runtime-terminal-writer.test.ts", "assertions": [ @@ -549,6 +533,8 @@ "evidence": "No fresh reduced-source performance measurement is claimed. Historical account: Historical prior-selector budget; changed selectors have no fresh measurement. Historical account for the pre-audit test set; removed work-count alarms and changed selectors have no fresh measurement. Historical account for the pre-audit test set; removed work-count alarms and changed selectors have no fresh measurement. No polling, subprocess, startup await, new status producer or dismissal timer. Reuses the existing bounded per-tab committed observation and per-PTY queue; waits for each group before its existing pacing timer. Duplicate-cancel and yielding chunk tests bound writes. Optional paired proof reuses provider settlement only for requesting clients; legacy requests keep their raw path." }, "knownGaps": [ + "Audit3984 retires all four remaining viewport-fixture suites (14 authored/15 finite cases) and the fixture after composing the sender-host deletion. Accepted source-alarm losses include live-region/disclosure continuity, task/question/approval history and revision handling, stale turn status, prompt-dismissal remount/rebind, and pending-send cancellation when approval arrives between body and Enter. No equivalent replacement or fresh runtime validation is claimed.", + "Audit3984 retired assertionRefs, preserved verbatim as historical values; not active coverage: [{\"file\":\"src/renderer/src/components/native-chat/surfaces/integration/NativeChatResolvedView.prompt-card-composer.test.tsx\",\"assertions\":[\"keeps an in-flight message visible and never submits it into the approval\",\"routes no typing to the hidden composer until the card is answered\"]},{\"file\":\"src/renderer/src/components/native-chat/prompts/NativeChatResolvedView.prompt-card-input.test.tsx\",\"assertions\":[\"keeps an answered approval hidden across a chat view remount and a PTY rebind\"]}]", "Audits3764/3766 retire16 authored/27 expanded mobile cases, including entire HTML-image syntax, Mermaid routing, table styles, file-query encoding, workspace naming and fresh-Git-status adapter suites. Accepted losses include image width/icon filtering, partial-heading streaming, mocked Mermaid key/identity checks, generated table widths/counts, selected-text caret placement, tiny Base64 chunk encoding, twelve query-path roundtrips, locale-import fallback, apostrophe slugging, fresh-status fallback and an intermediate reviewed marker. These are deliberate removals for marginal value; remaining tests are not equivalent replacements. Earlier receipts are historical and do not validate these deleted/reduced drivers.", "Audit3748 intentionally removes ten authored/ten finite registrations from the surviving media-handle-registry.test.ts driver selected by this full-mobile command. Retired real alarms: nominal minted handle uniqueness/metadata and dimensions; ordinary range/EOF/overread/empty-file/direct chunk-clamp samples; nominal successful release, expired-release false, exact millisecond TTL boundary and ordinary releaseAll replay. Deterministic registry code runs; these examples are removed on marginal value without replacement or fresh execution claims. Seven owner cases retain cap refusal/disposal and sweep-before-admission, nonempty EOF and unknown/released/expired refusal, read TTL refresh, idempotent explicit release and continuation after discard failure. Existing commands, assertions, unrelated wire receipt and timing remain; the driver survives.", "Audits3738/3742/3743/3744 intentionally remove15 authored/21 finite registrations from six surviving drivers, with no equivalent replacement or fresh execution claim. This gate retains an unfiltered mobile Vitest command. Its mobile/src include patterns admit the partial live-input-commit and native-media drivers:5 authored/5 finite removals. Accepted losses: two Android-labeled replay samples after mocked composition conversion, an immediate Backspace absence check that does not wait for pending commit or prove local edit, and released-handle/double-release adapter examples. Real hook, registry and adapter logic run; no equivalent replacement or native Android/iOS exercise is claimed. Both drivers and selector stay. The unchanged wire-specific dated receipt does not validate these reduced mobile sources.", @@ -5818,12 +5804,12 @@ "providers": ["local", "daemon", "ssh", "remote-runtime", "wsl"], "coveredPlatforms": ["macos"], "coveredProviders": ["local", "daemon", "remote-runtime"], - "coverageNotes": "Audit 3959 retires the whole session.test.ts driver (27 authored / 33 finite cases): startup/echo filtering, readiness input gates, ownership confirmation, detach authority, and termination retry/exit ordering alarms are intentionally lost. No equivalent replacement or fresh runtime validation is claimed. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3390 composes root-adopted3382/independent3383 and3386/independent3387 and3388/independent3389: intentionally retires216 authored registrations/230 expanded cases in42 whole authored suites plus5 zero-case registration drivers, without equivalent replacement. Lost local alarms include fake PTY identity/routing/startup/replay/mode/title/mouse/IME/scroll matrices, broad startup identity and file-open wiring, mock mailbox title recovery, mobile row parity and whole-v-selective save parity. Retained24 registrations/26 expanded cases in22 suites preserve actual xterm Windows buffer/wrap/scroll, typed TOML scalar, real Promise cancellation/settlement, HTTP Codex scanner/projector semantics, durable recovery admission/newer-schema bytes, federation completion/ACK/SQLite atomicity and failed stale-run-write versus imported durable history. Additional retained clock-domain scheduling, durable freeze/ACK/checkpoint ordering, ABA dirty intent, SQL atomicity, folder-domain retier/last-note deletion, scrollback durable no-sync staging, PanelBridge subscriber lifetime and reserved-send publication preserve narrower concrete behaviors. Current finite owner drift assessed in bounded defining bodies; retained callback bytes unchanged. Historical notes and complete dated receipts keep their original exact scopes. No new execution, equivalent replacement, native focus/device/pixel, live remote or global mixed-version guarantee is claimed. 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): Audit1931 (sources1928/1929): Partial mobile-presence suite retains only five authored callbacks: admitted preview-paste completion across phone takeover, desktop take-back superseding mobile input, desktop viewport write/restore geometry, and held-fit reclaim convergence. Other supplied floor/rollback/selection/viewport/grace/disconnect/reconnect/orphan-state alarms are lost. No per-source assertion object exists to reassign. The one affected dated mobile-view-authority receipt is retired whole into historical notes with its full original/currentCommand/raw data preserved; it is not active corroboration for reduced candidate bytes. Imported mobile-subscribe registrations and retained callbacks remain bounded to their actual source obligations, without equivalent replacement or physical-phone/native-PTY claims. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1709 removes low-value test definitions and retires affected assertion or execution-receipt claims without equivalent replacement coverage. Per-source reviews bound retained behavior and injected/native/remote limits. Unchanged assertions and receipts keep their original scope; gates lacking current active evidence are downgraded. Historical scope before this audit: Audit1683 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: 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: 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/pty-connection-hidden-tui-snapshot-replay.spec.ts: Loses rich hidden snapshot sequence replay/grid resize and forced repaint after hidden snapshot alarms, including live-trigger deduplication. No equivalent replacement coverage or fresh result is claimed. Historical coverage account: Audit1320 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 host/parser, process-classifier, snapshot-publication, mixed-version, renderer, and macOS Electron coverage proves the local and shared paired-runtime contracts. Direct SSH intentionally publishes no shell proof and immediately preserves incumbent behavior. WSL, Windows ConPTY, Linux desktop, and paired headed/headless journeys remain gaps. The audit removed the isolated terminal-multiplex pending-escape-tail forwarding test. Its direct RPC snapshot field-copy alarm is lost; retained parser, snapshot and lifecycle suites do not establish equivalent RPC field coverage. Audit1320: src/renderer/src/components/terminal-pane/remote-runtime-pty-snapshot-escape-tail.test.ts removed. Snapshot pending escape/alternate-screen/shell metadata forwarding and negative app-store-read alarm disappears. 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. Audit1391: src/renderer/src/components/terminal-pane/pty-connection-remote-pause-drop-notice.spec.ts reduced. Lose repeated quiet switches avoiding snapshots and legacy host without drop-report capability requesting a snapshot. Retained imported registrar uses fake transport/xterm writes, exercising real gap/restore lifecycle rather than actual terminal rendering. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has 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. Audit1402: src/renderer/src/components/terminal-pane/pty-connection-park-reveal-model-snapshot.spec.ts reduced. Loses basic paired serialize/initial replay forwarding check; hidden alt-frame grid/precedence policy remains. No real terminal renderer claim. 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. Audit1412: src/main/daemon/terminal-host-concurrent-create.test.ts reduced. Loses race deduplication, attach during unsettled ownership proof, retry after failed spawn, distinct-session parallelism, disposal waiting and shutdown retry-fencing alarms bundled with removed internal-call counts or real-time waits. No replacement-equivalence claim. src/main/daemon/terminal-checkpoint-serializer.test.ts reduced. Loses bounded native conversion/no-whole-candidate materialization and snapshot getter single-read alarms. Retained byte-size outcomes do not establish CPU/allocation bounds. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", + "coverageNotes": "Audit3984 retires all nine mobile-presence and imported subscribe callbacks plus their orphan store fixture. Accepted losses include desktop/phone restore geometry, echo filtering, held reconnect/reclaim notifications, and the real headless snapshot sequence race. No equivalent replacement or fresh gate execution is claimed. Audit 3959 retires the whole session.test.ts driver (27 authored / 33 finite cases): startup/echo filtering, readiness input gates, ownership confirmation, detach authority, and termination retry/exit ordering alarms are intentionally lost. No equivalent replacement or fresh runtime validation is claimed. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3390 composes root-adopted3382/independent3383 and3386/independent3387 and3388/independent3389: intentionally retires216 authored registrations/230 expanded cases in42 whole authored suites plus5 zero-case registration drivers, without equivalent replacement. Lost local alarms include fake PTY identity/routing/startup/replay/mode/title/mouse/IME/scroll matrices, broad startup identity and file-open wiring, mock mailbox title recovery, mobile row parity and whole-v-selective save parity. Retained24 registrations/26 expanded cases in22 suites preserve actual xterm Windows buffer/wrap/scroll, typed TOML scalar, real Promise cancellation/settlement, HTTP Codex scanner/projector semantics, durable recovery admission/newer-schema bytes, federation completion/ACK/SQLite atomicity and failed stale-run-write versus imported durable history. Additional retained clock-domain scheduling, durable freeze/ACK/checkpoint ordering, ABA dirty intent, SQL atomicity, folder-domain retier/last-note deletion, scrollback durable no-sync staging, PanelBridge subscriber lifetime and reserved-send publication preserve narrower concrete behaviors. Current finite owner drift assessed in bounded defining bodies; retained callback bytes unchanged. Historical notes and complete dated receipts keep their original exact scopes. No new execution, equivalent replacement, native focus/device/pixel, live remote or global mixed-version guarantee is claimed. 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): Audit1931 (sources1928/1929): Partial mobile-presence suite retains only five authored callbacks: admitted preview-paste completion across phone takeover, desktop take-back superseding mobile input, desktop viewport write/restore geometry, and held-fit reclaim convergence. Other supplied floor/rollback/selection/viewport/grace/disconnect/reconnect/orphan-state alarms are lost. No per-source assertion object exists to reassign. The one affected dated mobile-view-authority receipt is retired whole into historical notes with its full original/currentCommand/raw data preserved; it is not active corroboration for reduced candidate bytes. Imported mobile-subscribe registrations and retained callbacks remain bounded to their actual source obligations, without equivalent replacement or physical-phone/native-PTY claims. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1709 removes low-value test definitions and retires affected assertion or execution-receipt claims without equivalent replacement coverage. Per-source reviews bound retained behavior and injected/native/remote limits. Unchanged assertions and receipts keep their original scope; gates lacking current active evidence are downgraded. Historical scope before this audit: Audit1683 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: 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: 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/pty-connection-hidden-tui-snapshot-replay.spec.ts: Loses rich hidden snapshot sequence replay/grid resize and forced repaint after hidden snapshot alarms, including live-trigger deduplication. No equivalent replacement coverage or fresh result is claimed. Historical coverage account: Audit1320 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 host/parser, process-classifier, snapshot-publication, mixed-version, renderer, and macOS Electron coverage proves the local and shared paired-runtime contracts. Direct SSH intentionally publishes no shell proof and immediately preserves incumbent behavior. WSL, Windows ConPTY, Linux desktop, and paired headed/headless journeys remain gaps. The audit removed the isolated terminal-multiplex pending-escape-tail forwarding test. Its direct RPC snapshot field-copy alarm is lost; retained parser, snapshot and lifecycle suites do not establish equivalent RPC field coverage. Audit1320: src/renderer/src/components/terminal-pane/remote-runtime-pty-snapshot-escape-tail.test.ts removed. Snapshot pending escape/alternate-screen/shell metadata forwarding and negative app-store-read alarm disappears. 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. Audit1391: src/renderer/src/components/terminal-pane/pty-connection-remote-pause-drop-notice.spec.ts reduced. Lose repeated quiet switches avoiding snapshots and legacy host without drop-report capability requesting a snapshot. Retained imported registrar uses fake transport/xterm writes, exercising real gap/restore lifecycle rather than actual terminal rendering. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has 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. Audit1402: src/renderer/src/components/terminal-pane/pty-connection-park-reveal-model-snapshot.spec.ts reduced. Loses basic paired serialize/initial replay forwarding check; hidden alt-frame grid/precedence policy remains. No real terminal renderer claim. 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. Audit1412: src/main/daemon/terminal-host-concurrent-create.test.ts reduced. Loses race deduplication, attach during unsettled ownership proof, retry after failed spawn, distinct-session parallelism, disposal waiting and shutdown retry-fencing alarms bundled with removed internal-call counts or real-time waits. No replacement-equivalence claim. src/main/daemon/terminal-checkpoint-serializer.test.ts reduced. Loses bounded native conversion/no-whole-candidate materialization and snapshot getter single-read alarms. Retained byte-size outcomes do not establish CPU/allocation bounds. No equivalent replacement coverage is claimed. 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/pull/16379"], "invariant": "After a TUI exits or is killed, reveal, reattach, snapshot replay, or renderer remount must not deliver terminal-owned mouse or alternate-screen protocol bytes to the surviving shell. Recovery is an ordered output barrier in the daemon session data path: an OSC 133;D completing while the alternate screen is still active pauses the stream at that exact byte boundary, a fresh execution-host process inspection proves shell ownership, and on proof a mode reset is injected as in-stream output so every consumer converges by parsing the same bytes and the queued post-boundary shell output (the prompt) lands on the normal buffer. Snapshots are pure reads. Any failure — refuted proof, timeout, queue overflow, session death, disposal — flushes the queue unmodified, preserving incumbent behavior; later command or mode bytes revoke proof. Clean alternate-screen exits prove ownership asynchronously without pausing.", "oracle": "Audit3832 deliberately retires76 authored/79 finite cases:75 runtime compatibility cases/78 finite cases across14 fragments, plus one localization extractor default-flag case. Three whole runtime fragments are deleted;27 authored/30 finite cases remain across the reviewed sources. This gate retains only its own selected scope; no equivalent replacement or fresh runtime/native/remote evidence is claimed. Runtime component A: Audit3828 composes3822 with independent3824: deliberately retires49 authored/52 finite cases from seven compatibility fragments, leaving15 authored/18 finite cases and deleting two entire fragments. Accepted losses: positive folder-worker recovery/materialization and reveal deadline; persisted-key normalization and legacy split/group/focus projection; fixed stale CAS refusal; occupied/alias/restored/preallocated terminal-handle variants; fixed OpenCode/Cursor/Claude/Codex/Antigravity classification, readiness, title and management examples; direct private-map browser authority projections; browser-focus and OMP title projection; already-aborted claim cleanup. Additional3824 loss: src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts :: does not poll a wrapper foreground for a speculative CLI prompt send :: Speculative retryForegroundWrappers:false check must return false on a wrapper after one foreground read, without polling the supplied later codex response. These real bounded alarms are deliberately retired for low marginal value. Retained callbacks are unchanged and provide only their own bounded scope, not equivalent replacement. Historical receipts do not validate reduced callbacks. No fresh runtime/native/SSH/WSL/phone/browser evidence or full transitive closure is claimed. Runtime component B: Audit3834 deliberately retires26 authored/26 finite cases from seven fresh compatibility fragments, leaving10/10 and deleting the one-case saved-binding reattachment fragment. Original position58 is excluded: its existing substantive3578 KEEP7 review remains historical, with no fresh credit. Accepted losses: fixed hook/provider-session identities and stale metadata refusal; decorative/pre-title foreground ordering variants; saved-binding surface reattachment; saved-row exit ghost removal and silent activation selection; unsupported headless wake; positive pending materialization/group projections; per-caller navigation selection; positive SSH hydration/read partition; laptop mobile publication/buffer and background/pending/status projections; abnormal/unregistered SSH grace, normal-exit refusal, persisted SSH hydration, positive serve reattachment, pending-agent launch arguments and direct seeded running-launch admission guard. These are real bounded alarms deliberately retired for low marginal value. Retained cases preserve their own distinct deferred foreground coalescing, usable handle continuity, stale inventory refresh, concurrent browser snapshot preservation, renderer graph fencing, caller dedup isolation, SSH partition writes, runtime split lifetime, independent relay-ready publication, lease admission/state/expiry. The direct running-launch no-spawn guard alarm is deliberately retired; no remaining owning-launch refusal coverage is claimed. Historical runs do not validate reduced callbacks. No equivalent replacement, runtime/native/SSH/WSL/phone/browser result or full transitive closure is claimed. Additional extractor loss: config/scripts/localization/source-extraction/audit-localization-native-dialogs.test.mjs :: does not change the existing renderer scan by default :: Default options must omit the five native-only fields in this supplied snippet. No equivalent replacement is claimed. Historical prior account (preserved verbatim): Audit3814 deliberately retires60 authored/60 finite cases:53runtime compatibility cases,4native XCTest methods and3Python clipboard methods, including the entire StableElementIndexes suite. Clipboard cuts retire the one-over-cap sample, incoming-offer destruction trace and sequential20-copy replay; actual wire, FD/pipe, startup and Xvfb/GTK boundaries remain without equivalent replacement claims. Accepted losses include narrow terminal-send payload/provider projections, legacy and direct no-op/error permutations, timing/work-count examples, private state/title/activity projections and fixture-driven readiness examples, individually enumerated below. These include real bounded production alarms consciously retired for marginal value; retained failed writes, duplicate submission, stale capture, transcript/ring and allocation fences are not equivalent replacements. No fresh native/remote/browser execution or complete transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3806 deliberately retires40 authored/40 finite runtime compatibility cases, including the terminal-side-effect-facts-part03 headless-snapshots-part02 and agent-status-and-waits-part03 fragments, plus20 scalar Swift precondition sites. Lost runtime alarms include status/title/attention projection examples, simple renderer/headless frame restoration and status waiting outcomes detailed in the accepted-loss ledger. Swift cuts retire duplicate generation-map/schema/navigation/bridge and notification-wrapper assertions; no standalone native program is deleted. These include real bounded production alarms consciously retired for marginal value. Retained races, pending writes/reflow, namespace and waiter ownership are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3798 deliberately retires21 authored/24 finite compatibility cases, including the entire SSH-worktree-lifecycle and repository-project-operations fragments. Accepted losses include navigation-only settings acknowledgement, browser session cleanup and host preservation projections, window positive/policy-state examples, terminal recovery/reload and no-incarnation remint examples, terminal listing compatibility/malformed IDs, directory browse/sort/Windows path smoke, SSH create refusal/manual lineage, recursive parent-folder creation and fork/origin/avatar/icon projections. Real bounded production alarms are consciously retired for marginal value; retained authority races, cleanup/clone ownership, pending waiters, nested-folder and scan invalidation cases are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3390 composes root-adopted3382/independent3383 and3386/independent3387 and3388/independent3389: intentionally retires216 authored registrations/230 expanded cases in42 whole authored suites plus5 zero-case registration drivers, without equivalent replacement. Lost local alarms include fake PTY identity/routing/startup/replay/mode/title/mouse/IME/scroll matrices, broad startup identity and file-open wiring, mock mailbox title recovery, mobile row parity and whole-v-selective save parity. Retained24 registrations/26 expanded cases in22 suites preserve actual xterm Windows buffer/wrap/scroll, typed TOML scalar, real Promise cancellation/settlement, HTTP Codex scanner/projector semantics, durable recovery admission/newer-schema bytes, federation completion/ACK/SQLite atomicity and failed stale-run-write versus imported durable history. Additional retained clock-domain scheduling, durable freeze/ACK/checkpoint ordering, ABA dirty intent, SQL atomicity, folder-domain retier/last-note deletion, scrollback durable no-sync staging, PanelBridge subscriber lifetime and reserved-send publication preserve narrower concrete behaviors. Current finite owner drift assessed in bounded defining bodies; retained callback bytes unchanged. Historical notes and complete dated receipts keep their original exact scopes. No new execution, equivalent replacement, native focus/device/pixel, live remote or global mixed-version guarantee is claimed. 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): Audit1931 (sources1928/1929): Partial mobile-presence suite retains only five authored callbacks: admitted preview-paste completion across phone takeover, desktop take-back superseding mobile input, desktop viewport write/restore geometry, and held-fit reclaim convergence. Other supplied floor/rollback/selection/viewport/grace/disconnect/reconnect/orphan-state alarms are lost. No per-source assertion object exists to reassign. The one affected dated mobile-view-authority receipt is retired whole into historical notes with its full original/currentCommand/raw data preserved; it is not active corroboration for reduced candidate bytes. Imported mobile-subscribe registrations and retained callbacks remain bounded to their actual source obligations, without equivalent replacement or physical-phone/native-PTY claims. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1709 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: Audit1683 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: 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: 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): Run one fixed child-TUI journey for normal exit and cleanup-free SIGKILL. Assert renderer and host normal-buffer/non-mouse state, host snapshot terminalOwner metadata, exact PTY writes with no post-exit mouse report, unrelated-pane survival, post-boundary prompt output preserved (normal exit), ordered proof invalidation, bounded settlement and bail-out flush, one inspection per unclean episode with zero scans for ordinary output, split-escape safety at every chunk boundary, and old/new client-host fallback parity.", "commands": [ - "pnpm exec vitest run --config config/vitest.config.ts src/main/daemon/shell-readiness/testing/terminal-shell-recovery-barrier.test.ts src/main/daemon/sessions/testing/session-shell-recovery.test.ts src/main/daemon/terminal-host/testing/terminal-host-concurrent-create.test.ts src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts src/main/daemon/history/restoration/testing/daemon-restore-scrollback-depth.test.ts src/main/daemon/history/restoration/testing/terminal-checkpoint-serializer.test.ts src/main/providers/agent-foreground-process.test.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/terminal/layout/mobile-presence-lock.test.ts src/shared/terminal/protocol/escape/terminal-partial-escape-tail.test.ts src/shared/terminal/protocol/escape/terminal-partial-escape-tail.fuzz.test.ts --reporter=dot", + "pnpm exec vitest run --config config/vitest.config.ts src/main/daemon/shell-readiness/testing/terminal-shell-recovery-barrier.test.ts src/main/daemon/sessions/testing/session-shell-recovery.test.ts src/main/daemon/terminal-host/testing/terminal-host-concurrent-create.test.ts src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts src/main/daemon/history/restoration/testing/daemon-restore-scrollback-depth.test.ts src/main/daemon/history/restoration/testing/terminal-checkpoint-serializer.test.ts src/main/providers/agent-foreground-process.test.ts src/main/runtime/construction/orca-runtime.test.ts src/shared/terminal/protocol/escape/terminal-partial-escape-tail.test.ts src/shared/terminal/protocol/escape/terminal-partial-escape-tail.fuzz.test.ts --reporter=dot", "pnpm exec vitest run --config config/vitest.config.ts tests/e2e/cross-version-wire/cross-version-terminal-wire.unit.test.ts --reporter=dot", "pnpm exec electron-vite build --mode e2e", "SKIP_BUILD=1 pnpm exec playwright test tests/e2e/terminal-hidden-child-tui-kill-mode-reset.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1" @@ -5837,7 +5823,6 @@ "src/main/daemon/history/restoration/testing/terminal-checkpoint-serializer.test.ts", "src/main/providers/agent-foreground-process.test.ts", "src/main/runtime/construction/orca-runtime.test.ts", - "src/main/runtime/terminal/layout/mobile-presence-lock.test.ts", "src/shared/terminal/protocol/escape/terminal-partial-escape-tail.test.ts", "src/shared/terminal/protocol/escape/terminal-partial-escape-tail.fuzz.test.ts", "tests/e2e/cross-version-wire/cross-version-terminal-wire.unit.test.ts", @@ -5902,6 +5887,7 @@ "Keep missing-proof mixed-version behavior identical to the incumbent client path." ], "knownGaps": [ + "Audit3984 retires all nine mobile-presence and imported subscribe callbacks plus their orphan store fixture. Accepted losses include desktop/phone restore geometry, echo filtering, held reconnect/reclaim notifications, and the real headless snapshot sequence race. No equivalent replacement or fresh gate execution is claimed.", "Audit3814 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle from a Codex ready prompt even when stale startup lines remain :: Stale MCP startup lines must not block a later Codex ready header.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle when a stale Codex prompt is followed by the ready header :: A Codex ready header following a stale resume prompt must satisfy tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for an idle Cursor lane past its dismissed trust dialog (#8210) :: Later Cursor idle banner overrides retained trust dialog.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not block a mid-run Cursor lane on its dismissed trust dialog (#8210) :: Dismissed trust dialog must not report blocked for later busy Cursor; wait times out.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: does not classify unrelated press-enter prompts as Codex blocked prompts :: Unidentified press-enter text must time out rather than be classified Codex blocked.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: resolves tui-idle for quiet background PTY agents without OSC titles :: Quiet Codex background terminal without OSC title eventually resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts :: sends agent prompts as bracketed paste before submit :: Driving prompt escapes embedded paste-end ESC, writes one framed paste then CR, and counts bytes.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: settles a foreground Codex prompt when launch metadata has not arrived :: Codex inferred from foreground without launch metadata waits for composer marker/quiescence before one CR.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: gives a late Codex render marker a fresh quiescence window :: Marker arriving at7.9s re-arms fresh quiet window instead of submitting at initial cap.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: writes large agent prompt paste frames atomically before delayed submit :: A prompt larger than input chunk budget is a single paste write before delayed CR with exact byte count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects oversized terminal.send text before provider writes :: Oversized ordinary terminal.send rejects input-too-large before any provider write.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts :: rejects focusing an exited background terminal session :: focusTerminal refuses terminal_exited before invoking background reveal.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: pastes the same bytes the desktop draft paste sent for the prompt :: Launch-ready prompt normalizes CR/LF and renders embedded ESC visibly identically to desktop bracketed paste.\nsrc/main/runtime/orca-runtime-tests/agent-launch-prompt-submit.spec.ts :: keeps a prompt into a running agent behind the render settle, as before :: Driving prompt remains held through7s repaint activity then submits once by9s.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reports a queued PTY focus as not navigated when its notifier disappears :: Queued PTY focus and completed active reveal report not navigated after notifier removal; no second reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: does not invoke a stale graph-leaf focus notifier after queued PTY work :: Queued graph-leaf focus must not invoke old notifier after preceding PTY reveal and notifier removal.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: paginates retained terminal output with explicit limits and truncation metadata :: Preview120lines, fractional limits,50/200 pages, retained2000line truncation and future-cursor metadata stay consistent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: falls back to renderer visible screen when uncursored TUI tail is blank :: Substantial blank uncursored tail uses mounted renderer visible screen with zero scrollback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: reads and shows the runtime-owned alternate-screen grid without serialization :: Actual runtime alternate-screen grid provides read/show content without renderer/provider serialization.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: classifies older provider alternate-screen snapshots from ANSI :: Older provider without alternateScreen metadata classifies ANSI alternate entry and returns Remote Vim screen.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts :: honors the last ANSI screen transition when older provider metadata is absent :: Last ANSI alternate exit overrides earlier entry when explicit provider mode metadata is absent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: rejects a full provider screen frame after live output advances :: Live output arriving during second full-screen capture causes screen-unavailable rather than stale full frame.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: shares one provider snapshot between concurrent read and show calls :: Concurrent read/show share one successful provider snapshot and both receive Shared TUI content.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps cursor reads provider-free on restored alternate-screen PTYs :: Restored alternate-screen cursor transcript reads never acquire provider snapshot.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: backs off after a provider snapshot failure instead of retrying for show :: Failed provider capture is cached/backed off so later show does not retry.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: falls back once to a mounted renderer when a known alternate provider fails :: A known-alternate failed provider capture falls back exactly once to newly mounted renderer.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: bounds provider visible frames for read and show responses :: Provider visible read/show use six bounded lines and300character preview.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: keeps renderer-fallback composer drafts separate from terminal output :: Renderer fallback strips dim composer draft from terminal output and exposes draft separately.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts :: does not use renderer visible-screen fallback for a short blank shell tail :: Two blank shell lines must not trigger renderer screen fallback.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: trims terminal tail character budget without per-line array shifts :: Tail builder trims to256KiB with correct retained suffix and no Array.shift calls.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains ANSI-only status redraws instead of appending every frame :: Repeated erase/redraw replaces preview until newline then publishes one completed cursor row.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains split multi-line ANSI footer redraw state across chunks :: CUU state across chunks retains corrected footer rows and publishes new cursor entries.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not let stale lower rows hide earlier corrected footer rows from cursor reads :: Earlier corrected footer row must not be hidden by stale lower rows in cursor reads.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: bounds completed transcript entries from a single multi-line redraw chunk :: Single redraw chunk bounds completed transcript to2000retained lines and correct oldest/next/latest cursors.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains multi-line ANSI redraws when the last footer row stays partial :: Partial final redrawn row appears in preview but cursor sees it only after newline.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: does not retain split ANSI controls as visible terminal preview text :: Split color/mode escapes never leak preview fragments; long split OSC title truncates at MAX_OSC_TITLE_CHARS.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts :: retains same-line redraw cursor position across split full-line erase chunks :: Full-line erase preserves column across chunks so XY follows three spaces rather than old ABC.\nsrc/main/runtime/orca-runtime-tests/conpty-stream-read.spec.ts :: fills the requested line count even when blank rows sit below the prompt :: Blank rows below a ConPTY prompt must not consume the requested nonempty-line count.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: does not retain split ST-terminated string controls as preview text :: Split ST-terminated Kitty/string controls must remain excluded from preview text.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects split OSC titles before retaining terminal previews :: Split BEL OSC title must update working title/status without leaking into preview.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: detects ST-terminated OSC titles split before the final backslash :: ST OSC split before final backslash must update title without leaking framing.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: preserves a trailing escape after a completed OSC title :: Completed OSC followed by pending ESC must preserve the next idle-title transition.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: seeds newly synced leaves from PTY pending ANSI state :: A newly synced graph leaf inherits pending ANSI so a split color fragment cannot leak.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: bounds retained partial terminal output before preview reads :: Partial terminal state stays capped at 4000, preserves retained array identity, and preview truncation/cursor output remains correct.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery.spec.ts :: submits the mail pointer to Cursor Agent only after the paste-burst delay :: Cursor mailbox pointer Enter must wait through the paste-burst delay; this is a real input-timing alarm intentionally retired.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts :: adopts a v1.4.150-shaped agent, setup, and shell orphan as one topology transaction :: Stale incarnation refuses without topology change; three agent/setup/shell lanes adopt atomically with layout/group/revision and preserved read/input/resize; exact replay is idempotent and competing owner refuses.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: retires the exact worker when it exits after renderer reveal :: Exact worker exit after reveal retires that worker and its surface.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: re-reveals a recovered worker after the renderer graph epoch changes :: Changed renderer graph epoch invalidates reveal receipt and forces another reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: defers recovery when the renderer omits the exact reveal identity :: Missing exact reveal identity defers recovery after two attempts.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts :: reconciles a same-id process replacement before headless adoption :: A process replacement before headless adoption must fence off stale ownership.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retires provider resume only after authoritative inventory proves the legacy PTY exited :: Authoritative owning-host inventory overrides false local hasPty, avoids SSH scanning, retires exited provider resume/surface, adopts live workers without headless reveal.\nsrc/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts :: retries inventory and unknown liveness without revealing a ghost worker :: Inventory failure and unknown liveness must retry without ghost reveal, eventually adopt, and stop retrying.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts :: refuses a live reserved pane before issuing a handle or revealing it :: A requireFreshPane launch receiving a live reserved owner must reject before handle/reveal/kill, and release its claim. No equivalent replacement claimed.", "Audit3806 per-case accepted runtime losses:\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: skips a listener unsubscribed mid-fan-out even with mobile exclusions active :: A listener removed by an earlier listener during one fanout is not called, including with a side-effect-excluded mobile listener present.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: retains bytes emitted before a fresh daemon spawn resolves :: Bytes and title arriving before an initial zero/reset provider response survive in the serialized headless buffer with their counted sequence.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits command-finished facts with best-effort exit codes across chunk splits :: A split OSC133 D exit code becomes130 and a missing code becomes null in ordered command-finished facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts :: emits pr-link facts once per URL with batch attribution :: A split GitHub PR URL yields42 rather than4, emits42/43 once each, and carries PTY/worktree/tab attribution.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits 2031-subscribe facts across chunk splits :: Split ESC[?20 then31h emits exactly one2031-subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: restores a provisional 2031 subscribe when daemon scan authority returns :: Returning daemon scan authority with partial scan seed and pending2031 subscription restores exactly one subscribe fact.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers the tracked title over the renderer snapshot lastTitle :: A synthetic live Cursor title overrides stale renderer lastTitle while preserving renderer snapshot source.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: prefers provider history over a partial headless mirror for requested snapshots :: Authoritative requested snapshots return supplied provider frame/history/seq rather than a partial headless mirror, requesting5000rows.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: tracks live alternate-screen transitions after a provider snapshot :: Provider alternateScreen true is accepted, then live1049l/1049h update isTerminalAlternateScreen false/true.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: translates reset provider snapshots without retaining the old title :: A reset provider snapshot translates new local seq into the runtime domain and replaces Old process title with New process.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: emits the chunk agentStatus events before its side-effect batch :: Agent status callback precedes side-effect batch callback for one coalesced OSC9999/title/bell chunk.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: still emits a throwing chunk’s facts under its own seq, not the next chunk’s :: A tracker throw still flushes first chunk title facts under its own seq, and second chunk does not inherit those facts.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: seeds the lazily created tracker from the daemon-snapshot title :: A lazy tracker hydrated from renderer snapshot title Codex working emits agent-idle on later Codex done.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits command-code-working facts only after the banner arms the scrape :: Unarmed Thinking text emits no facts; a Command Code0.27.3 banner then hardcoded colored spinner text emits attributed command-code-working with the submitted prompt.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts :: emits a command-code-done fact when the idle composer returns :: After hardcoded banner/working text, returned idle composer emits command-code-done with the earlier submitted prompt.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: resizes the headless mirror after an accepted desktop PTY resize :: An external accepted resize produces the resized dimensions and same status-frame lines as a separately driven reference emulator.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: replaces suffix-only headless state with the recovered renderer snapshot :: Replacing suffix-only state removes old suffix, retains renderer history plus later output/cwd, and returns the live47x40PTY grid.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: stamps SSH connection identity on runtime terminal status :: A synthetic mounted-leaf OSC9999 status after registerPty carries the supplied SSH connectionId.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: does not retain WSL context when a PTY id is reused :: After exit and same-ID new null distro context, OSC7 file://server/share/repo uses UNC server path rather than old Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts :: preserves immutable context while a live daemon attach is unresolved :: preparePtyExecutionContext with preserveExisting refuses a supplied Debian replacement and subsequent OSC7 keeps original Ubuntu namespace.\nsrc/main/runtime/orca-runtime-tests/headless-snapshots-part-02.spec.ts :: projects frame-independent live state through main buffer snapshots :: Main-buffer snapshot puts focus-report/cursor-visibility modes in frameRestoreAnsi, excludes STATIC-FRAME there and includes it in data.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits.spec.ts :: continues terminal agent status fanout when a callback throws :: Throwing on the first status callback does not prevent second payload delivery and logs contextual error.\nsrc/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts :: returns a title-only replay snapshot and never historical attention :: Lose replay:true/title-only fact projection despite earlierbell and unknownPTYnull. No actual delivered-history notification or reattach behavior was exercised. No equivalent replacement claimed.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects a handle rebind while a controller-less status check yields :: A handle rebound while the null-controller status continuation yields must throw terminal_handle_stale.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts :: rejects confirmation evidence when the owning PTY exits :: A pending strong confirmation resolving after owning PTY exit must reject terminal_exited.\nsrc/main/runtime/orca-runtime-tests/agent-status-and-waits-part-03.spec.ts :: keeps ordinary terminal send suffix failures on the existing not-writable contract :: Ordinary send writes text but refused CR must throw terminal_not_writable with beforeWrite twice and afterWrite once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell the execution host cannot apply instead of spawning its default :: Requested Windows shell on POSIX must refuse before spawning a default shell.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: quotes the agent startup command for the requested shell, not the host default :: Requested cmd shell must override PowerShell default quoting for agent startup command.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: keeps restored receipts outside a targeted worktree scan :: Targeted scan removes the moved-worktree receipt while preserving another worktree receipt.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: observes setup command completion without waiting for its interactive shell to exit :: Nonzero completion marker 17 resolves while interactive shell remains running.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: falls back to setup terminal exit when no completion signal is available :: Setup completion observer without token falls back to actual exit code 9.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: cancels setup completion observation when the caller aborts :: Abort rejects with the original reason and unsubscribes once.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps observing after an uncertain setup terminal status :: Unknown exit waiter result must leave observation pending until completion marker arrives.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh omits a record :: Controller inventory omission disconnects the record but preserves its retained transcript.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: keeps retained PTY transcript memory when controller refresh times out :: Hung inventory timeout leaves connected record and retained transcript intact.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle for adopted background PTY handles from the renderer title :: An adopted background handle resolves tui-idle from ready Codex renderer title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves live-leaf tui-idle from an OpenCode native title :: A live leaf resolves tui-idle from an OpenCode native title.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from a Codex ready prompt preview :: A supplied Codex prompt preview resolves tui-idle without an actual agent.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts :: resolves tui-idle from an Antigravity prompt before the model line :: A supplied Antigravity prompt before model line resolves tui-idle.\nsrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts :: refuses a requested shell with no workspace instead of creating a default-shell tab :: Workspace-less explicit shell must reject before renderer default-tab request or spawn. This real guard/wiring alarm is deliberately retired.", "Audit3798 per-case accepted losses:\nsrc/main/runtime/orca-runtime-tests/paired-settings.spec.ts :: awaits navigation-only updates from paired clients (%s) :: Updating only claudeSubagentNavigationEnabled waits for the actual controller call to the supplied pending Claude-view reconcile for both on/off values.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: drops a client page record even when its close command cannot be issued :: A removed workspace loses its runtime client-page record and headless browser projection despite close delivery_required rejection, and emits the asynchronous warning.\nsrc/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts :: leaves client-hosted pages alone when another host still owns the same worktree id :: Removing runtime:env-b metadata with local ownership leaves the local same-ID client page unchanged and issues no close command.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: marks live bindings again when reopening after a promoted window closes :: A reopened window marks its still-registered live worktree in activeWorktreeIdsOnShutdown after the first promoted window closes.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: preserves live SSH session identities when promoting a headless runtime :: Headless-to-desktop promotion records active worktree, SSH connection and remoteSessionIdsByTabId from the supplied surviving SSH PTY/session.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores a surviving renderer when its reload is cancelled :: A sole ready renderer reload cancelled under its current renderer fence returns true and becomes ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: restores headless authority when desktop promotion navigation is cancelled :: A cancelled desktop promotion with headless recovery returns false while headless authority remains ready.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: moves a desktop graph to unavailable when its reload times out :: A ready desktop graph without a headless fallback becomes unavailable at the reload deadline and retains its window/epoch.\nsrc/main/runtime/orca-runtime-tests/window-authority.spec.ts :: recovers a failed headless promotion and accepts a later renderer generation :: A promotion failure restores ready headless authority; a later valid same-window graph publishes ready desktop authority.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: clears a failed pane recovery so a later reconnect can retry :: After relay_reconnecting rejection, the pending recovery lock clears and the same pane/handle can call createTerminal a second time and return its supplied replacement.\nsrc/main/runtime/orca-runtime-tests/terminal-handles.spec.ts :: still preserves a CLI agent leaf when the reloaded renderer has not rebound its PTY :: An empty graph published during renderer reload preserves a preallocated live CLI PTY as one listable terminal before renderer rebind.\nsrc/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts :: keeps a no-incarnation handle across an in-graph pane remint :: Within one graph lifetime an unversioned PTY reminted onto another leaf retains its issued handle and resolves its old exit waiter after onPtyExit.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: matches explicit-id cwd PTYs when the resolved worktree cache is incomplete :: An explicit target absent from a fresh incomplete resolved cache adopts only its cwd PTY, rejects nested cwd PTY and does not rescan Git.\nsrc/main/runtime/orca-runtime-tests/terminal-listing.spec.ts :: ignores cwd-only controller PTYs for malformed explicit worktree IDs :: Malformed id:repo-1:: returns no terminals, does not adopt cwd-only controller PTY and avoids Git rescanning.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: refuses an SSH-backed create for mobile/runtime callers instead of creating locally :: Loss of this public unserved SSH create error-class/no-local-add/no-local-list alarm.\nsrc/main/runtime/orca-runtime-tests/ssh-worktree-lifecycle.spec.ts :: records an app-selected parent workspace as a manual action :: Loss of the local runtime folder-parent manual origin, active-workspace source and explicit confidence projection alarm; no claim that SSH or cleanup coverage replaces it.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: browses runtime server directories before projects are added :: Loss of this public runtime alarm for browse availability before registration, directories-first lexical ordering and native path flavor.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations.spec.ts :: lists drive roots for a server-root browse :: Loss of the Windows public slash-root drive enumeration smoke and presence of the temporary directory drive.\nsrc/main/runtime/orca-runtime-tests/repository-project-operations-part-02.spec.ts :: creates a missing runtime parent before creating the project directory :: Loss of this runtime createRepo recursive missing-parent/child existence and registered-path alarm.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: preserves selected project %s when a hosted parent is known :: Loss of both parent-selected and origin-selected normal fork-link projection/persisted upstream alarms plus exact single-probe count.\nsrc/main/runtime/orca-runtime-tests/project-setup-folder-remote-identity.spec.ts :: links a current enterprise remote despite unavailable metadata and a retained %s :: Loss of normal current-enterprise-origin linking with stale automatic GitHub avatar or protected file image, unchanged icon assertion, and serialized project identity under unavailable metadata.", diff --git a/src/main/runtime/orca-runtime-test-mocks/mobile-presence-store.ts b/src/main/runtime/orca-runtime-test-mocks/mobile-presence-store.ts deleted file mode 100644 index 161b58df2a0..00000000000 --- a/src/main/runtime/orca-runtime-test-mocks/mobile-presence-store.ts +++ /dev/null @@ -1,29 +0,0 @@ -export const mobilePresenceStore = { - getRepo: () => ({ - id: 'repo-1', - path: '/tmp/repo', - displayName: 'repo', - badgeColor: 'blue', - addedAt: 1 - }), - getRepos: () => [mobilePresenceStore.getRepo()], - addRepo: () => {}, - updateRepo: () => undefined as never, - getAllWorktreeMeta: () => ({}), - getWorktreeMeta: () => undefined, - getGitHubCache: () => ({ pr: {}, issue: {} }), - setWorktreeMeta: () => undefined as never, - removeWorktreeMeta: () => {}, - getRetiredWorktreeNameRegistry: () => ({ exhaustedTiers: 0, names: [] }), - addRetiredWorktreeName: () => {}, - mergeRetiredWorktreeNames: () => false, - getSettings: () => ({ - workspaceDir: '/tmp/workspaces', - nestWorkspaces: false, - refreshLocalBaseRefOnWorktreeCreate: false, - branchPrefix: 'none', - branchPrefixCustom: '', - // Legacy restore tests need a finite 5s; production defaults to indefinite hold. - mobileAutoRestoreFitMs: 5_000 - }) -} diff --git a/src/main/runtime/terminal/layout/mobile-presence-lock.test.ts b/src/main/runtime/terminal/layout/mobile-presence-lock.test.ts deleted file mode 100644 index 9fa17d5d1b0..00000000000 --- a/src/main/runtime/terminal/layout/mobile-presence-lock.test.ts +++ /dev/null @@ -1,199 +0,0 @@ -import { mobilePresenceStore as store } from '../../orca-runtime-test-mocks/mobile-presence-store' -import type * as WorktreeScanCacheModule from '../../../git/worktrees/catalog/worktree-scan-cache' -import type * as WorktreeListingModule from '../../../git/worktrees/catalog/worktree-listing' -import '../input/terminal-input-admission' -import './mobile-subscribe-integration.spec' -import { describe, expect, it, vi, beforeEach, afterEach } from 'vitest' -import { listWorktrees } from '../../../git/worktrees/catalog/worktree-scan-cache' -import type * as GitUsernameModule from '../../../git/repositories/git-username' -import { OrcaRuntimeService } from '../../orca-runtime' -import type { RuntimePtyController } from '../lifecycle/runtime-pty-controller-contract' - -vi.mock('../../../git/worktrees/catalog/worktree-scan-cache', async (importOriginal) => { - const facade = getWorktreeListingMocks() - return { - ...(await importOriginal()), - listWorktrees: facade.listWorktrees - } -}) - -vi.mock('../../../git/worktrees/catalog/worktree-listing', async (importOriginal) => { - const facade = getWorktreeListingMocks() - return { - ...(await importOriginal()), - listWorktreesStrict: facade.listWorktreesStrict - } -}) - -const { getWorktreeListingMocks } = vi.hoisted(() => { - const createWorktreeListingMocks = () => ({ - listWorktrees: vi.fn().mockResolvedValue([]), - listWorktreesStrict: vi.fn().mockResolvedValue([]) - }) - let listings: ReturnType | undefined - return { getWorktreeListingMocks: () => (listings ??= createWorktreeListingMocks()) } -}) -vi.mock('../../../workspace-hooks/hooks', () => ({ - getEffectiveHooks: vi.fn().mockReturnValue(null), - runHook: vi.fn().mockResolvedValue({ success: true, output: '' }) -})) -vi.mock('../../../workspace-hooks/worktree-runner-script', () => ({ - createSetupRunnerScript: vi.fn() -})) -vi.mock('../../../ipc/worktree-logic', async (importOriginal) => { - const actual = (await importOriginal()) as Record - return { ...actual, computeWorktreePath: vi.fn(), ensurePathWithinWorkspace: vi.fn() } -}) -vi.mock('../../../ipc/worktrees/removal/registered-worktree-roots-cache', () => ({ - invalidateAuthorizedRootsCache: vi.fn(), - invalidateAuthorizedRootsCacheForRepo: vi.fn() -})) -const repoBranchConflictMock = vi.hoisted(() => vi.fn().mockResolvedValue(null)) - -vi.mock('../../../git/repositories/git-username', async () => { - const actual = await vi.importActual( - '../../../git/repositories/git-username' - ) - return { ...actual, resolveLocalGitUsername: vi.fn(async () => '') } -}) - -// #7588 held-modal cases need per-test indefinite hold without mutating the shared default. -function createRuntime(mobileAutoRestoreFitMs: number | null = 5_000) { - vi.mocked(listWorktrees).mockResolvedValue([]) - const effectiveStore = { - ...store, - getSettings: () => ({ ...store.getSettings(), mobileAutoRestoreFitMs }) - } - const runtime = new OrcaRuntimeService(effectiveStore) - const ptySizes = new Map([ - ['pty-1', { cols: 150, rows: 40 }] - ]) - const resizes: { ptyId: string; cols: number; rows: number }[] = [] - const writes: string[] = [] - const driverEvents: { ptyId: string; driver: { kind: string; clientId?: string } }[] = [] - const fitOverrideEvents: { ptyId: string; mode: string; cols: number; rows: number }[] = [] - let resizeSucceeds = true - - const controller: RuntimePtyController = { - write: (_ptyId, data) => { - writes.push(data) - return true - }, - kill: () => true, - getForegroundProcess: async () => null, - resize: (ptyId, cols, rows) => { - if (!resizeSucceeds) { - return false - } - ptySizes.set(ptyId, { cols, rows }) - resizes.push({ ptyId, cols, rows }) - return true - }, - getSize: (ptyId) => ptySizes.get(ptyId) ?? null - } - runtime.setPtyController(controller) - runtime.setNotifier({ - worktreesChanged: vi.fn(), - reposChanged: vi.fn(), - activateWorktree: vi.fn(), - createTerminal: vi.fn(), - splitTerminal: vi.fn(), - renameTerminal: vi.fn(), - focusTerminal: vi.fn(), - closeTerminal: vi.fn(), - terminalFitOverrideChanged: (ptyId, mode, cols, rows) => { - fitOverrideEvents.push({ ptyId, mode, cols, rows }) - }, - terminalDriverChanged: (ptyId, driver) => { - driverEvents.push({ ptyId, driver: { ...driver } }) - } - }) - - return { - runtime, - controller, - ptySizes, - resizes, - writes, - driverEvents, - fitOverrideEvents, - setResizeSucceeds: (next: boolean) => { - resizeSucceeds = next - } - } -} - -describe('mobile presence lock — multi-mobile semantics', () => { - beforeEach(() => vi.useFakeTimers()) - afterEach(() => vi.useRealTimers()) - - it('updateDesktopViewport resizes the source PTY and records desktop geometry', async () => { - const { runtime, ptySizes, resizes } = createRuntime() - - expect(await runtime.updateDesktopViewport('pty-1', { cols: 132, rows: 44 })).toBe(true) - - expect(ptySizes.get('pty-1')).toEqual({ cols: 132, rows: 44 }) - expect(resizes.at(-1)).toEqual({ ptyId: 'pty-1', cols: 132, rows: 44 }) - // Controller drift must not overwrite remembered renderer geometry. - ptySizes.set('pty-1', { cols: 160, rows: 50 }) - await runtime.handleMobileSubscribe('pty-1', 'phone-A', { cols: 49, rows: 20 }) - expect(await runtime.reclaimTerminalForDesktop('pty-1')).toBe(true) - expect(ptySizes.get('pty-1')).toEqual({ cols: 132, rows: 44 }) - }) - - it('updateDesktopViewport records restore geometry while phone-fit override is held', async () => { - const { runtime, ptySizes, resizes } = createRuntime() - await runtime.handleMobileSubscribe('pty-1', 'phone-A', { cols: 49, rows: 20 }) - expect(ptySizes.get('pty-1')).toEqual({ cols: 49, rows: 20 }) - resizes.length = 0 - - expect(await runtime.updateDesktopViewport('pty-1', { cols: 132, rows: 44 })).toBe(true) - - expect(ptySizes.get('pty-1')).toEqual({ cols: 49, rows: 20 }) - expect(resizes).toEqual([]) - - expect(await runtime.reclaimTerminalForDesktop('pty-1')).toBe(true) - expect(ptySizes.get('pty-1')).toEqual({ cols: 132, rows: 44 }) - }) -}) - -// #7588: null-viewport re-subscribe leaves an active subscriber under the held fit override. -async function reachHeldModalWithNullViewportResubscribe( - runtime: OrcaRuntimeService -): Promise { - await runtime.handleMobileSubscribe('pty-1', 'phone-A', { cols: 45, rows: 20 }) - runtime.handleMobileUnsubscribe('pty-1', 'phone-A') - await vi.advanceTimersByTimeAsync(300) - await runtime.handleMobileSubscribe('pty-1', 'phone-A', undefined) -} - -describe('mobile presence lock — issue #7588 held-modal restore convergence', () => { - beforeEach(() => vi.useFakeTimers()) - afterEach(() => vi.useRealTimers()) - - it('reclaim after a null-viewport resubscribe restores dims, clears override, notifies both channels', async () => { - const { runtime, ptySizes, fitOverrideEvents } = createRuntime(null) - const listenerEvents: { mode: string; cols: number; rows: number }[] = [] - runtime.subscribeToFitOverrideChanges('pty-1', (e) => listenerEvents.push(e)) - - await reachHeldModalWithNullViewportResubscribe(runtime) - expect(runtime.getDriver('pty-1')).toEqual({ kind: 'idle' }) - expect(runtime.getTerminalFitOverride('pty-1')).not.toBeNull() - expect(ptySizes.get('pty-1')).toEqual({ cols: 45, rows: 20 }) - - const notifierBefore = fitOverrideEvents.length - const listenerBefore = listenerEvents.length - const restored = await runtime.reclaimTerminalForDesktop('pty-1') - - expect(restored).toBe(true) - expect(ptySizes.get('pty-1')).toEqual({ cols: 150, rows: 40 }) - expect(runtime.getTerminalFitOverride('pty-1')).toBeNull() - expect(fitOverrideEvents.slice(notifierBefore).some((e) => e.mode === 'desktop-fit')).toBe(true) - expect(listenerEvents.slice(listenerBefore).some((e) => e.mode === 'desktop-fit')).toBe(true) - }) -}) - -vi.mock('../../../git/refs/resolution/repo-branch-conflict', async (importOriginal) => ({ - ...(await importOriginal>()), - getBranchConflictKind: repoBranchConflictMock -})) diff --git a/src/main/runtime/terminal/layout/mobile-subscribe-integration.spec.ts b/src/main/runtime/terminal/layout/mobile-subscribe-integration.spec.ts deleted file mode 100644 index 03367f9ca29..00000000000 --- a/src/main/runtime/terminal/layout/mobile-subscribe-integration.spec.ts +++ /dev/null @@ -1,279 +0,0 @@ -import { describe, expect, it, vi, beforeEach, afterEach } from 'vitest' -import { listWorktrees } from '../../../git/worktrees/catalog/worktree-scan-cache' -import { OrcaRuntimeService } from '../../orca-runtime' - -// Legacy restore cases need finite 5s (the clamp floor); production defaults to indefinite hold. -const LEGACY_RESTORE_MS = 5_000 -const settingsState = { - mobileAutoRestoreFitMs: LEGACY_RESTORE_MS as number | null -} - -const store = { - getRepo: () => ({ - id: 'repo-1', - path: '/tmp/repo', - displayName: 'repo', - badgeColor: 'blue', - addedAt: 1 - }), - getRepos: () => [store.getRepo()], - addRepo: () => {}, - updateRepo: () => undefined as never, - getAllWorktreeMeta: () => ({}), - getWorktreeMeta: () => undefined, - getGitHubCache: () => ({ pr: {}, issue: {} }), - setWorktreeMeta: () => undefined as never, - removeWorktreeMeta: () => {}, - getRetiredWorktreeNameRegistry: () => ({ exhaustedTiers: 0, names: [] }), - addRetiredWorktreeName: () => {}, - mergeRetiredWorktreeNames: () => false, - getSettings: () => ({ - workspaceDir: '/tmp/workspaces', - nestWorkspaces: false, - refreshLocalBaseRefOnWorktreeCreate: false, - branchPrefix: 'none', - branchPrefixCustom: '', - mobileAutoRestoreFitMs: settingsState.mobileAutoRestoreFitMs - }), - updateSettings: (updates: { mobileAutoRestoreFitMs?: number | null }) => { - if ('mobileAutoRestoreFitMs' in updates) { - settingsState.mobileAutoRestoreFitMs = updates.mobileAutoRestoreFitMs ?? null - } - } -} - -class ObservableRuntime extends OrcaRuntimeService { - get restoreTimers(): typeof this.pendingRestoreTimers { - return this.pendingRestoreTimers - } - get softLeavers(): typeof this.pendingSoftLeavers { - return this.pendingSoftLeavers - } - get fitOverrides(): typeof this.terminalFitOverrides { - return this.terminalFitOverrides - } - get drivers(): typeof this.terminalDrivers { - return this.terminalDrivers - } -} - -function createRuntime() { - vi.mocked(listWorktrees).mockResolvedValue([ - { - path: '/tmp/worktree-a', - head: 'abc', - branch: 'feature/foo', - isBare: false, - isMainWorktree: false - } - ]) - const runtime = new ObservableRuntime(store) - const ptySizes = new Map() - ptySizes.set('pty-1', { cols: 150, rows: 40 }) - ptySizes.set('pty-2', { cols: 120, rows: 35 }) - ptySizes.set('pty-3', { cols: 100, rows: 30 }) - - const resizes: { ptyId: string; cols: number; rows: number }[] = [] - const notifications: { ptyId: string; mode: string; cols: number; rows: number }[] = [] - - runtime.setPtyController({ - write: () => true, - kill: () => true, - getForegroundProcess: async () => null, - resize: (ptyId, cols, rows) => { - ptySizes.set(ptyId, { cols, rows }) - resizes.push({ ptyId, cols, rows }) - return true - }, - getSize: (ptyId) => ptySizes.get(ptyId) ?? null - }) - runtime.setNotifier({ - worktreesChanged: vi.fn(), - reposChanged: vi.fn(), - activateWorktree: vi.fn(), - createTerminal: vi.fn(), - splitTerminal: vi.fn(), - renameTerminal: vi.fn(), - focusTerminal: vi.fn(), - closeTerminal: vi.fn(), - terminalFitOverrideChanged: (ptyId, mode, cols, rows) => { - notifications.push({ ptyId, mode, cols, rows }) - }, - terminalDriverChanged: vi.fn() - }) - - return { runtime, ptySizes, resizes, notifications } -} - -describe('mobile subscribe integration', () => { - beforeEach(() => { - vi.useFakeTimers() - settingsState.mobileAutoRestoreFitMs = LEGACY_RESTORE_MS - }) - - afterEach(() => { - vi.useRealTimers() - }) - - it('serializeMainTerminalBuffer reports the seq included in the headless snapshot', async () => { - vi.useRealTimers() - const { runtime } = createRuntime() - const first = 'one\r\n' - const second = 'two\r\n' - const third = 'three\r\n' - - runtime.onPtyData('pty-1', first, Date.now()) - const initialSnapshot = await runtime.serializeMainTerminalBuffer('pty-1') - expect(initialSnapshot?.seq).toBe(first.length) - expect(initialSnapshot?.source).toBe('headless') - - type HeadlessStateForTest = { - emulator: { write: (data: string) => Promise | void } - } - const headless = ( - runtime as unknown as { headlessTerminals: Map } - ).headlessTerminals.get('pty-1') - expect(headless).toBeDefined() - const originalWrite = headless!.emulator.write.bind(headless!.emulator) - const secondWriteGate: { release: (() => void) | null } = { release: null } - const secondWriteStarted = new Promise((resolve) => { - headless!.emulator.write = async (data: string): Promise => { - if (data === second) { - resolve() - await new Promise((release) => { - secondWriteGate.release = release - }) - } - await originalWrite(data) - } - }) - - try { - runtime.onPtyData('pty-1', second, Date.now()) - await secondWriteStarted - const racedSnapshot = runtime.serializeMainTerminalBuffer('pty-1') - runtime.onPtyData('pty-1', third, Date.now()) - if (!secondWriteGate.release) { - throw new Error('second write did not block') - } - secondWriteGate.release() - - const snapshot = await racedSnapshot - expect(snapshot?.seq).toBe(first.length + second.length) - expect(snapshot?.source).toBe('headless') - expect(runtime.getPtyOutputSequence('pty-1')).toBe( - first.length + second.length + third.length - ) - - const finalSnapshot = await runtime.serializeMainTerminalBuffer('pty-1') - expect(finalSnapshot?.seq).toBe(first.length + second.length + third.length) - expect(finalSnapshot?.source).toBe('headless') - } finally { - headless!.emulator.write = originalWrite - secondWriteGate.release?.() - } - }) - - it('preserves held-override baseline across resubscribe-after-indefinite-hold', async () => { - // Indefinite-hold re-subscribe must inherit the retained desktop baseline for later Restore. - settingsState.mobileAutoRestoreFitMs = null - const { runtime, ptySizes } = createRuntime() - - await runtime.handleMobileSubscribe('pty-1', 'client-a', { cols: 45, rows: 20 }) - expect(ptySizes.get('pty-1')).toEqual({ cols: 45, rows: 20 }) - - runtime.handleMobileUnsubscribe('pty-1', 'client-a') - await vi.advanceTimersByTimeAsync(60_000) - expect(ptySizes.get('pty-1')).toEqual({ cols: 45, rows: 20 }) - - await runtime.handleMobileSubscribe('pty-1', 'client-a', { cols: 45, rows: 20 }) - - await runtime.reclaimTerminalForDesktop('pty-1') - - expect(ptySizes.get('pty-1')).toEqual({ cols: 150, rows: 40 }) - }) - - describe('onExternalPtyResize', () => { - it('ignores reports while a mobile-fit override is in place', async () => { - // Phone-fit echoes must not poison the desktop restore baseline; see docs/mobile-fit-hold.md. - const { runtime, ptySizes } = createRuntime() - await runtime.handleMobileSubscribe('pty-1', 'client-a', { cols: 45, rows: 20 }) - - runtime.onExternalPtyResize('pty-1', 45, 20) - - runtime.setMobileDisplayMode('pty-1', 'desktop') - await runtime.applyMobileDisplayMode('pty-1') - expect(ptySizes.get('pty-1')).toEqual({ cols: 150, rows: 40 }) - }) - - it('updates baseline mid-fit when desktop reports dims that differ from the override', async () => { - // A newly visible desktop tab can report real geometry during phone fit; retain it for restore. - const { runtime, ptySizes } = createRuntime() - ptySizes.set('pty-1', { cols: 80, rows: 24 }) - runtime.onExternalPtyResize('pty-1', 80, 24) - await runtime.handleMobileSubscribe('pty-1', 'client-a', { cols: 45, rows: 20 }) - - runtime.onExternalPtyResize('pty-1', 200, 60) - - runtime.setMobileDisplayMode('pty-1', 'desktop') - await runtime.applyMobileDisplayMode('pty-1') - expect(ptySizes.get('pty-1')).toEqual({ cols: 200, rows: 60 }) - }) - }) - - describe('recordRendererGeometry (pty:reportGeometry IPC)', () => { - it('bypasses the cascade-suppress window (it is measurement-only)', async () => { - const { runtime, ptySizes, resizes } = createRuntime() - await runtime.handleMobileSubscribe('pty-1', 'client-a', { cols: 45, rows: 20 }) - runtime.setMobileDisplayMode('pty-1', 'desktop') - await runtime.applyMobileDisplayMode('pty-1') - expect(runtime.isResizeSuppressed()).toBe(true) - expect(ptySizes.get('pty-1')).toEqual({ cols: 150, rows: 40 }) - resizes.length = 0 - - runtime.recordRendererGeometry('pty-1', 130, 40) - expect(ptySizes.get('pty-1')).toEqual({ cols: 150, rows: 40 }) - expect(resizes).toEqual([]) - - runtime.setMobileDisplayMode('pty-1', 'auto') - await runtime.applyMobileDisplayMode('pty-1') - expect(ptySizes.get('pty-1')).toEqual({ cols: 45, rows: 20 }) - runtime.setMobileDisplayMode('pty-1', 'desktop') - await runtime.applyMobileDisplayMode('pty-1') - expect(ptySizes.get('pty-1')).toEqual({ cols: 130, rows: 40 }) - }) - }) - - // See docs/mobile-fit-hold.md. - describe('mobileAutoRestoreFitMs (fit hold)', () => { - it('reclaim with WS disconnect between cycles — held branch restores correctly each time', async () => { - // Repeated held-override reclaim must restore desktop geometry, never the current phone fit. - settingsState.mobileAutoRestoreFitMs = null - const { runtime, ptySizes } = createRuntime() - - for (let i = 0; i < 3; i++) { - await runtime.handleMobileSubscribe('pty-1', 'client-a', { cols: 45, rows: 20 }) - await runtime.mobileTookFloor('pty-1', 'client-a') - expect(ptySizes.get('pty-1'), `iter ${i}: phone-fit`).toEqual({ cols: 45, rows: 20 }) - - runtime.onClientDisconnected('client-a') - await vi.advanceTimersByTimeAsync(0) - await vi.advanceTimersByTimeAsync(60_000) - expect(ptySizes.get('pty-1'), `iter ${i}: held after disconnect`).toEqual({ - cols: 45, - rows: 20 - }) - expect(runtime.isMobileSubscriberActive('pty-1'), `iter ${i}: no subscribers`).toBe(false) - expect(runtime.getTerminalFitOverride('pty-1'), `iter ${i}: override held`).not.toBeNull() - - const ok = await runtime.reclaimTerminalForDesktop('pty-1') - expect(ok, `iter ${i}: reclaim ok`).toBe(true) - expect(ptySizes.get('pty-1'), `iter ${i}: PTY restored to desktop`).toEqual({ - cols: 150, - rows: 40 - }) - expect(runtime.getTerminalFitOverride('pty-1'), `iter ${i}: override cleared`).toBeNull() - } - }) - }) -}) diff --git a/src/renderer/src/components/native-chat/conversation/turns/NativeChatResolvedView.turn-status.test.tsx b/src/renderer/src/components/native-chat/conversation/turns/NativeChatResolvedView.turn-status.test.tsx deleted file mode 100644 index 5c09b84140c..00000000000 --- a/src/renderer/src/components/native-chat/conversation/turns/NativeChatResolvedView.turn-status.test.tsx +++ /dev/null @@ -1,140 +0,0 @@ -// @vitest-environment happy-dom - -import '@testing-library/jest-dom/vitest' - -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { act, cleanup, render, screen } from '@testing-library/react' -import type { - AgentStatusEntry, - AgentStatusPayload -} from '../../../../../../shared/agent-status/contracts/agent-status-types' -import type { NativeChatMessage } from '../../../../../../shared/native-chat/native-chat-types' -import type { NativeChatLiveSession } from '../../session/terminal/read/native-chat-live-session-contract' - -// Stub transcript/composer to exercise store status through the view into shared turn and prompt rendering. -const retained = vi.hoisted((): { session: NativeChatLiveSession | null } => ({ session: null })) -vi.mock('../../session/terminal/read/use-native-chat-retained-session', () => ({ - useNativeChatRetainedSession: () => retained.session -})) -vi.mock('../../composer/NativeChatComposer', () => ({ NativeChatComposer: () => null })) - -const { NativeChatResolvedView } = await import('../../NativeChatResolvedView') -const { TooltipProvider } = await import('@/components/ui/tooltip') -const { useAppStore } = await import('../../../../store/index') -const { installNativeChatMessageListTestViewport } = - await import('../../viewport/virtualization/native-chat-message-list-test-viewport') - -const paneKey = 'tab-state:leaf-state' -let restoreViewport = (): void => {} - -const userTurn: NativeChatMessage = { - id: 'user-1', - role: 'user', - blocks: [{ type: 'text', text: 'Rename the module' }], - timestamp: 1, - source: 'transcript' -} - -const stepCall: NativeChatMessage = { - id: 'step-1', - role: 'assistant', - blocks: [{ type: 'tool-call', name: 'Bash', input: { command: 'pnpm build' } }], - timestamp: 3, - source: 'transcript' -} - -// State both reconciled fields so the fixture represents a consistent live session. -function transcript( - status: NativeChatLiveSession['status'], - hookAwaitingInput: boolean, - messages: NativeChatMessage[] = [userTurn] -): NativeChatLiveSession { - return { - messages, - status, - sessionId: 'session-state', - agent: 'claude', - hookAwaitingInput, - hasMore: false, - loadingEarlier: false, - olderHistoryGeneration: 0, - loadEarlier: vi.fn(), - readPhase: 'ready' - } -} - -function setStatus(payload: Omit, age = 0): void { - useAppStore - .getState() - .setAgentStatus(paneKey, { prompt: 'Rename the module', agentType: 'claude', ...payload }) - const live = useAppStore.getState().agentStatusByPaneKey[paneKey] - if (!live) { - throw new Error('the store dropped the status row this test depends on') - } - useAppStore.setState((store) => ({ - agentStatusByPaneKey: { - ...store.agentStatusByPaneKey, - [paneKey]: { ...live, stateStartedAt: Date.now() - age } - } - })) -} - -function patchStatus(fields: Partial): void { - useAppStore.setState((store) => ({ - agentStatusByPaneKey: { - ...store.agentStatusByPaneKey, - [paneKey]: { ...store.agentStatusByPaneKey[paneKey]!, ...fields } - } - })) -} - -function renderPane(): void { - render( - - - - ) -} - -beforeEach(() => { - restoreViewport = installNativeChatMessageListTestViewport() - useAppStore.setState({ agentStatusByPaneKey: {}, nativeChatLaunchPromptByTabId: {} }) -}) - -afterEach(() => { - cleanup() - restoreViewport() - useAppStore.setState({ agentStatusByPaneKey: {}, nativeChatLaunchPromptByTabId: {} }) -}) - -describe('NativeChatResolvedView turn status', () => { - // Store staleness alone cannot prove an unanswered turn ended. - it('does not settle a turn the host went quiet on', () => { - retained.session = transcript('ready', true, [userTurn, stepCall]) - setStatus({ state: 'waiting' }, 60_000) - patchStatus({ turnStartedAt: Date.now() - 60_000 }) - - renderPane() - expect(screen.getByText('Working for 1m 0s')).toBeInTheDocument() - - // The live session reads no hook state once the row is stale, so the wait no longer holds the turn. - retained.session = transcript('ready', false, [userTurn, stepCall]) - act(() => { - patchStatus({ updatedAt: Date.now() - 31 * 60_000 }) - }) - - expect(screen.queryByText(/Work(ing|ed) for/)).toBeNull() - expect(screen.queryByRole('button', { name: 'Toggle turn details' })).toBeNull() - expect(screen.getByText('pnpm build')).toBeInTheDocument() - }) -}) diff --git a/src/renderer/src/components/native-chat/messages/agent-senders/native-chat-agent-message-sender-host.test.tsx b/src/renderer/src/components/native-chat/messages/agent-senders/native-chat-agent-message-sender-host.test.tsx deleted file mode 100644 index ffe10d4e3b3..00000000000 --- a/src/renderer/src/components/native-chat/messages/agent-senders/native-chat-agent-message-sender-host.test.tsx +++ /dev/null @@ -1,303 +0,0 @@ -// @vitest-environment happy-dom -import '@testing-library/jest-dom/vitest' -import { act, cleanup, fireEvent, render, screen } from '@testing-library/react' -import { afterAll, afterEach, beforeAll, beforeEach, expect, it, vi } from 'vitest' -import type { ReactNode } from 'react' -import { useAppStore } from '@/store' -import { TooltipProvider } from '@/components/ui/tooltip' -import type { AgentSessionStatusEvent } from '../../../../../../shared/agent-session/agent-session-wire' -import type { AgentMessageSource } from '../../../../../../shared/agent-session/agent-session-message-source' -import { testOrcaSessionId } from '../../../../../../shared/orca-session-address-test-fixture' -import type { Tab } from '../../../../../../shared/tab-types' -import type { RuntimeClientTarget } from '../../../../../../shared/runtime-client-target' -import { AGENT_SESSION_STATUS_FEED_RUNTIME_CAPABILITY } from '../../../../../../shared/agent-session/agent-session-attention-capabilities' -import { - MIN_COMPATIBLE_RUNTIME_CLIENT_VERSION, - RUNTIME_PROTOCOL_VERSION -} from '../../../../../../shared/protocol-version' - -const { mocks, moduleFactories, resetStructuredSessionMocks } = await vi.hoisted(async () => - ( - await import('../../surfaces/integration/NativeChatStructuredSession.test-harness') - ).createStructuredSessionMocks() -) -const transport = vi.hoisted(() => ({ - bridge: vi.fn(), - subscribe: vi.fn(), - focusRenderer: vi.fn(() => false), - subscriptions: new Map void>(), - unsupported: false, - olderLookup: false -})) -vi.mock('../../../../runtime/native-chat/requests/structured-agent-session-call', () => - moduleFactories.structuredAgentSessionCall() -) -vi.mock('../../../../runtime/native-chat/requests/structured-agent-session-subscriptions', () => ({ - ...moduleFactories.structuredAgentSessionSubscriptions(), - subscribeStructuredAgentSessionStatus: transport.subscribe -})) -vi.mock('../../session/structured/use-structured-agent-session', () => - moduleFactories.useStructuredAgentSession() -) -vi.mock('../../appearance/use-native-chat-font-size', () => moduleFactories.useNativeChatFontSize()) -vi.mock('../../links/actions/use-native-chat-file-link-context', () => - moduleFactories.useNativeChatFileLinkContext() -) -vi.mock('../../links/actions/use-native-chat-file-link-click', () => - moduleFactories.useNativeChatFileLinkClick() -) -vi.mock('../../media/images/native-chat-image-runtime-context', () => ({ - useNativeChatImageRuntimeContext: () => ({ - settings: null, - worktreeId: 'shared-workspace', - worktreePath: '/repo' - }) -})) -vi.mock('../../composer/NativeChatComposer', () => moduleFactories.nativeChatComposer()) -vi.mock('../../host-access/NativeChatEmptyState', () => moduleFactories.nativeChatEmptyState()) -vi.mock('../../prompts/NativeChatApprovalCard', () => moduleFactories.nativeChatApprovalCard()) -vi.mock('../../prompts/NativeChatQuestionCard', () => moduleFactories.nativeChatQuestionCard()) -vi.mock('../../attachments/intake/NativeChatPaneFileDropSurface', () => ({ - NativeChatPaneFileDropSurface: ({ children }: { children: ReactNode }) => children -})) -vi.mock('../../../tab-group/RetainedPaneHost', () => ({ - RetainedPaneHost: ({ children }: { children: ReactNode }) => children -})) -vi.mock('@/components/terminal-pane/links/handles/terminal-handle-links', async (original) => ({ - ...(await original>()), - focusRendererTerminalHandle: transport.focusRenderer -})) - -import StructuredAgentSessionPaneOverlayLayer from '../../pane/routing/StructuredAgentSessionPaneOverlayLayer' -import { clearRuntimeCompatibilityCache as clearRuntimeCompatibilityCacheForTests } from '@/runtime/rpc/compatibility/runtime-compatibility-cache' -import { - getStructuredAgentSessionStatusFeed, - resetStructuredAgentSessionStatusFeedsForTests -} from '@/runtime/native-chat/status/structured-agent-session-status-feed' - -const WORKSPACE = 'shared-workspace' -const ROOT = testOrcaSessionId('root-chat') -const initial = useAppStore.getInitialState() -const previousApi = Object.getOwnPropertyDescriptor(window, 'api') -import { installNativeChatMessageListTestViewport } from '../../viewport/virtualization/native-chat-message-list-test-viewport' -let restoreViewport = () => {} -beforeAll(() => { - restoreViewport = installNativeChatMessageListTestViewport() -}) -afterAll(() => restoreViewport()) - -function tab(id: string, sessionId: string, name: string, host: 'local' | 'runtime:server-1'): Tab { - return { - id, - entityId: sessionId, - customLabel: name, - executionHostId: host, - worktreeId: WORKSPACE, - groupId: 'group', - contentType: 'agent-session', - label: 'Claude Chat', - color: null, - sortOrder: 0, - createdAt: 0 - } -} -function source(terminal = false): AgentMessageSource { - const address = terminal ? 'term-sender' : `orca_session_id:${ROOT}` - return { - kind: 'agent', - senders: [ - { - party: { - address, - terminalHandle: terminal ? address : null, - orcaSessionId: terminal ? null : ROOT - }, - name: 'Recorded sender' - } - ], - orchestration: { - message: 'mail-notice', - mailbox: 'run:r1', - dispatchId: null, - messages: [{ messageId: 'mail-1', runId: 'r1', from: address }] - } - } -} -function seed(duplicate = false, terminal = false): void { - const from = source(terminal) - mocks.messages = [ - { - id: 'mail', - role: 'user', - timestamp: 1, - source: 'transcript', - blocks: [{ type: 'text', text: 'Agent mail' }], - from - } - ] - mocks.queuedCards = [ - { messageId: 'queued', position: 1, text: 'Agent mail', state: 'waiting', hold: 'turn', from } - ] - useAppStore.setState( - { - ...initial, - activeWorktreeId: WORKSPACE, - activeWorkspaceExecutionHostId: 'local', - focusGroup: vi.fn(), - activateTab: vi.fn(), - setActiveTabType: vi.fn(), - unifiedTabsByWorktree: { - [WORKSPACE]: [ - { - ...tab('recipient', 'recipient-chat', 'Recipient', 'runtime:server-1'), - agentSessionAgent: 'claude' - }, - tab('remote-sender', ROOT, 'Remote rename', 'runtime:server-1'), - tab('local-sender', duplicate ? ROOT : 'local-chat', 'Wrong local name', 'local') - ] - }, - groupsByWorktree: { - [WORKSPACE]: [ - { id: 'group', worktreeId: WORKSPACE, activeTabId: 'recipient', tabOrder: ['recipient'] } - ] - }, - activeGroupIdByWorktree: { [WORKSPACE]: 'group' } - }, - true - ) -} -async function mount(): Promise> { - let view: ReturnType - await act(async () => { - view = render( - - - - ) - }) - return view! -} -function publish(host: string, sessionId: string = ROOT): void { - transport.subscriptions.get(host)?.({ - type: 'snapshot', - sessions: [ - { - sessionId, - workspaceId: WORKSPACE, - agent: 'claude', - status: null, - latestPrompt: '', - updatedAt: 1 - } - ] - }) -} - -beforeEach(() => { - resetStructuredSessionMocks() - resetStructuredAgentSessionStatusFeedsForTests() - clearRuntimeCompatibilityCacheForTests() - transport.subscriptions.clear() - transport.subscribe.mockReset() - transport.focusRenderer.mockClear() - transport.unsupported = false - transport.olderLookup = false - transport.subscribe.mockImplementation( - async (target: RuntimeClientTarget, emit: (event: AgentSessionStatusEvent) => void) => { - const host = target.kind === 'local' ? 'local' : target.environmentId - transport.subscriptions.set(host, emit) - return { unsubscribe: vi.fn(() => transport.subscriptions.delete(host)) } - } - ) - transport.bridge.mockReset() - transport.bridge.mockImplementation( - async ({ method, params }: { method: string; params?: { address?: string } }) => { - if (method.startsWith('orchestration.party') && transport.olderLookup) { - return { - id: 'reply', - ok: false, - error: { code: 'method_not_found', message: 'older host' }, - _meta: { runtimeId: 'remote' } - } - } - const result = - method === 'status.get' - ? { - runtimeId: 'remote', - graphStatus: 'ready', - runtimeProtocolVersion: RUNTIME_PROTOCOL_VERSION, - minCompatibleRuntimeClientVersion: MIN_COMPATIBLE_RUNTIME_CLIENT_VERSION, - capabilities: transport.unsupported - ? [] - : [AGENT_SESSION_STATUS_FEED_RUNTIME_CAPABILITY] - } - : method === 'orchestration.partyOpen' - ? { - location: - params?.address === 'term-sender' - ? { kind: 'terminal', handle: 'term-current' } - : { kind: 'chat', sessionId: ROOT, worktreeId: WORKSPACE } - } - : { ok: true } - return { id: 'reply', ok: true, result, _meta: { runtimeId: 'remote' } } - } - ) - Object.defineProperty(window, 'api', { - configurable: true, - value: { - ...window.api, - runtime: { call: transport.bridge }, - runtimeEnvironments: { call: transport.bridge } - } - }) -}) -afterEach(() => { - cleanup() - resetStructuredAgentSessionStatusFeedsForTests() - clearRuntimeCompatibilityCacheForTests() - useAppStore.setState(initial, true) - if (previousApi) { - Object.defineProperty(window, 'api', previousApi) - } else { - Reflect.deleteProperty(window, 'api') - } -}) - -it.each([false, true])( - 'uses the stamped recipient host through queue/transcript names, renames and chat clicks (duplicate IDs %s)', - async (duplicate) => { - seed(duplicate) - const stopLocal = getStructuredAgentSessionStatusFeed({ kind: 'local' }).activate() - await mount() - act(() => { - publish('local', duplicate ? ROOT : 'local-chat') - publish('server-1') - }) - expect(screen.getAllByRole('button', { name: 'Remote rename' })).toHaveLength(2) - act(() => - useAppStore.setState({ - unifiedTabsByWorktree: { - [WORKSPACE]: useAppStore - .getState() - .unifiedTabsByWorktree[WORKSPACE]!.map((t) => - t.id === 'remote-sender' ? { ...t, customLabel: 'Updated remote rename' } : t - ) - } - }) - ) - const links = screen.getAllByRole('button', { name: 'Updated remote rename' }) - for (const link of links) { - await act(async () => fireEvent.click(link)) - expect(transport.bridge).toHaveBeenCalledWith( - expect.objectContaining({ selector: 'server-1', method: 'orchestration.partyOpen' }) - ) - expect(transport.bridge).toHaveBeenCalledWith( - expect.objectContaining({ selector: 'server-1', method: 'session.tabs.activate' }) - ) - expect(useAppStore.getState().activateTab).toHaveBeenLastCalledWith('remote-sender', { - worktreeId: WORKSPACE - }) - } - stopLocal() - } -) diff --git a/src/renderer/src/components/native-chat/messages/reasoning/NativeChatMessageList.live-reasoning.test.tsx b/src/renderer/src/components/native-chat/messages/reasoning/NativeChatMessageList.live-reasoning.test.tsx deleted file mode 100644 index f022051a412..00000000000 --- a/src/renderer/src/components/native-chat/messages/reasoning/NativeChatMessageList.live-reasoning.test.tsx +++ /dev/null @@ -1,573 +0,0 @@ -// @vitest-environment happy-dom - -import '@testing-library/jest-dom/vitest' - -import { cleanup, fireEvent, screen, within } from '@testing-library/react' -import { render } from '../actions/native-chat-tooltip-test-harness' -import { afterAll, afterEach, beforeAll, describe, expect, it, vi } from 'vitest' -import type { - AgentJournalItemBody, - AgentJournalRenderItem, - AgentJournalStatusItem -} from '../../../../../../shared/agent-session/journal/agent-session-journal-types' -import type { NativeChatMessage } from '../../../../../../shared/native-chat/native-chat-types' -import { projectStructuredItemToNativeChat } from '../../../../../../shared/agent-session/view/structured-agent-session-projection' -import { NativeChatMessageList } from '../../NativeChatMessageList' -import { installNativeChatMessageListTestViewport } from '../../viewport/virtualization/native-chat-message-list-test-viewport' -import { projectNativeChatTaskListFrames } from '../../../../../../shared/native-chat/input/native-chat-task-list-frames' - -import { projectStructuredQuestionMessages } from '../../../../../../shared/structured-agent-question-projection' -import type { NativeChatLiveSession } from '../../session/terminal/read/native-chat-live-session-contract' - -{ - const STARTED = 1_000 - - const prompt: NativeChatMessage = { - id: 'user-1', - role: 'user', - blocks: [{ type: 'text', text: 'Start the task' }], - timestamp: STARTED - 500, - source: 'transcript' - } - - function reasoning( - id: string, - text: string, - state: 'running' | 'completed', - fields: Partial = {} - ): NativeChatMessage { - return { - id, - role: 'reasoning', - blocks: [{ type: 'text', text }], - timestamp: STARTED, - source: 'transcript', - state, - ...(state === 'completed' ? { completedAt: STARTED + 12_000 } : {}), - ...fields - } - } - - function journal(rows: readonly NativeChatMessage[]): AgentJournalRenderItem[] { - return [ - { - itemId: prompt.id, - revision: 1, - sequence: 1, - observedAt: 1, - body: { kind: 'message', role: 'user', blocks: prompt.blocks } - }, - { - itemId: 'turn-1', - revision: 1, - sequence: 2, - observedAt: 2, - body: { kind: 'turn', turnId: 'turn-1', state: 'running', userItemId: prompt.id } - }, - ...rows.map((row, index) => ({ - itemId: row.id, - revision: 1, - sequence: index + 3, - observedAt: index + 3, - ...(row.agentId ? { agentId: row.agentId } : {}), - body: { - kind: 'message' as const, - role: row.role, - blocks: row.blocks, - ...(row.state ? { state: row.state } : {}) - } - })) - ] - } - - function sessionOf(messages: NativeChatMessage[]): NativeChatLiveSession { - return { - messages, - status: 'working', - sessionId: 'session-1', - agent: 'claude', - hasMore: false, - loadingEarlier: false, - olderHistoryGeneration: 0, - loadEarlier: vi.fn(), - readPhase: 'ready' - } - } - - function list( - rows: readonly NativeChatMessage[], - props: Partial> = {} - ): React.JSX.Element { - return ( - - ) - } - - describe('live reasoning, read through the one live line', () => { - let restoreViewport = (): void => {} - beforeAll(() => { - restoreViewport = installNativeChatMessageListTestViewport() - }) - afterAll(() => restoreViewport()) - afterEach(cleanup) - - it('opens to the live text, which follows the block as it grows', () => { - const { rerender } = render(list([reasoning('r-1', 'Weighing two approaches', 'running')])) - fireEvent.click(screen.getByRole('button', { name: 'Thinking' })) - expect(screen.getByRole('button', { name: 'Thinking' })).toHaveAttribute( - 'aria-expanded', - 'true' - ) - expect(screen.getByText('Weighing two approaches')).toBeInTheDocument() - rerender(list([reasoning('r-1', 'Weighing two approaches, then the cheaper one', 'running')])) - expect(screen.getByText('Weighing two approaches, then the cheaper one')).toBeInTheDocument() - }) - - it('lands the finished row open when the reader opened it live, while the turn works on', () => { - const { rerender } = render(list([reasoning('r-1', 'Weighing two approaches', 'running')])) - fireEvent.click(screen.getByRole('button', { name: 'Thinking' })) - rerender(list([reasoning('r-1', 'Weighing two approaches', 'completed')])) - expect(screen.queryByRole('button', { name: /Thinking|Working/ })).toBeNull() - expect(screen.getByRole('button', { name: 'Reasoning: Thought for 12s' })).toHaveAttribute( - 'aria-expanded', - 'true' - ) - expect(screen.getByText('Weighing two approaches')).toBeInTheDocument() - }) - - it('starts the next block collapsed', () => { - const { rerender } = render(list([reasoning('r-1', 'First thought', 'running')])) - fireEvent.click(screen.getByRole('button', { name: 'Thinking' })) - rerender( - list([ - reasoning('r-1', 'First thought', 'completed'), - reasoning('r-2', 'Second', 'running') - ]) - ) - expect(screen.getByRole('button', { name: 'Thinking' })).toHaveAttribute( - 'aria-expanded', - 'false' - ) - expect(screen.queryByText('Second')).toBeNull() - }) - - // A live region only announces changes to itself; a replaced one says nothing. - it('keeps one live region while the line turns into the disclosure and back', () => { - const tool: NativeChatMessage = { - id: 'tool-1', - role: 'assistant', - blocks: [ - { type: 'tool-call', name: 'shell', input: { command: 'ls' }, state: 'completed' } - ], - timestamp: STARTED, - source: 'transcript' - } - const later = { timestamp: STARTED + 50 } - const region = () => document.querySelector('[data-native-chat-turn-activity][aria-live]') - const { rerender } = render(list([tool])) - const before = region() - expect(before).toHaveTextContent('Working…') - rerender(list([tool, reasoning('r-1', 'Weighing two approaches', 'running', later)])) - expect(region()).toBe(before) - expect(before).toHaveTextContent('Thinking') - rerender( - list([ - tool, - reasoning('r-1', 'Weighing two approaches', 'completed', later), - { ...tool, id: 'tool-2', timestamp: STARTED + 60 } - ]) - ) - expect(region()).toBe(before) - expect(before).toHaveTextContent('Working…') - }) - }) -} - -{ - function frame( - id: number, - status: string, - overrides: { kind?: string; truncated?: boolean } = {} - ) { - const kind = overrides.kind ?? 'notification:turn/plan/updated' - const head = JSON.stringify({ - threadId: 'thread', - turnId: 'turn', - explanation: 'Keep verification visible', - plan: [{ step: 'Verify', status }] - }) - const body: AgentJournalStatusItem = { - kind: 'status', - text: `codex · ${kind}`, - providerFrame: { - provider: 'codex', - kind, - payload: { - head, - byteLength: new TextEncoder().encode(head).byteLength, - digest: 'fixture-digest', - truncated: overrides.truncated ?? false - } - } - } - const message = projectStructuredItemToNativeChat({ - itemId: `frame-${id}`, - revision: 1, - sequence: id, - observedAt: id, - body - }) - if (!message) { - throw new Error('Expected a projected message') - } - return message - } - - function transcript(messages: NativeChatMessage[], sessionId = 'live-codex') { - return ( - - ) - } - - describe('live Codex checklist frames', () => { - let restoreViewport = (): void => {} - beforeAll(() => { - restoreViewport = installNativeChatMessageListTestViewport() - }) - afterAll(() => restoreViewport()) - afterEach(cleanup) - it('updates one pinned checklist from journal notifications without rewinding on pagination', () => { - const first = frame(1, 'pending') - const active = frame(2, 'inProgress') - const last = frame(3, 'completed') - const { rerender, container } = render(transcript([first])) - const toggle = screen.getByRole('button', { name: 'Tasks 0 of 1 task completed' }) - const viewport = container.querySelector('.overflow-y-auto')! - expect(viewport.contains(toggle)).toBe(false) - fireEvent.click(toggle) - rerender(transcript([first, active])) - expect(within(toggle.parentElement!).getByText('Verify').closest('li')).toHaveClass( - 'text-chat-foreground-strong' - ) - expect(within(viewport as HTMLElement).getByText('Started Verify')).toBeInTheDocument() - rerender(transcript([last])) - expect( - within( - screen.getByRole('button', { name: 'Tasks 1 of 1 task completed' }).parentElement! - ).getByText('Verify') - ).toHaveClass('line-through') - expect(screen.getAllByText('Keep verification visible')).toHaveLength(2) - rerender(transcript([first, active, last])) - expect(screen.getAllByText('Verify')).toHaveLength(2) - expect(screen.getByRole('button', { name: 'Tasks 1 of 1 task completed' })).toBe(toggle) - expect(screen.getByText('Started Verify')).toBeInTheDocument() - expect(screen.queryByText('notification:turn/plan/updated')).toBeNull() - expect(projectNativeChatTaskListFrames([last])[0]).toBe( - projectNativeChatTaskListFrames([last])[0] - ) - }) - }) - - describe('NativeChatMessageList task list history', () => { - let restoreViewport = (): void => {} - beforeAll(() => { - restoreViewport = installNativeChatMessageListTestViewport() - }) - afterAll(() => restoreViewport()) - afterEach(cleanup) - it('keeps the latest Claude state after pagination and resets disclosure between sessions', () => { - const first = { - id: 'first-list', - role: 'assistant' as const, - timestamp: 1, - source: 'transcript' as const, - blocks: [ - { - type: 'tool-call' as const, - name: 'TodoWrite', - input: { - todos: [ - { content: 'Read', status: 'pending' }, - { content: 'Test', status: 'pending' } - ] - } - } - ] - } - const last = { - ...first, - id: 'last-list', - timestamp: 3, - blocks: [ - { type: 'text' as const, text: 'Ready for verification' }, - { - type: 'tool-call' as const, - name: 'TodoWrite', - input: { - todos: [ - { content: 'Read', status: 'completed' }, - { content: 'Test', status: 'pending' } - ] - } - } - ] - } - const { rerender } = render(transcript([last])) - fireEvent.click(screen.getByRole('button', { name: 'Tasks 1 of 2 tasks completed' })) - rerender(transcript([first, last])) - expect(screen.getAllByText('Read')).toHaveLength(2) - expect(screen.getByText('Completed Read')).toBeInTheDocument() - expect( - within( - screen.getByRole('button', { name: 'Tasks 1 of 2 tasks completed' }).parentElement! - ).getByText('Read') - ).toHaveClass('line-through') - expect(screen.getByText('Ready for verification')).toBeInTheDocument() - rerender(transcript([first], 'two')) - expect(screen.getByRole('button', { name: 'Tasks 0 of 2 tasks completed' })).toHaveAttribute( - 'aria-expanded', - 'false' - ) - expect(screen.getAllByText('Read')).toHaveLength(1) - rerender(transcript([], 'three')) - expect(screen.queryByText('Tasks')).toBeNull() - }) - }) -} - -{ - function item( - itemId: string, - body: AgentJournalItemBody, - sequence: number - ): AgentJournalRenderItem { - return { itemId, body, sequence, observedAt: sequence * 1000, revision: 1 } - } - const user = item( - 'user', - { kind: 'message', role: 'user', blocks: [{ type: 'text', text: 'Make the change' }] }, - 1 - ) - const prose = item( - 'prose', - { kind: 'message', role: 'assistant', blocks: [{ type: 'text', text: 'Updating the files.' }] }, - 2 - ) - function diff(patch = '@@ -1 +1 @@\n-before\n+after'): AgentJournalRenderItem { - return item( - 'diff', - { - kind: 'diff', - path: 'src/a.ts', - patch: { head: patch, truncated: false, digest: 'fixture', byteLength: patch.length } - }, - 3 - ) - } - function session(items: AgentJournalRenderItem[]): NativeChatLiveSession { - return { - messages: projectStructuredQuestionMessages(items), - status: 'ready', - sessionId: 'session', - agent: 'codex', - hasMore: false, - loadingEarlier: false, - olderHistoryGeneration: 0, - loadEarlier: vi.fn(), - readPhase: 'ready' - } - } - function view(items: AgentJournalRenderItem[], structured = true) { - return ( - - ) - } - - describe('turn history presentation', () => { - let restoreViewport = (): void => {} - beforeAll(() => { - restoreViewport = installNativeChatMessageListTestViewport() - }) - afterAll(() => restoreViewport()) - afterEach(() => { - cleanup() - vi.restoreAllMocks() - }) - it('renders canonical pending questions while idle and keeps resolved answers at their row', () => { - const question = item( - 'question', - { - kind: 'question', - question: 'Which branch?', - options: [{ id: 'main', label: 'main' }], - resolution: { - state: 'pending', - selectedOptionId: null, - resolvedBy: null, - resolvedAt: null - } - }, - 3 - ) - const { rerender } = render(view([user, prose, question])) - expect(screen.getByText('Awaiting user input:')).toBeInTheDocument() - expect(screen.getByText('Which branch?')).toBeInTheDocument() - expect(screen.queryByText(/request_user_input/)).toBeNull() - const settled = item( - 'question', - { - ...question.body, - kind: 'question', - question: 'Which branch?', - options: [{ id: 'main', label: 'main' }], - resolution: { - state: 'resolved', - selectedOptionId: 'main', - resolvedBy: 'desktop', - resolvedAt: 4000 - } - }, - 3 - ) - rerender(view([user, prose, settled])) - expect(screen.queryByText('Awaiting user input:')).toBeNull() - expect(screen.getByText('Asked:')).toBeInTheDocument() - expect(screen.getByText('main')).toBeInTheDocument() - }) - - it('groups pending Codex questions then narrows the awaiting count after one answer', () => { - const first = item( - 'q1', - { - kind: 'question', - question: 'Which branch?', - options: [{ id: 'main', label: 'main' }], - resolution: { - state: 'pending', - selectedOptionId: null, - resolvedBy: null, - resolvedAt: null - } - }, - 3 - ) - const second = item( - 'q2', - { - kind: 'question', - question: 'Proceed?', - options: [], - resolution: { - state: 'pending', - selectedOptionId: null, - resolvedBy: null, - resolvedAt: null - } - }, - 4 - ) - const { rerender } = render(view([user, first, second])) - expect(screen.getByText('2 questions')).toBeInTheDocument() - expect(screen.getAllByText('Awaiting user input:')).toHaveLength(1) - const answered = item( - 'q1', - { - kind: 'question', - question: 'Which branch?', - options: [{ id: 'main', label: 'main' }], - resolution: { - state: 'resolved', - selectedOptionId: 'main', - resolvedBy: 'phone', - resolvedAt: 5000 - } - }, - 3 - ) - rerender(view([user, answered, second])) - expect(screen.queryByText('2 questions')).toBeNull() - expect(screen.getByText('Proceed?')).toBeInTheDocument() - expect(screen.getByText('main')).toBeInTheDocument() - expect(screen.getAllByText('Awaiting user input:')).toHaveLength(1) - }) - - it('opens a recorded patch while completed work stays folded', () => { - render(view([user, prose, diff()])) - expect(screen.queryByText('after')).toBeNull() - fireEvent.click(screen.getByRole('button', { name: /src\/a.ts/ })) - expect(screen.getByText('after')).toBeInTheDocument() - expect(screen.getByText('before')).toBeInTheDocument() - expect(screen.getByRole('button', { name: /Edited 1 file/, expanded: false })).toBeVisible() - }) - - it('updates journal revisions and replaces flat approval text with a passive receipt', () => { - const approval = item( - 'approval', - { - kind: 'approval', - title: 'Run tests?', - detail: 'pnpm test', - options: [{ id: 'allow', label: 'Allow once' }], - resolution: { - state: 'pending', - selectedOptionId: null, - resolvedBy: null, - resolvedAt: null - } - }, - 4 - ) - const initial = [user, prose, diff(), approval] - const { rerender } = render(view(initial)) - expect(screen.queryByText('Run tests?')).toBeNull() - if (approval.body.kind !== 'approval') { - throw new Error('fixture') - } - const resolved = { - ...approval, - revision: 2, - body: { - ...approval.body, - resolution: { - state: 'resolved' as const, - selectedOptionId: 'allow', - resolvedBy: 'desktop', - resolvedAt: 5000 - } - } - } - rerender(view([user, prose, diff('@@ -0,0 +1,2 @@\n+first\n+second'), resolved])) - expect(screen.getByRole('button', { name: /src\/a.ts \+2/ })).toBeInTheDocument() - expect(screen.getByText('Run tests?')).toBeInTheDocument() - expect(screen.getByText('Allow once')).toBeInTheDocument() - expect(screen.getByText('Answered on another device')).toBeInTheDocument() - expect(screen.getByText('Resolved').closest('[data-native-chat-receipt]')).not.toBeNull() - expect(screen.queryByText('resolved')).toBeNull() - }) - }) -} diff --git a/src/renderer/src/components/native-chat/prompts/NativeChatResolvedView.prompt-card-input.test.tsx b/src/renderer/src/components/native-chat/prompts/NativeChatResolvedView.prompt-card-input.test.tsx deleted file mode 100644 index 5fcdd9f1f6b..00000000000 --- a/src/renderer/src/components/native-chat/prompts/NativeChatResolvedView.prompt-card-input.test.tsx +++ /dev/null @@ -1,140 +0,0 @@ -// @vitest-environment happy-dom - -import '@testing-library/jest-dom/vitest' - -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { act, cleanup, fireEvent, render, screen } from '@testing-library/react' -import type { AgentStatusPayload } from '../../../../../shared/agent-status/contracts/agent-status-types' -import type { NativeChatMessage } from '../../../../../shared/native-chat/native-chat-types' -import type { NativeChatLiveSession } from '../session/terminal/read/native-chat-live-session-contract' - -// The composer is a marker that counts its mounts, so the test sees whether the view remounted it. -const retained = vi.hoisted((): { session: NativeChatLiveSession | null } => ({ session: null })) -const composer = vi.hoisted(() => ({ mounts: 0 })) -const ptyInput = vi.hoisted(() => ({ verified: vi.fn<() => Promise>() })) -vi.mock('../session/terminal/read/use-native-chat-retained-session', () => ({ - useNativeChatRetainedSession: () => retained.session -})) -vi.mock('../composer/NativeChatComposer', async () => { - const { useEffect } = await import('react') - return { - NativeChatComposer: () => { - useEffect(() => { - composer.mounts += 1 - }, []) - return
- } - } -}) -vi.mock('@/runtime/hosted-terminals/input/runtime-terminal-verified-input', () => ({ - sendRuntimePtyInputVerified: ptyInput.verified -})) - -const { NativeChatResolvedView } = await import('../NativeChatResolvedView') -const { TooltipProvider } = await import('@/components/ui/tooltip') -const { nativeChatPromptDismissals } = await import('./native-chat-prompt-dismissals') -const { useAppStore } = await import('../../../store/index') -const { installNativeChatMessageListTestViewport } = - await import('../viewport/virtualization/native-chat-message-list-test-viewport') - -const paneKey = 'tab-card:leaf-card' -let restoreViewport = (): void => {} - -const userTurn: NativeChatMessage = { - id: 'user-1', - role: 'user', - blocks: [{ type: 'text', text: 'Clean the build' }], - timestamp: 1, - source: 'transcript' -} - -function transcript(): NativeChatLiveSession { - return { - messages: [userTurn], - status: 'ready', - sessionId: 'session-card', - agent: 'claude', - hookAwaitingInput: true, - hasMore: false, - loadingEarlier: false, - olderHistoryGeneration: 0, - loadEarlier: vi.fn(), - readPhase: 'ready' - } -} - -function setStatus( - payload: Omit, - stateStartedAt?: number -): void { - useAppStore - .getState() - .setAgentStatus( - paneKey, - { prompt: 'Clean the build', agentType: 'claude', ...payload }, - undefined, - stateStartedAt === undefined ? undefined : { stateStartedAt } - ) -} - -function renderPane(targetPtyId = 'pty-card'): ReturnType { - return render(paneElement(targetPtyId)) -} - -function paneElement(targetPtyId = 'pty-card'): React.JSX.Element { - return ( - - - - ) -} - -beforeEach(() => { - restoreViewport = installNativeChatMessageListTestViewport() - composer.mounts = 0 - nativeChatPromptDismissals.clearForTests() - ptyInput.verified.mockReset() - useAppStore.setState({ agentStatusByPaneKey: {}, nativeChatLaunchPromptByTabId: {} }) - retained.session = transcript() -}) - -afterEach(() => { - cleanup() - restoreViewport() - useAppStore.setState({ agentStatusByPaneKey: {}, nativeChatLaunchPromptByTabId: {} }) -}) - -// Prompt cards own terminal input because composer sends would otherwise answer the agent’s active selector. -describe('NativeChatResolvedView prompt cards own the input region', () => { - it('keeps an answered approval hidden across a chat view remount and a PTY rebind', async () => { - ptyInput.verified.mockResolvedValue(true) - setStatus({ - state: 'waiting', - interactivePrompt: JSON.stringify({ approval: { tool: 'Bash', summary: 'npm test' } }) - }) - const first = renderPane() - await act(async () => { - fireEvent.click(screen.getByRole('button', { name: 'Allow' })) - }) - // The approved tool is still running, so the host status lingers: a chat/terminal toggle. - first.unmount() - const second = renderPane() - expect(document.querySelector('[data-native-chat-approval-card="true"]')).toBeNull() - expect(screen.getByTestId('native-chat-composer').closest('[hidden]')).toBeNull() - - second.unmount() - renderPane('pty-card-reconnected') - expect(document.querySelector('[data-native-chat-approval-card="true"]')).toBeNull() - expect(ptyInput.verified).toHaveBeenCalledOnce() - }) -}) diff --git a/src/renderer/src/components/native-chat/surfaces/integration/NativeChatResolvedView.prompt-card-composer.test.tsx b/src/renderer/src/components/native-chat/surfaces/integration/NativeChatResolvedView.prompt-card-composer.test.tsx deleted file mode 100644 index 7a77586d353..00000000000 --- a/src/renderer/src/components/native-chat/surfaces/integration/NativeChatResolvedView.prompt-card-composer.test.tsx +++ /dev/null @@ -1,249 +0,0 @@ -import type * as RuntimeTerminalInputSendModule from '@/runtime/hosted-terminals/input/runtime-terminal-input-send' -import { AGENT_TUI_CLEAR_INPUT_MAX } from '../../../../../../shared/agent-launch/startup/agent-tui-input-clear' -// @vitest-environment happy-dom - -import '@testing-library/jest-dom/vitest' - -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { act, cleanup, fireEvent, render, screen } from '@testing-library/react' -import type { AgentStatusPayload } from '../../../../../../shared/agent-status/contracts/agent-status-types' -import type { NativeChatMessage } from '../../../../../../shared/native-chat/native-chat-types' -import type { NativeChatLiveSession } from '../../session/terminal/read/native-chat-live-session-contract' -import type { - NativeChatComposerHandle, - NativeChatComposerProps -} from '../../composer/native-chat-composer-types' - -import { mergeNativeChatLiveSession } from '../../../../../../shared/native-chat/native-chat-live-status' -import { clearPendingSendCacheForTests } from '../../session/terminal/delivery/native-chat-pending' - -const MESSAGE = 'please also run lint' -const retained = vi.hoisted((): { session: NativeChatLiveSession | null } => ({ session: null })) -const composer = vi.hoisted(() => ({ mounts: 0, typed: vi.fn<(text: string) => boolean>() })) -const pty = vi.hoisted(() => ({ - verified: vi.fn<(id: string, data: string) => Promise>(), - raw: vi.fn<(id: string, data: string) => boolean>() -})) -vi.mock('../../session/terminal/read/use-native-chat-retained-session', () => ({ - useNativeChatRetainedSession: () => retained.session -})) -vi.mock('@/runtime/hosted-terminals/input/runtime-terminal-input-send', async (importOriginal) => ({ - ...(await importOriginal()), - sendRuntimePtyInput: pty.raw -})) -vi.mock('@/runtime/hosted-terminals/input/runtime-terminal-verified-input', () => ({ - sendRuntimePtyInputVerified: pty.verified -})) -// Stub only the field; retain the production send lifecycle, queue and observed writes. -vi.mock('../../composer/NativeChatComposer', async () => { - const { forwardRef, useEffect, useImperativeHandle, useRef } = await import('react') - const { useNativeChatSendLifecycle } = - await import('../../session/terminal/send/use-native-chat-send-lifecycle') - const { sendNativeChatMessage } = - await import('../../session/terminal/send/native-chat-runtime-send') - return { - NativeChatComposer: forwardRef( - function StandInComposer(props, ref) { - useEffect(() => { - composer.mounts += 1 - }, []) - const fieldRef = useRef(null) - useImperativeHandle(ref, () => ({ - focus: () => { - fieldRef.current?.focus() - return true - }, - insertAgentReferences: () => false, - insertTypedText: composer.typed, - acceptsText: () => true, - appendText: () => {}, - handlePasteEvent: () => {}, - pasteFromClipboard: () => {}, - contains: () => false - })) - const lifecycle = useNativeChatSendLifecycle( - props.terminalTabId, - props.targetPtyId, - props.onOptimisticSendCanceled, - { - inputOwnedByCard: props.inputOwnedByCard === true, - onPendingSendRetired: props.optimisticSendOutcome?.reject - } - ) - const send = (): void => { - let pendingId: string | undefined - const handle = sendNativeChatMessage(props.targetPtyId ?? '', MESSAGE, { - onWriteRejected: () => { - if (pendingId) { - props.optimisticSendOutcome?.reject(pendingId) - } - } - }) - pendingId = props.onOptimisticSend?.(MESSAGE) - lifecycle.trackPendingSend(handle, pendingId) - } - return ( - <> -