diff --git a/config/flaky-test-pattern-baseline.txt b/config/flaky-test-pattern-baseline.txt index 5b3a0aab500..764a84020c1 100644 --- a/config/flaky-test-pattern-baseline.txt +++ b/config/flaky-test-pattern-baseline.txt @@ -257,7 +257,6 @@ 1 test-no-real-time-wait:src/main/windows/windows-process-tree-command-line-patch.test.ts 2 test-no-real-time-wait:src/main/windows/windows-pty-job.win32.test.ts 1 test-no-real-time-wait:src/main/worker-thread-child-process/worker-thread-child-process.test.ts -1 test-no-real-time-wait:src/main/workspaces/creation/preparation/worktree-create-preparation-cancellation.test.ts 1 test-no-real-time-wait:src/main/workspaces/removal/local-worktree-removal-recovery-live.test.ts 2 test-no-real-time-wait:src/main/wsl/execution/wsl-command-loop.test.ts 2 test-no-real-time-wait:src/main/wsl/orcad/wsl-orcad-real-distro-lane.test.ts diff --git a/config/reliability-gates.jsonc b/config/reliability-gates.jsonc index 3615e183b7f..df265c67ee6 100644 --- a/config/reliability-gates.jsonc +++ b/config/reliability-gates.jsonc @@ -4224,10 +4224,10 @@ "providers": ["remote-runtime"], "coveredPlatforms": ["macos"], "coveredProviders": ["remote-runtime"], - "coverageNotes": "Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. 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): 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: Deterministic main-IPC contract tests cover disconnect-driven close delivery, exactly-once close, per-subscription teardown isolation against a failing socket close and a throwing liveness probe, containment of a throwing renderer send on the unguarded host-close path, and continued suppression of stale payloads from a retired transport. A headed paired-server journey (real Orca host plus a separate paired Orca desktop client) covers hidden-but-mounted reveal, cold-parked reveal, and cold-parked reveal across a disconnect/reconnect. Live Linux and Windows paired-server evidence and real sleep/wake transport loss remain uncollected.", + "coverageNotes": "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. 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): 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: Deterministic main-IPC contract tests cover disconnect-driven close delivery, exactly-once close, per-subscription teardown isolation against a failing socket close and a throwing liveness probe, containment of a throwing renderer send on the unguarded host-close path, and continued suppression of stale payloads from a retired transport. A headed paired-server journey (real Orca host plus a separate paired Orca desktop client) covers hidden-but-mounted reveal, cold-parked reveal, and cold-parked reveal across a disconnect/reconnect. Live Linux and Windows paired-server evidence and real sleep/wake transport loss remain uncollected.", "motivatingLinks": ["tests/e2e/paired-remote-terminal-parked-reveal-interactivity.spec.ts"], "invariant": "Every renderer-held runtime subscription receives exactly one terminal close event when its transport is retired, including when the retirement advanced the transport generation first, and a single failing teardown never abandons that environment's remaining subscriptions nor escapes into the transport that reported the close. Payload frames from a retired transport stay suppressed. A revealed remote terminal therefore reattaches over a live multiplex connection: its buffer restores, typed input reaches the host PTY, the echo paints without a tab flip, and the PTY converges on the revealed pane grid.", - "oracle": "Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. 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): The main IPC contract test subscribes terminal.multiplex through the real handler, disconnects the environment, and asserts the renderer received exactly one {type: close} subscription event. Two isolation tests subscribe a second stream to the same environment and make the first one fail -- in its socket close, and in the liveness probe inside notifyClosed -- then assert the disconnect does not throw, both transports closed, and every close the renderer could still receive was delivered. A third drives a host-initiated close through the transport callback, which is the one notifyClosed call site with no surrounding guard, with a renderer send that throws, and asserts it cannot escape into the WebSocket close handler. A fourth test asserts that after retirement a late response frame is not forwarded and a late transport close does not re-send. The paired-server journey runs three reveal scenarios against one real host and one real paired desktop client, and for each records buffer restore, host-side receipt of the typed marker through an out-of-band host sink file, live paint without a tab flip, and PTY-versus-pane grid convergence.", + "oracle": "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. 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): The main IPC contract test subscribes terminal.multiplex through the real handler, disconnects the environment, and asserts the renderer received exactly one {type: close} subscription event. Two isolation tests subscribe a second stream to the same environment and make the first one fail -- in its socket close, and in the liveness probe inside notifyClosed -- then assert the disconnect does not throw, both transports closed, and every close the renderer could still receive was delivered. A third drives a host-initiated close through the transport callback, which is the one notifyClosed call site with no surrounding guard, with a renderer send that throws, and asserts it cannot escape into the WebSocket close handler. A fourth test asserts that after retirement a late response frame is not forwarded and a late transport close does not re-send. The paired-server journey runs three reveal scenarios against one real host and one real paired desktop client, and for each records buffer restore, host-side receipt of the typed marker through an out-of-band host sink file, live paint without a tab flip, and PTY-versus-pane grid convergence.", "commands": [ "pnpm exec vitest run --config config/vitest.config.ts", "pnpm exec playwright test tests/e2e/paired-remote-terminal-parked-reveal-interactivity.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1" @@ -4325,7 +4325,10 @@ "Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction.", "Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed.", "Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed.", - "Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed." + "Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed.", + "Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed.", + "Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed.", + "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired." ], "demotionRule": "Demote if a retired runtime transport can leave a renderer subscription without a close event, if a close is delivered more than once, if one failing teardown strands its sibling subscriptions, if payload frames from a retired transport reach the renderer, or if a revealed remote terminal can stay blank or reject input after a reconnect." }, @@ -8564,13 +8567,13 @@ "providers": ["paired-runtime", "ssh"], "coveredPlatforms": ["macos", "linux"], "coveredProviders": [], - "coverageNotes": "Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. The direct side-effect-facts selector retains six cases: replay exclusion, live sequence handling, stale disposer ownership, one handoff drain, drain-before-snapshot, and stale replacement-snapshot refusal. Successful current-entry snapshot application is not witnessed by the retained snapshot case. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2162: Reduced inventory-authority source intentionally loses the examples recorded in knownGaps; historical execution is not validation of changed bytes. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2003: Remove SSH/absent-inventory attach refusal, later-subscriber retry, no-view adoption/takeback, provider-tail/unknown-read projections, failed-keystroke retry and simpler loss reattach examples. Keep the existing-subscriber inventory-ready retry alias only at its retained callback, plus retained held-input cancellation/replacement and overlapping attach/loss fences. The inventory driver also loses the whole empty-worktree-publication registration and folder-host/unverifiable scalar examples. Retire the entire dated10-case attach receipt; retain16 independent receipts only in their original scopes. No retained-memory or real-daemon measurement follows from supplied provider inventories. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1991: Remove initial-snapshot sequence-domain, limited-tail/truncation and unknown-output-sequence aliases whose callbacks are removed. The source retains partial-chunk replay and requested-snapshot retry/admission at supplied snapshot/data seams, not equivalent replacement or measured retained-memory proof. Preserve the existing stream/pending-wait capacity aliases only to their retained owning multiplex callbacks with supplied PTY resolutions. Removing the sibling-PTY heartbeat dedup work-count sample does not establish a new decorative fanout budget; the unrelated-PTY cancellation fence survives. Preserve17 unrelated dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Remove the reasonless-close selector and narrow census aliases to actual retained runtime and injected-inventory callbacks. The removed synthetic census-dedup and isolated pre-boundary timing cases receive no replacement credit; preserve17 unrelated dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1939 (sources1934/1935): Delete the synthetic watcher-synchronization and partial-reconciliation suites. Retire all affected host-fact, capability-owner, activation-residue and retention-cap aliases because the remaining callbacks do not establish those full claims. Keep exact local hook/timer, byte-stream side effects, exit/disposal, scroll-intent cleanup and deterministic local rank/TTL progression callbacks within their mocked-host scope. No physical paired-host retention, resource budget or equivalent replacement evidence is assigned. The generic broad test command remains a runnable discovery command, never a dated execution receipt. 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): Audit1931 (sources1928/1929): Delete the complete hook-agent-status projection suite and its two behavioral assertion aliases. Supplied stored hook/title/resume/staleness/rename/question/generation/PTY-retirement/snapshot-version projections are intentionally lost. The separate osc-status-scan gate mentions this source only in existing historical notes and receives no mutation. No measured hidden-output retention, CPU/RSS or resource budget result is claimed by the deleted source or this audit. 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): Module ownership cleanup retires the modeled cold-park private watcher/render/work-count suites under the current test policy. Their assertions are no longer active evidence. Retained lifecycle tests and headed/headless journeys do not establish equivalent coverage for those removed harness alarms. 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: Audit1634 removes low-value IPC, filesystem and runtime projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite 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: 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. deletes src/renderer/src/components/terminal-pane/terminal-cold-park-verdict-loop.test.tsx: Loses modeled React oscillation alarm; real pane/watchers are not exercised. deletes src/renderer/src/runtime/remote-runtime-terminal-parse-backpressure.test.ts: Loses delayed credit until parsing, malformed frame/unknown stream handling, discarded transformed output recovery and failed ACK rearm alarms. No equivalent replacement coverage or fresh result is claimed. Historical coverage account: Audit1412 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): This audit removes the browser response-after-manual-disconnect example. Its distinct in-flight response fencing alarm is lost; retained queued-call disconnect tests are not an equivalent replacement. Historical commands and results remain historical. Deterministic headed macOS runs launch an isolated Orca desktop server and a separate paired web client. A byte-identical headless run uses an isolated `orca serve` host. Both create six real paired host PTYs with bounded high-output scrollback, prove sustained output while all six client xterms are warm-mounted but hidden causes zero renderer scheduler work, then drive 180 timed real-PTY spinner frames through a second production `session.tabs.subscribeAll` transport and the real Zustand store. Each worktree must publish and apply only its exact initial-working and final-idle titles. Both topologies ordinary-park five xterms without enabling the lossy retention budget, assert bounded cells/heap/timer lag, then restore the bounded authoritative tail exactly once on the original PTY including output produced while parked and continued input/output. The headed oracle additionally keeps every remote target workspace and terminal unmounted in the host renderer before and after client recovery. Production-parity React contracts reproduce and remove the independent cold-park watcher/title feedback loop, including memo-cache discard, StrictMode cleanup replay, detached split-PTY replacement, and the zero-park fast path. A deterministic cross-boundary contract drives 24 real PTY trackers in distinct worktrees through 2,880 decorative spinner and bare-native redraw chunks and counts host publications, serialized bytes, renderer apply calls, and store mutations while preserving exact per-PTY raw chunks and per-worktree semantic transitions. Fake-clock continuation beyond the 30-minute stale boundary requires one deduplicated refresh per worktree every 15 minutes, globally spaced by at least 50 ms, with every mirrored working status still fresh. Exact-identical Pi plus rotating normalized Pi/Grok frames renew coarse working/permission state; rich prompt/tool/question fields retain their original 30-minute lease, and `stateStartedAt`/acknowledgement identity remain stable across title/hook source swaps. A separate headed desktop-client journey relaunches the host main process while retaining the daemon and a daemon-backgrounded PTY, then requires first-observation foreground sync and continued input/output on the same PTY. Unit coverage keeps layout versions out of snapshot output high-waters when a restored snapshot has no output sequence and retries an existing subscriber only after authoritative provider inventory proves the retained PTY exists. Separate headed/headless ACK-starvation tests recover one stalled stream without replacing its PTY. A headed output-drop oracle proves a successful snapshot probe cannot certify a stale live stream when the authoritative PTY sequence advanced beyond the client high-water. Unit coverage requires an unsequenced client to establish a first-probe baseline, remain attached at the same sequence, and recover only after a later probe advances. A capability-disabled run proves legacy hosts retain the prior lossy limit/TTL fallback. Unit tests cover exact-owner capability routing, raw-stream release, singleton side-effect facts with timed handoff cleanup, 64 simultaneous synthetic-title sources with zero decorative client events after convergence, per-client late-subscribe recovery, semantic bell/title transitions, local animation-frame preservation, legacy no-output-pause delivery gating with exact snapshot restore, provider-authoritative snapshots, 128 active streams plus retry after a 129th-stream capacity rejection, capacity-pressure backoff, full split-leaf remint reconciliation, truncation, and manual-disconnect queue fencing. Linux, Windows, live SSH, and production-scale paired hosts remain gaps. The audit removed the E2E parking override/debug-handle suite. Override exposure guards, delay/retention independence, TTL filtering and debug-handle forwarding alarms are lost. Retained real parking journeys do not establish equivalent test-harness configuration coverage. The test-value audit removes separate responsive-stream, intervening-control-frame and capacity-error classification examples. Retained multiplexer checks use fake clocks and captured transport callbacks; their per-stream isolation, deadline and probe-baseline assertions do not prove an actual host restart or equivalent replacement coverage. Historical run commands and results remain historical. The test-value audit removes the standalone retained/live metadata projection and additive-preference negative example from runtime-client-events.test.ts. Its remaining case checks partial-authority event admission through a captured callback; it does not establish full-pair projection, actual peer delivery or equivalent replacement coverage. Historical commands and results remain historical. The isolated accepted-handle-events observer suite is removed. Its runtime/worktree/pane membership, once-only delivery and listener-release ledger alarms are lost. Live hidden-retention evidence does not establish equivalent observer coverage. Audit1292: The entire host-session mirror empty-inventory settle suite is removed. Live-unpublished versus genuinely-empty hydration, same-ID revision response/in-flight fencing and cleared-tracking pending-probe invalidation alarms are lost. The singleton store and inventories were mocked; no real host census or resume delivery or equivalent replacement coverage is claimed. Audit1302: src/main/runtime/session-tabs-inventory-publication.test.ts: Keep actual runtime public inventory authority across renderer epochs/resync, fallback, aborts and invalid graph publishers. Remove copied nonempty publication, private scan counters/collector and known-host replacement, fake refresh that performs the restoration itself, environment capability flag, and private resume-store characterization whose fixture supplies reservation/rollback ordering. Lose isolated refresh/churn/receiver/capability and copied-payload wiring 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. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1318: src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts: Retain real local encrypted WebSocket regressions for pre-ready socket replacement preserving a request, close-before-ready logical subscription cleanup, unrelated RPC surviving another deadline, and pending setup abort leaving a sibling pending. Host server is synthetic and uses production crypto; kept scenarios also retain internal diagnostics/memory assertions unchanged. Remove happy routing, authority-envelope, unknown-ID/log, cleanup enum, binary, keepalive/liveness and production-budget/private socket inventories; intentionally lose those alarms, no physical host authorization, independent crypto or remote provider claim. Reduced selectors need fresh validation; historical full-suite receipts do not validate the changed coverage. No equivalent replacement or physical-provider claim. Audit1346 removes the entire private-state-injected session-tabs rich-status boundary suite. Its stale task/question, neutral-title preservation, owner-change and provider-generation alarms are intentionally lost. Retained real terminal journeys do not establish equivalent replacement coverage. The prior mixed 42-contract execution receipt is historical and must not validate the reduced current selector; fresh validation remains required. 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/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. Audit1396: src/renderer/src/components/terminal-pane/terminal-parked-watcher-reconciliation.test.ts reduced. Retire standalone reconcile set output and positive untouchedFreshSpawn/workspaceOwner copying alarms; no native watcher execution 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. 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/runtime/mobile-session-tabs-agent-status-heartbeat.test.ts reduced. Loses FIFO fairness/spacing, semantic bypass/cancellation, delayed-boundary scheduling and teardown timer-cleanup alarms. Retained fixed emission cases do not replace those outcomes. No equivalent replacement coverage is claimed.", + "coverageNotes": "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. The direct side-effect-facts selector retains six cases: replay exclusion, live sequence handling, stale disposer ownership, one handoff drain, drain-before-snapshot, and stale replacement-snapshot refusal. Successful current-entry snapshot application is not witnessed by the retained snapshot case. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2162: Reduced inventory-authority source intentionally loses the examples recorded in knownGaps; historical execution is not validation of changed bytes. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2003: Remove SSH/absent-inventory attach refusal, later-subscriber retry, no-view adoption/takeback, provider-tail/unknown-read projections, failed-keystroke retry and simpler loss reattach examples. Keep the existing-subscriber inventory-ready retry alias only at its retained callback, plus retained held-input cancellation/replacement and overlapping attach/loss fences. The inventory driver also loses the whole empty-worktree-publication registration and folder-host/unverifiable scalar examples. Retire the entire dated10-case attach receipt; retain16 independent receipts only in their original scopes. No retained-memory or real-daemon measurement follows from supplied provider inventories. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1991: Remove initial-snapshot sequence-domain, limited-tail/truncation and unknown-output-sequence aliases whose callbacks are removed. The source retains partial-chunk replay and requested-snapshot retry/admission at supplied snapshot/data seams, not equivalent replacement or measured retained-memory proof. Preserve the existing stream/pending-wait capacity aliases only to their retained owning multiplex callbacks with supplied PTY resolutions. Removing the sibling-PTY heartbeat dedup work-count sample does not establish a new decorative fanout budget; the unrelated-PTY cancellation fence survives. Preserve17 unrelated dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Remove the reasonless-close selector and narrow census aliases to actual retained runtime and injected-inventory callbacks. The removed synthetic census-dedup and isolated pre-boundary timing cases receive no replacement credit; preserve17 unrelated dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1939 (sources1934/1935): Delete the synthetic watcher-synchronization and partial-reconciliation suites. Retire all affected host-fact, capability-owner, activation-residue and retention-cap aliases because the remaining callbacks do not establish those full claims. Keep exact local hook/timer, byte-stream side effects, exit/disposal, scroll-intent cleanup and deterministic local rank/TTL progression callbacks within their mocked-host scope. No physical paired-host retention, resource budget or equivalent replacement evidence is assigned. The generic broad test command remains a runnable discovery command, never a dated execution receipt. 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): Audit1931 (sources1928/1929): Delete the complete hook-agent-status projection suite and its two behavioral assertion aliases. Supplied stored hook/title/resume/staleness/rename/question/generation/PTY-retirement/snapshot-version projections are intentionally lost. The separate osc-status-scan gate mentions this source only in existing historical notes and receives no mutation. No measured hidden-output retention, CPU/RSS or resource budget result is claimed by the deleted source or this audit. 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): Module ownership cleanup retires the modeled cold-park private watcher/render/work-count suites under the current test policy. Their assertions are no longer active evidence. Retained lifecycle tests and headed/headless journeys do not establish equivalent coverage for those removed harness alarms. 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: Audit1634 removes low-value IPC, filesystem and runtime projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite 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: 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. deletes src/renderer/src/components/terminal-pane/terminal-cold-park-verdict-loop.test.tsx: Loses modeled React oscillation alarm; real pane/watchers are not exercised. deletes src/renderer/src/runtime/remote-runtime-terminal-parse-backpressure.test.ts: Loses delayed credit until parsing, malformed frame/unknown stream handling, discarded transformed output recovery and failed ACK rearm alarms. No equivalent replacement coverage or fresh result is claimed. Historical coverage account: Audit1412 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): This audit removes the browser response-after-manual-disconnect example. Its distinct in-flight response fencing alarm is lost; retained queued-call disconnect tests are not an equivalent replacement. Historical commands and results remain historical. Deterministic headed macOS runs launch an isolated Orca desktop server and a separate paired web client. A byte-identical headless run uses an isolated `orca serve` host. Both create six real paired host PTYs with bounded high-output scrollback, prove sustained output while all six client xterms are warm-mounted but hidden causes zero renderer scheduler work, then drive 180 timed real-PTY spinner frames through a second production `session.tabs.subscribeAll` transport and the real Zustand store. Each worktree must publish and apply only its exact initial-working and final-idle titles. Both topologies ordinary-park five xterms without enabling the lossy retention budget, assert bounded cells/heap/timer lag, then restore the bounded authoritative tail exactly once on the original PTY including output produced while parked and continued input/output. The headed oracle additionally keeps every remote target workspace and terminal unmounted in the host renderer before and after client recovery. Production-parity React contracts reproduce and remove the independent cold-park watcher/title feedback loop, including memo-cache discard, StrictMode cleanup replay, detached split-PTY replacement, and the zero-park fast path. A deterministic cross-boundary contract drives 24 real PTY trackers in distinct worktrees through 2,880 decorative spinner and bare-native redraw chunks and counts host publications, serialized bytes, renderer apply calls, and store mutations while preserving exact per-PTY raw chunks and per-worktree semantic transitions. Fake-clock continuation beyond the 30-minute stale boundary requires one deduplicated refresh per worktree every 15 minutes, globally spaced by at least 50 ms, with every mirrored working status still fresh. Exact-identical Pi plus rotating normalized Pi/Grok frames renew coarse working/permission state; rich prompt/tool/question fields retain their original 30-minute lease, and `stateStartedAt`/acknowledgement identity remain stable across title/hook source swaps. A separate headed desktop-client journey relaunches the host main process while retaining the daemon and a daemon-backgrounded PTY, then requires first-observation foreground sync and continued input/output on the same PTY. Unit coverage keeps layout versions out of snapshot output high-waters when a restored snapshot has no output sequence and retries an existing subscriber only after authoritative provider inventory proves the retained PTY exists. Separate headed/headless ACK-starvation tests recover one stalled stream without replacing its PTY. A headed output-drop oracle proves a successful snapshot probe cannot certify a stale live stream when the authoritative PTY sequence advanced beyond the client high-water. Unit coverage requires an unsequenced client to establish a first-probe baseline, remain attached at the same sequence, and recover only after a later probe advances. A capability-disabled run proves legacy hosts retain the prior lossy limit/TTL fallback. Unit tests cover exact-owner capability routing, raw-stream release, singleton side-effect facts with timed handoff cleanup, 64 simultaneous synthetic-title sources with zero decorative client events after convergence, per-client late-subscribe recovery, semantic bell/title transitions, local animation-frame preservation, legacy no-output-pause delivery gating with exact snapshot restore, provider-authoritative snapshots, 128 active streams plus retry after a 129th-stream capacity rejection, capacity-pressure backoff, full split-leaf remint reconciliation, truncation, and manual-disconnect queue fencing. Linux, Windows, live SSH, and production-scale paired hosts remain gaps. The audit removed the E2E parking override/debug-handle suite. Override exposure guards, delay/retention independence, TTL filtering and debug-handle forwarding alarms are lost. Retained real parking journeys do not establish equivalent test-harness configuration coverage. The test-value audit removes separate responsive-stream, intervening-control-frame and capacity-error classification examples. Retained multiplexer checks use fake clocks and captured transport callbacks; their per-stream isolation, deadline and probe-baseline assertions do not prove an actual host restart or equivalent replacement coverage. Historical run commands and results remain historical. The test-value audit removes the standalone retained/live metadata projection and additive-preference negative example from runtime-client-events.test.ts. Its remaining case checks partial-authority event admission through a captured callback; it does not establish full-pair projection, actual peer delivery or equivalent replacement coverage. Historical commands and results remain historical. The isolated accepted-handle-events observer suite is removed. Its runtime/worktree/pane membership, once-only delivery and listener-release ledger alarms are lost. Live hidden-retention evidence does not establish equivalent observer coverage. Audit1292: The entire host-session mirror empty-inventory settle suite is removed. Live-unpublished versus genuinely-empty hydration, same-ID revision response/in-flight fencing and cleared-tracking pending-probe invalidation alarms are lost. The singleton store and inventories were mocked; no real host census or resume delivery or equivalent replacement coverage is claimed. Audit1302: src/main/runtime/session-tabs-inventory-publication.test.ts: Keep actual runtime public inventory authority across renderer epochs/resync, fallback, aborts and invalid graph publishers. Remove copied nonempty publication, private scan counters/collector and known-host replacement, fake refresh that performs the restoration itself, environment capability flag, and private resume-store characterization whose fixture supplies reservation/rollback ordering. Lose isolated refresh/churn/receiver/capability and copied-payload wiring 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. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1318: src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts: Retain real local encrypted WebSocket regressions for pre-ready socket replacement preserving a request, close-before-ready logical subscription cleanup, unrelated RPC surviving another deadline, and pending setup abort leaving a sibling pending. Host server is synthetic and uses production crypto; kept scenarios also retain internal diagnostics/memory assertions unchanged. Remove happy routing, authority-envelope, unknown-ID/log, cleanup enum, binary, keepalive/liveness and production-budget/private socket inventories; intentionally lose those alarms, no physical host authorization, independent crypto or remote provider claim. Reduced selectors need fresh validation; historical full-suite receipts do not validate the changed coverage. No equivalent replacement or physical-provider claim. Audit1346 removes the entire private-state-injected session-tabs rich-status boundary suite. Its stale task/question, neutral-title preservation, owner-change and provider-generation alarms are intentionally lost. Retained real terminal journeys do not establish equivalent replacement coverage. The prior mixed 42-contract execution receipt is historical and must not validate the reduced current selector; fresh validation remains required. 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/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. Audit1396: src/renderer/src/components/terminal-pane/terminal-parked-watcher-reconciliation.test.ts reduced. Retire standalone reconcile set output and positive untouchedFreshSpawn/workspaceOwner copying alarms; no native watcher execution 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. 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/runtime/mobile-session-tabs-agent-status-heartbeat.test.ts reduced. Loses FIFO fairness/spacing, semantic bypass/cancellation, delayed-boundary scheduling and teardown timer-cleanup alarms. Retained fixed emission cases do not replace those outcomes. No equivalent replacement coverage is claimed.", "motivatingLinks": [ "https://github.com/stablyai/orca/issues/8652", "https://github.com/stablyai/orca/pull/10625" ], "invariant": "A host advertising terminal.paired-parking.v1 keeps the PTY and bounded authoritative history alive while an ordinary hidden-view park destroys the client xterm and releases its raw per-PTY stream. Reveal must restore up to the requested 5,000 rows, parked-time side effects/output, the same PTY identity, and continued input/output. Parked watcher synchronization compares parking semantics rather than fresh object identity, owns setup and cleanup across StrictMode replay, reconciles real PTY/layout changes, and performs no terminal-state scan when nothing is parked. After a host main-process relaunch, unknown local delivery-sync state must not be treated as proof that a surviving daemon PTY is already foregrounded. An empty headed session-tab inventory is authoritative only after the current renderer graph generation publishes a complete inventory and every execution host answers the PTY census; unpublished, resync-pending, transport-failed, and partially scoped inventories remain unverifiable, while genuinely authoritative empty and non-empty inventories settle and a scope-less legacy empty keeps its pre-authority best-effort settle so outdated hosts retain agent auto-resume. The unpublished-empty regression must keep the resume dispatch parked with exactly one daemon process/writer; restoring unconditional empty hydration must release one dispatch and create two live writers. If subscription precedes provider readiness, authoritative inventory must reconsider that existing subscriber without spawning, resizing, or changing reconnect state. A snapshot without an output high-water must keep it unknown rather than borrowing a layout version that can suppress newer live output. Hosts without the capability must gate hidden raw output before xterm scheduling and repaint from the authoritative snapshot on reveal while retaining the existing limit/TTL force-parking fallback. After the first semantic title state, decorative spinner frequency must add zero paired client-event frames and zero full session-tabs work between status-freshness leases regardless of hidden worktree count. Continuous working or permission evidence may refresh each affected worktree once per 15 minutes through one globally spaced FIFO so current and legacy viewers do not decay before 30 minutes; sibling PTYs share that worktree refresh, while local title animation, raw output, and semantic title, status, bell, completion, and query facts remain intact. A paired terminal stream whose delivery credits stop progressing must replace only that stream; command silence first probes authoritative state and replaces the stream if the probe times out or proves the PTY advanced beyond the client's delivered output sequence. When no comparable delivery high-water exists, the first sequenced probe establishes a baseline and only later advancement proves staleness. A same-sequence snapshot remains valid proof of a responsive silent command. A successful status probe may replace a pre-ready shared-control socket without rejecting or duplicating calls already waiting for that transport. Manual disconnect must retain pairing while preventing queued or passive calls and subscriptions from recreating transport until explicit Connect. A paired pane reconnecting to a relaunched host that has not yet published its window graph (an unpublished frame, bare or client-projected) must stay in recovery rather than retire, and the host's first published snapshot carrying the surface must reattach it; a published frame lacking the surface still retires it. The placeholder is only ever sent before the host's graph first publishes; afterwards a worktree with no tabs gets a real empty answer, pushed once to any client that asked during startup, so a paired client opening a never-opened host worktree still gets its first terminal.", - "oracle": "Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. The direct side-effect-facts selector retains six cases: replay exclusion, live sequence handling, stale disposer ownership, one handoff drain, drain-before-snapshot, and stale replacement-snapshot refusal. Successful current-entry snapshot application is not witnessed by the retained snapshot case. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2003: Remove SSH/absent-inventory attach refusal, later-subscriber retry, no-view adoption/takeback, provider-tail/unknown-read projections, failed-keystroke retry and simpler loss reattach examples. Keep the existing-subscriber inventory-ready retry alias only at its retained callback, plus retained held-input cancellation/replacement and overlapping attach/loss fences. The inventory driver also loses the whole empty-worktree-publication registration and folder-host/unverifiable scalar examples. Retire the entire dated10-case attach receipt; retain16 independent receipts only in their original scopes. No retained-memory or real-daemon measurement follows from supplied provider inventories. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1991: Remove initial-snapshot sequence-domain, limited-tail/truncation and unknown-output-sequence aliases whose callbacks are removed. The source retains partial-chunk replay and requested-snapshot retry/admission at supplied snapshot/data seams, not equivalent replacement or measured retained-memory proof. Preserve the existing stream/pending-wait capacity aliases only to their retained owning multiplex callbacks with supplied PTY resolutions. Removing the sibling-PTY heartbeat dedup work-count sample does not establish a new decorative fanout budget; the unrelated-PTY cancellation fence survives. Preserve17 unrelated dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Remove the reasonless-close selector and narrow census aliases to actual retained runtime and injected-inventory callbacks. The removed synthetic census-dedup and isolated pre-boundary timing cases receive no replacement credit; preserve17 unrelated dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1939 (sources1934/1935): Delete the synthetic watcher-synchronization and partial-reconciliation suites. Retire all affected host-fact, capability-owner, activation-residue and retention-cap aliases because the remaining callbacks do not establish those full claims. Keep exact local hook/timer, byte-stream side effects, exit/disposal, scroll-intent cleanup and deterministic local rank/TTL progression callbacks within their mocked-host scope. No physical paired-host retention, resource budget or equivalent replacement evidence is assigned. The generic broad test command remains a runnable discovery command, never a dated execution receipt. 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): Audit1931 (sources1928/1929): Delete the complete hook-agent-status projection suite and its two behavioral assertion aliases. Supplied stored hook/title/resume/staleness/rename/question/generation/PTY-retirement/snapshot-version projections are intentionally lost. The separate osc-status-scan gate mentions this source only in existing historical notes and receives no mutation. No measured hidden-output retention, CPU/RSS or resource budget result is claimed by the deleted source or this audit. 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): 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: 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): 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: Run one byte-identical six-terminal oracle against an isolated headed desktop host and an isolated headless `orca serve` host. Stage at least 1,000,000 xterm cells, hide all six warm managers, emit an initial working title followed by 30 timed real-PTY spinner frames and a final idle title per worktree, and observe a second real session-tabs subscription plus the production renderer store. Require exactly two transport envelopes and two title mutations per worktree, no decorative title crossing either boundary, and positive decoded-envelope bytes. Enable ordinary parking with the lossy retention budget disabled, require exactly one mounted manager and five parked tabs, at most 45% retained cells, no more than 16 MiB heap growth, and under 500 ms timer drift. In headed mode, require the host renderer to remain on its original workspace with zero target terminal managers mounted throughout client park, reveal, and live I/O. While a tab is parked, require authoritative terminal.read to observe new PTY output; reveal it and require the original PTY, a marker within the requested 5,000-row history, the parked marker, and post-reveal input/output. Drive 24 real PTY title trackers in distinct worktrees through 40 decorative spinner frames each, then 40 spinner frames alternating with Cursor's bare native identity redraw, using fake clocks. Require all 2,880 raw chunks exactly and zero host session-tabs publications, serialized bytes, renderer apply calls, and renderer store mutations. Continue decorative evidence beyond 30 minutes, require exactly one refresh per worktree per 15-minute lease through a FIFO spaced by at least 50 ms, and require all 24 viewer statuses to remain working and fresh; then require one exact semantic idle transition and one visible-output chunk per PTY. Require ordinary and interior-Braille title changes to publish. Drive 64 host PTYs through ten 80 ms synthetic title frames, require zero paired client events after the first frame per PTY while all 640 local frames remain observable, attach a late client and require one current frame per PTY, then require semantic bell and idle transitions on both clients. Reconstruct a legacy subscribed stream with no outputPause capability, hide a chatty pane, require no hidden xterm writes, reveal it, and require one authoritative snapshot plus continued live output. Drop and acknowledge output only for one original paired-client stream, prove the fixture process consumed input while the host model advanced and the client stayed stale, then require the command snapshot probe to replace that stream, repaint exact fixture output, preserve authoritative PTY identity and target-tab cardinality, and resume live I/O. For a client without a delivered sequence, require the first numeric probe to establish a baseline without replacement, a same-sequence probe to remain attached, and a later advanced probe to replace only that stream. Withhold the first encrypted shared-control ready frame, start one RPC, trigger a status-probe refresh, and require two connections, one host delivery, successful response, and zero retained request bytes. Admit 128 active streams, reject the 129th as retryable, release one stream, then require the retry to attach and publish a snapshot without multiplying retained subscribers. Disable terminal.paired-parking.v1 and require the same oracle to fail before parking, while the legacy limit-one fallback separately passes. Also preserve truncated first paint, ACK-starved same-PTY recovery, responsive silent-command snapshot probes, dead-stream probe timeout recovery, and queued manual-disconnect fencing.", + "oracle": "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. The direct side-effect-facts selector retains six cases: replay exclusion, live sequence handling, stale disposer ownership, one handoff drain, drain-before-snapshot, and stale replacement-snapshot refusal. Successful current-entry snapshot application is not witnessed by the retained snapshot case. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2003: Remove SSH/absent-inventory attach refusal, later-subscriber retry, no-view adoption/takeback, provider-tail/unknown-read projections, failed-keystroke retry and simpler loss reattach examples. Keep the existing-subscriber inventory-ready retry alias only at its retained callback, plus retained held-input cancellation/replacement and overlapping attach/loss fences. The inventory driver also loses the whole empty-worktree-publication registration and folder-host/unverifiable scalar examples. Retire the entire dated10-case attach receipt; retain16 independent receipts only in their original scopes. No retained-memory or real-daemon measurement follows from supplied provider inventories. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1991: Remove initial-snapshot sequence-domain, limited-tail/truncation and unknown-output-sequence aliases whose callbacks are removed. The source retains partial-chunk replay and requested-snapshot retry/admission at supplied snapshot/data seams, not equivalent replacement or measured retained-memory proof. Preserve the existing stream/pending-wait capacity aliases only to their retained owning multiplex callbacks with supplied PTY resolutions. Removing the sibling-PTY heartbeat dedup work-count sample does not establish a new decorative fanout budget; the unrelated-PTY cancellation fence survives. Preserve17 unrelated dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Remove the reasonless-close selector and narrow census aliases to actual retained runtime and injected-inventory callbacks. The removed synthetic census-dedup and isolated pre-boundary timing cases receive no replacement credit; preserve17 unrelated dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1939 (sources1934/1935): Delete the synthetic watcher-synchronization and partial-reconciliation suites. Retire all affected host-fact, capability-owner, activation-residue and retention-cap aliases because the remaining callbacks do not establish those full claims. Keep exact local hook/timer, byte-stream side effects, exit/disposal, scroll-intent cleanup and deterministic local rank/TTL progression callbacks within their mocked-host scope. No physical paired-host retention, resource budget or equivalent replacement evidence is assigned. The generic broad test command remains a runnable discovery command, never a dated execution receipt. 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): Audit1931 (sources1928/1929): Delete the complete hook-agent-status projection suite and its two behavioral assertion aliases. Supplied stored hook/title/resume/staleness/rename/question/generation/PTY-retirement/snapshot-version projections are intentionally lost. The separate osc-status-scan gate mentions this source only in existing historical notes and receives no mutation. No measured hidden-output retention, CPU/RSS or resource budget result is claimed by the deleted source or this audit. 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): 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: 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): 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: Run one byte-identical six-terminal oracle against an isolated headed desktop host and an isolated headless `orca serve` host. Stage at least 1,000,000 xterm cells, hide all six warm managers, emit an initial working title followed by 30 timed real-PTY spinner frames and a final idle title per worktree, and observe a second real session-tabs subscription plus the production renderer store. Require exactly two transport envelopes and two title mutations per worktree, no decorative title crossing either boundary, and positive decoded-envelope bytes. Enable ordinary parking with the lossy retention budget disabled, require exactly one mounted manager and five parked tabs, at most 45% retained cells, no more than 16 MiB heap growth, and under 500 ms timer drift. In headed mode, require the host renderer to remain on its original workspace with zero target terminal managers mounted throughout client park, reveal, and live I/O. While a tab is parked, require authoritative terminal.read to observe new PTY output; reveal it and require the original PTY, a marker within the requested 5,000-row history, the parked marker, and post-reveal input/output. Drive 24 real PTY title trackers in distinct worktrees through 40 decorative spinner frames each, then 40 spinner frames alternating with Cursor's bare native identity redraw, using fake clocks. Require all 2,880 raw chunks exactly and zero host session-tabs publications, serialized bytes, renderer apply calls, and renderer store mutations. Continue decorative evidence beyond 30 minutes, require exactly one refresh per worktree per 15-minute lease through a FIFO spaced by at least 50 ms, and require all 24 viewer statuses to remain working and fresh; then require one exact semantic idle transition and one visible-output chunk per PTY. Require ordinary and interior-Braille title changes to publish. Drive 64 host PTYs through ten 80 ms synthetic title frames, require zero paired client events after the first frame per PTY while all 640 local frames remain observable, attach a late client and require one current frame per PTY, then require semantic bell and idle transitions on both clients. Reconstruct a legacy subscribed stream with no outputPause capability, hide a chatty pane, require no hidden xterm writes, reveal it, and require one authoritative snapshot plus continued live output. Drop and acknowledge output only for one original paired-client stream, prove the fixture process consumed input while the host model advanced and the client stayed stale, then require the command snapshot probe to replace that stream, repaint exact fixture output, preserve authoritative PTY identity and target-tab cardinality, and resume live I/O. For a client without a delivered sequence, require the first numeric probe to establish a baseline without replacement, a same-sequence probe to remain attached, and a later advanced probe to replace only that stream. Withhold the first encrypted shared-control ready frame, start one RPC, trigger a status-probe refresh, and require two connections, one host delivery, successful response, and zero retained request bytes. Admit 128 active streams, reject the 129th as retryable, release one stream, then require the retry to attach and publish a snapshot without multiplying retained subscribers. Disable terminal.paired-parking.v1 and require the same oracle to fail before parking, while the legacy limit-one fallback separately passes. Also preserve truncated first paint, ACK-starved same-PTY recovery, responsive silent-command snapshot probes, dead-stream probe timeout recovery, and queued manual-disconnect fencing.", "commands": [ "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-unpublished-host-graph.test.ts", "ORCA_BACKGROUND_LAUNCH=1 pnpm exec playwright test tests/e2e/paired-remote-terminal-host-quit-reconnect-input.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1", @@ -9053,7 +9056,10 @@ "Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction.", "Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed.", "Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed.", - "Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed." + "Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed.", + "Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed.", + "Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed.", + "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired." ], "demotionRule": "Keep experimental or demote to protection none if decorative title frequency changes paired client-event or session-tabs publication volume after convergence, a semantic fact is dropped, paired first paint is blank, passive work reconnects after manual disconnect, a capable hidden paired manager survives ordinary parking, a legacy hidden pane schedules raw xterm output or bypasses its fallback, reveal loses requested bounded history or live PTY identity, retained buffer cells do not fall, or either headed/headless scenario flakes." }, @@ -9231,7 +9237,7 @@ "providers": ["local", "daemon", "ssh", "remote-runtime"], "coveredPlatforms": ["macos"], "coveredProviders": [], - "coverageNotes": "Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Module layout SSH policy: Retire the multiplexer private-clock saturation registration, the writer saturation transition-count registration and the changed-source dated writer/backpressure receipt. Retained byte delivery, lane order, fairness, settlement and cancellation cases are unvalidated by that historical receipt. No equivalent replacement, new execution, measured performance, live SSH/WSL or cross-platform proof is claimed. The unchanged WSL protocol receipt retains only its original command scope. Historical prior account (preserved verbatim): Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. 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): Audit2070 (sources2068/2069): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/hooks-and-hosted-review.spec'). src/main/ssh/ssh-multiplexer-transport-writer.test.ts: reports saturated epochs and their drain boundary exactly once. src/main/runtime/orca-runtime-tests/worktree-removal-archive-hook-gate.spec.ts: removes and records the waiver when the failure is explicitly overridden; removes without an override record when the hook succeeds; removes when the hook is configured but not requested; removes when no archive hook is configured; holds a desktop removal in the same repo until this one is accepted; joins a desktop removal of the same worktree accepted while this one waited. src/main/runtime/orca-runtime-tests/worktree-ps-agent-row-dismissal.spec.ts: drops the row as soon as the user dismisses it, without waiting for the PTY to exit; tells paired clients to republish on the transition and on the dismissal; rejoins a row through its %s handle after pane ownership clears. src/main/runtime/orca-runtime-tests/hooks-and-hosted-review.spec.ts: reports an error when the SSH filesystem provider is unavailable; reports an SSH orca.yaml as an error without reading any filesystem; reports ok for a local repo hook check; reads SSH issue commands as absent and drops writes without touching any filesystem; allows host integration slug helpers for SSH repos through provider-aware GitHub clients; routes runtime GitHub repo identity helpers through the selected WSL project runtime; routes runtime GitHub issue and work-item actions through the selected WSL project runtime; pins explicit origin preference on runtime open-by-number work item lookups; forwards check-details cancellation without local Git overrides. 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. The historical receipt/currentCommand selecting src/main/ssh/ssh-multiplexer-transport-writer.test.ts remains historical and is not a passing result for the reduced current command. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete the complete tail-wait memo suite: its sole current authored callback checks supplied fromTail/blocked field values. Retire all three broader memoization/equivalence/eviction assertion aliases; they are not backed by retained source callbacks. No scan-work budget, sustained output, physical terminal or resource measurement is assigned to this removed test. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1674 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: Audit1634 removes low-value IPC, filesystem and runtime projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Local macOS evidence covers main-process pending-output and projection-admission caps, saturated-tail wait detection, direct-SSH source retention/accounting, always-on V1 negotiation with legacy peer fallback, exact provider-generation pause ownership, renderer exit/data ordering, decoder input bounds, bounded reconnect scheduling, and WSL stdio transport settlement through deterministic unit contracts. A joined main/runtime oracle exercises renderer-sourced headed semantics and headless-model snapshot semantics without launching a live paired server. Separately, a macOS-hosted Docker OpenSSH run exercises only the deployed Linux relay and direct SSH provider with an exact 256 KiB source-credit plateau, concurrent PTY typing, fixed-size filesystem frames, Git churn, and owner-lease reconnect. Neither deterministic topology labels nor Docker SSH constitute live headed desktop, headless orca serve, or physical WSL evidence; local/daemon, prior-version daemons, Windows named pipes/ConPTY, folder workspaces, and mixed-version clients also remain uncovered. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", + "coverageNotes": "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Module layout SSH policy: Retire the multiplexer private-clock saturation registration, the writer saturation transition-count registration and the changed-source dated writer/backpressure receipt. Retained byte delivery, lane order, fairness, settlement and cancellation cases are unvalidated by that historical receipt. No equivalent replacement, new execution, measured performance, live SSH/WSL or cross-platform proof is claimed. The unchanged WSL protocol receipt retains only its original command scope. Historical prior account (preserved verbatim): Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. 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): Audit2070 (sources2068/2069): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/hooks-and-hosted-review.spec'). src/main/ssh/ssh-multiplexer-transport-writer.test.ts: reports saturated epochs and their drain boundary exactly once. src/main/runtime/orca-runtime-tests/worktree-removal-archive-hook-gate.spec.ts: removes and records the waiver when the failure is explicitly overridden; removes without an override record when the hook succeeds; removes when the hook is configured but not requested; removes when no archive hook is configured; holds a desktop removal in the same repo until this one is accepted; joins a desktop removal of the same worktree accepted while this one waited. src/main/runtime/orca-runtime-tests/worktree-ps-agent-row-dismissal.spec.ts: drops the row as soon as the user dismisses it, without waiting for the PTY to exit; tells paired clients to republish on the transition and on the dismissal; rejoins a row through its %s handle after pane ownership clears. src/main/runtime/orca-runtime-tests/hooks-and-hosted-review.spec.ts: reports an error when the SSH filesystem provider is unavailable; reports an SSH orca.yaml as an error without reading any filesystem; reports ok for a local repo hook check; reads SSH issue commands as absent and drops writes without touching any filesystem; allows host integration slug helpers for SSH repos through provider-aware GitHub clients; routes runtime GitHub repo identity helpers through the selected WSL project runtime; routes runtime GitHub issue and work-item actions through the selected WSL project runtime; pins explicit origin preference on runtime open-by-number work item lookups; forwards check-details cancellation without local Git overrides. 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. The historical receipt/currentCommand selecting src/main/ssh/ssh-multiplexer-transport-writer.test.ts remains historical and is not a passing result for the reduced current command. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete the complete tail-wait memo suite: its sole current authored callback checks supplied fromTail/blocked field values. Retire all three broader memoization/equivalence/eviction assertion aliases; they are not backed by retained source callbacks. No scan-work budget, sustained output, physical terminal or resource measurement is assigned to this removed test. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1674 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: Audit1634 removes low-value IPC, filesystem and runtime projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Local macOS evidence covers main-process pending-output and projection-admission caps, saturated-tail wait detection, direct-SSH source retention/accounting, always-on V1 negotiation with legacy peer fallback, exact provider-generation pause ownership, renderer exit/data ordering, decoder input bounds, bounded reconnect scheduling, and WSL stdio transport settlement through deterministic unit contracts. A joined main/runtime oracle exercises renderer-sourced headed semantics and headless-model snapshot semantics without launching a live paired server. Separately, a macOS-hosted Docker OpenSSH run exercises only the deployed Linux relay and direct SSH provider with an exact 256 KiB source-credit plateau, concurrent PTY typing, fixed-size filesystem frames, Git churn, and owner-lease reconnect. Neither deterministic topology labels nor Docker SSH constitute live headed desktop, headless orca serve, or physical WSL evidence; local/daemon, prior-version daemons, Windows named pipes/ConPTY, folder workspaces, and mixed-version clients also remain uncovered. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", "motivatingLinks": [ "https://github.com/stablyai/orca/pull/6836", "https://github.com/stablyai/orca/pull/6858", @@ -9239,7 +9245,7 @@ "https://github.com/stablyai/orca/pull/7054" ], "invariant": "High-volume terminal output must stay bounded across daemon socket writes, SSH relay writer/decoder/source retention/reconnect, main model and projection admission, runtime metadata, detectors, and tail checks, main-to-renderer in-flight bytes, renderer scheduler queues, and hidden-output restore without starving focused input. Every new SSH session offers V1 and every same-build relay supports it; legacy delivery is reachable only when capability negotiation proves the peer cannot use V1. Negotiated SSH spans remain exact and contiguous through activation, exit, cancellation, recovery, desktop projection, and required remote replacement; provisional activation data cannot project, reconnect may release it only into the exact attempt's private recovery quarantine after contract validation, and exit seals that quarantine against later same-token frames until ordered admission or exact cancellation proof. Reconnect checkpoint capture freezes exact provider-generation/PTy admission, cancels queued old work, and waits for the running raw completion before exposing its accepted checkpoint; timeout or failure detaches only that PTy's old model, makes the checkpoint unavailable, and releases the bounded fence without closing the shared provider, while the same failure outside an active exact migration remains generation-fatal and overlapping reconnects preserve any earlier outstanding fence. Pending renderer projection IDs are capped and compacted across split remainders, exit preparation owns its renderer fence through finalization, exit-time cancellation transfers published projections before proof commit, generation close fences late proof while draining exact projection waiters, closed-generation identity compacts without weakening stale rejection, canceled source-delivery retirement retains at most one ordered token per PTY, and pause/resume targets only the exact provider generation. Additional subscribers cannot stall the owner, while the required legacy primary retains backpressure.", - "oracle": "Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Module layout SSH policy: Retire the multiplexer private-clock saturation registration, the writer saturation transition-count registration and the changed-source dated writer/backpressure receipt. Retained byte delivery, lane order, fairness, settlement and cancellation cases are unvalidated by that historical receipt. No equivalent replacement, new execution, measured performance, live SSH/WSL or cross-platform proof is claimed. The unchanged WSL protocol receipt retains only its original command scope. Historical prior account (preserved verbatim): Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. 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): Audit2070 (sources2068/2069): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/hooks-and-hosted-review.spec'). src/main/ssh/ssh-multiplexer-transport-writer.test.ts: reports saturated epochs and their drain boundary exactly once. src/main/runtime/orca-runtime-tests/worktree-removal-archive-hook-gate.spec.ts: removes and records the waiver when the failure is explicitly overridden; removes without an override record when the hook succeeds; removes when the hook is configured but not requested; removes when no archive hook is configured; holds a desktop removal in the same repo until this one is accepted; joins a desktop removal of the same worktree accepted while this one waited. src/main/runtime/orca-runtime-tests/worktree-ps-agent-row-dismissal.spec.ts: drops the row as soon as the user dismisses it, without waiting for the PTY to exit; tells paired clients to republish on the transition and on the dismissal; rejoins a row through its %s handle after pane ownership clears. src/main/runtime/orca-runtime-tests/hooks-and-hosted-review.spec.ts: reports an error when the SSH filesystem provider is unavailable; reports an SSH orca.yaml as an error without reading any filesystem; reports ok for a local repo hook check; reads SSH issue commands as absent and drops writes without touching any filesystem; allows host integration slug helpers for SSH repos through provider-aware GitHub clients; routes runtime GitHub repo identity helpers through the selected WSL project runtime; routes runtime GitHub issue and work-item actions through the selected WSL project runtime; pins explicit origin preference on runtime open-by-number work item lookups; forwards check-details cancellation without local Git overrides. 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. The historical receipt/currentCommand selecting src/main/ssh/ssh-multiplexer-transport-writer.test.ts remains historical and is not a passing result for the reduced current command. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete the complete tail-wait memo suite: its sole current authored callback checks supplied fromTail/blocked field values. Retire all three broader memoization/equivalence/eviction assertion aliases; they are not backed by retained source callbacks. No scan-work budget, sustained output, physical terminal or resource measurement is assigned to this removed test. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1674 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: 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 current executable slice injects main-process renderer backlog pressure, then asserts ordinary terminal-wait detection without a joined-tail allocation and with full prompt-family continuity, per-PTY and total pending-output caps, a 1,024-ID projection cap with split-remainder compaction, preserved sequenced-tail metadata, active-pending protection ahead of background trimming, exact provider-generation pause ownership, renderer exit/data ordering, and ACK-gated in-flight bounds. The negotiation seam proves every initial connection and reconnect offers V1, the same-build relay advertises V1 without launch flags, old clients remain token-free, and method-not-found peers fall back without installing source ACK publication. The joined source-intake/multiplex oracle blocks renderer or headless serialization, admits one snapshot-covered span and one trailing span, requires replacement reservation only after the authoritative sequence is known, advances upstream ACK eligibility exactly to the covered boundary after SnapshotEnd, and delivers then ACKs the trailing span through the ordinary live path without cancellation. Source-range ledger and multiplex seams additionally require cumulative byte ACK 40 then 100 for one 100-byte frame to release exact byte credit without early source settlement, admit a contiguous higher-generation recovered token while the prior token remains unsettled, and reject stale stream or source generations without releasing in-flight byte credit. Replacement reservation rolls back every earlier span on a later failure, commit requires the exact frozen transfer states, and an authoritatively reclaimed covered span rejects commit without local trim authority while rollback removes the reservation idempotently. The exit-deadline oracle publishes a source-backed desktop projection, advances a fake clock to cancellation, and requires one projection transfer, proof commit, preparation, and final exit with no provider close, retained obligation, duplicate finalization, or process-lifetime cancellation tombstone; a second controlled proof remains pending across generation close and must never publish final exit, while both paths release the renderer preparation lease exactly once. The model-migration oracle accepts span A, blocks span B's raw emulator completion, begins disconnect migration, and proves no checkpoint or reconnect attach can remain at A; releasing B advances the exact checkpoint to B and projects B once. Its fake-clock arm reaches the 10-second deadline, requires checkpoint-unavailable, one exact model reset, zero retained admission charge and timers, and no effect from late raw settlement. Its two-PTY failure arm rejects one running raw callback under an active exact migration and requires one checkpoint-unavailable result, one model reset, zero provider closes, retained sibling checkpoint and transport liveness, zero charges and timers, and an unaffected other generation; a non-migrating sibling oracle still requires generation close. The intake additionally closes 2,048 sequential provider generations into one exact range, rejects stale events across that range, and preserves an out-of-order live gap until its own close. Direct-SSH contracts additionally prove activation-response settlement before the first source frame, claim-gated projection under same-decoder-turn response/data delivery, exact early-ACK reservation through send settlement or same-token retry, recovery completion visible before lease-held frames transfers those frames only into the private quarantine and admits no output until exact checkpoint-to-recoveryEnd coverage, invalid-checkpoint restore retention through response settlement followed by fresh-token retry and one live source frame, isolated saturated-subscriber eviction with healthy owner liveness, preserved legacy-primary backpressure, one-write ownership across write(false)/drain, control selection ahead of queued ordinary PTY input with FIFO lanes and bounded fairness, liveness rebasing, failed-exit retention through late ACK or exact recovery, response-settlement cancellation authority, token-scoped exit cancellation, exact checkpoint-to-recoveryEnd continuity, stale-owner one-shot retry, no physical PTY teardown on recovery failure, exact provider-generation closure and once-only cleanup when recovery cancellation publication or proof rejects, 16 MiB-plus-1 MiB decoder caps, charged per-PTY/session retention budgets, and eight-wide isolated reattach. The live Electron perf oracle adds hidden-output floods, renderer scheduler queue depth, dropped-output-zero normal scenarios, and active key latency budgets before promotion.", + "oracle": "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Module layout SSH policy: Retire the multiplexer private-clock saturation registration, the writer saturation transition-count registration and the changed-source dated writer/backpressure receipt. Retained byte delivery, lane order, fairness, settlement and cancellation cases are unvalidated by that historical receipt. No equivalent replacement, new execution, measured performance, live SSH/WSL or cross-platform proof is claimed. The unchanged WSL protocol receipt retains only its original command scope. Historical prior account (preserved verbatim): Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. 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): Audit2070 (sources2068/2069): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/hooks-and-hosted-review.spec'). src/main/ssh/ssh-multiplexer-transport-writer.test.ts: reports saturated epochs and their drain boundary exactly once. src/main/runtime/orca-runtime-tests/worktree-removal-archive-hook-gate.spec.ts: removes and records the waiver when the failure is explicitly overridden; removes without an override record when the hook succeeds; removes when the hook is configured but not requested; removes when no archive hook is configured; holds a desktop removal in the same repo until this one is accepted; joins a desktop removal of the same worktree accepted while this one waited. src/main/runtime/orca-runtime-tests/worktree-ps-agent-row-dismissal.spec.ts: drops the row as soon as the user dismisses it, without waiting for the PTY to exit; tells paired clients to republish on the transition and on the dismissal; rejoins a row through its %s handle after pane ownership clears. src/main/runtime/orca-runtime-tests/hooks-and-hosted-review.spec.ts: reports an error when the SSH filesystem provider is unavailable; reports an SSH orca.yaml as an error without reading any filesystem; reports ok for a local repo hook check; reads SSH issue commands as absent and drops writes without touching any filesystem; allows host integration slug helpers for SSH repos through provider-aware GitHub clients; routes runtime GitHub repo identity helpers through the selected WSL project runtime; routes runtime GitHub issue and work-item actions through the selected WSL project runtime; pins explicit origin preference on runtime open-by-number work item lookups; forwards check-details cancellation without local Git overrides. 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. The historical receipt/currentCommand selecting src/main/ssh/ssh-multiplexer-transport-writer.test.ts remains historical and is not a passing result for the reduced current command. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete the complete tail-wait memo suite: its sole current authored callback checks supplied fromTail/blocked field values. Retire all three broader memoization/equivalence/eviction assertion aliases; they are not backed by retained source callbacks. No scan-work budget, sustained output, physical terminal or resource measurement is assigned to this removed test. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1674 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: 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 current executable slice injects main-process renderer backlog pressure, then asserts ordinary terminal-wait detection without a joined-tail allocation and with full prompt-family continuity, per-PTY and total pending-output caps, a 1,024-ID projection cap with split-remainder compaction, preserved sequenced-tail metadata, active-pending protection ahead of background trimming, exact provider-generation pause ownership, renderer exit/data ordering, and ACK-gated in-flight bounds. The negotiation seam proves every initial connection and reconnect offers V1, the same-build relay advertises V1 without launch flags, old clients remain token-free, and method-not-found peers fall back without installing source ACK publication. The joined source-intake/multiplex oracle blocks renderer or headless serialization, admits one snapshot-covered span and one trailing span, requires replacement reservation only after the authoritative sequence is known, advances upstream ACK eligibility exactly to the covered boundary after SnapshotEnd, and delivers then ACKs the trailing span through the ordinary live path without cancellation. Source-range ledger and multiplex seams additionally require cumulative byte ACK 40 then 100 for one 100-byte frame to release exact byte credit without early source settlement, admit a contiguous higher-generation recovered token while the prior token remains unsettled, and reject stale stream or source generations without releasing in-flight byte credit. Replacement reservation rolls back every earlier span on a later failure, commit requires the exact frozen transfer states, and an authoritatively reclaimed covered span rejects commit without local trim authority while rollback removes the reservation idempotently. The exit-deadline oracle publishes a source-backed desktop projection, advances a fake clock to cancellation, and requires one projection transfer, proof commit, preparation, and final exit with no provider close, retained obligation, duplicate finalization, or process-lifetime cancellation tombstone; a second controlled proof remains pending across generation close and must never publish final exit, while both paths release the renderer preparation lease exactly once. The model-migration oracle accepts span A, blocks span B's raw emulator completion, begins disconnect migration, and proves no checkpoint or reconnect attach can remain at A; releasing B advances the exact checkpoint to B and projects B once. Its fake-clock arm reaches the 10-second deadline, requires checkpoint-unavailable, one exact model reset, zero retained admission charge and timers, and no effect from late raw settlement. Its two-PTY failure arm rejects one running raw callback under an active exact migration and requires one checkpoint-unavailable result, one model reset, zero provider closes, retained sibling checkpoint and transport liveness, zero charges and timers, and an unaffected other generation; a non-migrating sibling oracle still requires generation close. The intake additionally closes 2,048 sequential provider generations into one exact range, rejects stale events across that range, and preserves an out-of-order live gap until its own close. Direct-SSH contracts additionally prove activation-response settlement before the first source frame, claim-gated projection under same-decoder-turn response/data delivery, exact early-ACK reservation through send settlement or same-token retry, recovery completion visible before lease-held frames transfers those frames only into the private quarantine and admits no output until exact checkpoint-to-recoveryEnd coverage, invalid-checkpoint restore retention through response settlement followed by fresh-token retry and one live source frame, isolated saturated-subscriber eviction with healthy owner liveness, preserved legacy-primary backpressure, one-write ownership across write(false)/drain, control selection ahead of queued ordinary PTY input with FIFO lanes and bounded fairness, liveness rebasing, failed-exit retention through late ACK or exact recovery, response-settlement cancellation authority, token-scoped exit cancellation, exact checkpoint-to-recoveryEnd continuity, stale-owner one-shot retry, no physical PTY teardown on recovery failure, exact provider-generation closure and once-only cleanup when recovery cancellation publication or proof rejects, 16 MiB-plus-1 MiB decoder caps, charged per-PTY/session retention budgets, and eight-wide isolated reattach. The live Electron perf oracle adds hidden-output floods, renderer scheduler queue depth, dropped-output-zero normal scenarios, and active key latency budgets before promotion.", "commands": [ "pnpm exec vitest run --config config/vitest.config.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/construction/orca-runtime.test.ts", @@ -9394,7 +9400,10 @@ "Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction.", "Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed.", "Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed.", - "Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed." + "Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed.", + "Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed.", + "Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed.", + "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired." ], "demotionRule": "Cannot promote without metric artifacts and bounded-byte assertions." }, @@ -12097,7 +12106,7 @@ "providers": ["remote-runtime", "ssh", "local", "daemon"], "coveredPlatforms": [], "coveredProviders": [], - "coverageNotes": "Audit1400 intentionally deletes or reduces the listed sources. No fresh execution result validates their reduced selectors. Historical coverage account: Local macOS evidence covers runtime-RPC stream budgets, paired-renderer parse/discard credit, and negotiated host-side suppression for hidden paired desktop panes. Deferred credit is shared by local and remote transports, batches ACKs at 192 KiB or 4 ms, grows per-stream windows from 512 KiB to 2 MiB and aggregate windows from 2 MiB to 8 MiB, bounds queued output to 256 KiB per stream, and caps each multiplex connection at 32 active or pending streams for an 8 MiB aggregate pending-output ceiling. Deterministic tests cover replay ordering, stale generations, malformed frames, hidden panes, queue eviction, disposal, send/recovery failure, repeated pending-slot replacement, reconnect, mixed-version pause negotiation, and round-robin fairness. The opt-in benchmark models 1/20/100 ms RTT and 1/4/8 viewers, throughput, window use, completion spread and protocol-frame counts. It measures model scheduler elapsed time separately from actual @xterm/headless parser CPU/retained heap; modeled credit and ACK results do not qualify production credit enforcement. Live Android restore evidence, browser/WebGL parser measurements, and legacy JSON subscribe parity remain required. The audit removed the PTY ACK wrapper suite, which replayed credit arithmetic with mocked IPC. Its isolated wrapper alarms are no longer registered here; generic credit and runtime stream tests do not establish equivalent PTY integration coverage. The audit removes the standalone auto-settle-before-deferred-claim example. Nested-owner and claimed-child completion tests remain; they do not establish that removed timing alarm. The test-value audit removes the bulk-ACK threshold, output-pause capability/paused-input, transformed-metadata disposal, late-parser and renderer-throw examples. The retained captured-parser, malformed-frame and failed-ACK timer checks do not exercise real xterm parsing or server credit enforcement and do not replace the removed alarms. Historical run commands and results remain historical. The test-value audit removes the pure mobile stream-decision suite: pause/resume/rearm/viewport branch inventories no longer have that isolated alarm. The surviving stream-hook tests do not establish equivalent WebView restore, PTY resize, input-lease or subscription delivery coverage. Historical run commands and counts are preserved as historical records; a narrowed selector is not a new passed run. Audit1302: src/main/runtime/rpc/terminal-multiplex-ack-output-budget.test.ts: Keep production RPC dispatcher/terminal framing with emitted binary bytes, UTF-8 reconstruction and client ACK releasing genuinely withheld output; also keep the direct binary-subscribe chunk boundary. Remove shared-budget fairness matrix that sleeps real time and relies on exact synthetic per-stream window scheduling. Lose that eight-stream fairness/call wiring alarm; 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. Audit1341 scope1334 removes/narrows mobile/src/session/native-chat/use-mobile-native-chat-terminal-stream.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. 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. Audit1400: src/main/runtime/rpc/terminal-multiplex-flow-control.bench.test.ts removed. Lose ORCA_TERMINAL_PERF_BENCH diagnostic report and local xterm parser measurements; this was not an ordinary CI assertion gate. No equivalent replacement coverage is claimed.", + "coverageNotes": "Audit1400 intentionally deletes or reduces the listed sources. No fresh execution result validates their reduced selectors. Historical coverage account: Local macOS evidence covers runtime-RPC stream budgets, paired-renderer parse/discard credit, and negotiated host-side suppression for hidden paired desktop panes. Deferred credit is shared by local and remote transports, batches ACKs at 192 KiB or 4 ms, grows per-stream windows from 512 KiB to 2 MiB and aggregate windows from 2 MiB to 8 MiB, bounds queued output to 256 KiB per stream, and caps each multiplex connection at 32 active or pending streams for an 8 MiB aggregate pending-output ceiling. Deterministic tests cover replay ordering, stale generations, malformed frames, hidden panes, queue eviction, disposal, send/recovery failure, repeated pending-slot replacement, reconnect, mixed-version pause negotiation, and round-robin fairness. The opt-in benchmark models 1/20/100 ms RTT and 1/4/8 viewers, throughput, window use, completion spread and protocol-frame counts. It measures model scheduler elapsed time separately from actual @xterm/headless parser CPU/retained heap; modeled credit and ACK results do not qualify production credit enforcement. Live Android restore evidence, browser/WebGL parser measurements, and legacy JSON subscribe parity remain required. The audit removed the PTY ACK wrapper suite, which replayed credit arithmetic with mocked IPC. Its isolated wrapper alarms are no longer registered here; generic credit and runtime stream tests do not establish equivalent PTY integration coverage. The audit removes the standalone auto-settle-before-deferred-claim example. Nested-owner and claimed-child completion tests remain; they do not establish that removed timing alarm. The test-value audit removes the bulk-ACK threshold, output-pause capability/paused-input, transformed-metadata disposal, late-parser and renderer-throw examples. The retained captured-parser, malformed-frame and failed-ACK timer checks do not exercise real xterm parsing or server credit enforcement and do not replace the removed alarms. Historical run commands and results remain historical. The test-value audit removes the pure mobile stream-decision suite: pause/resume/rearm/viewport branch inventories no longer have that isolated alarm. The surviving stream-hook tests do not establish equivalent WebView restore, PTY resize, input-lease or subscription delivery coverage. Historical run commands and counts are preserved as historical records; a narrowed selector is not a new passed run. Audit1302: src/main/runtime/rpc/terminal-multiplex-ack-output-budget.test.ts: Keep production RPC dispatcher/terminal framing with emitted binary bytes, UTF-8 reconstruction and client ACK releasing genuinely withheld output; also keep the direct binary-subscribe chunk boundary. Remove shared-budget fairness matrix that sleeps real time and relies on exact synthetic per-stream window scheduling. Lose that eight-stream fairness/call wiring alarm; 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. Audit1341 scope1334 removes/narrows mobile/src/session/native-chat/use-mobile-native-chat-terminal-stream.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. 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. Audit1400: src/main/runtime/rpc/terminal-multiplex-flow-control.bench.test.ts removed. Lose ORCA_TERMINAL_PERF_BENCH diagnostic report and local xterm parser measurements; this was not an ordinary CI assertion gate. No equivalent replacement coverage is claimed. Broader617 Mobile owner follow-up retires six whole work-count/timing registrations from mobile/src/session/native-chat/use-mobile-native-chat-terminal-stream.test.ts, retaining five functional handoff/readiness/absence/recovery registrations. Prior Audit1400 retained-but-unvalidated and archived inventories describe earlier source and remain historical after this follow-up. No equivalent replacement, fresh execution, timing measurement, physical phone, or deployed mixed-host validation is claimed by this source change. Current premerge review correction for the Broader617 Mobile owner follow-up: four additional whole mock-only/mock-produced-state stream registrations are retired, for ten total cuts and one unchanged retained registration, keeps asking until a tab snapshot replaces the exhausted handle. The preceding five-retained description records the superseded candidate, not current coverage. The retained case checks the real hook-owned recovery-needed result; handoff, readiness and absence-marker mock-delivery alarms are intentionally lost without equivalent replacement. Dead test render counting and unused handoff setup are removed. No new native, physical-phone, timing or deployed-host proof is implied.", "motivatingLinks": [ "https://github.com/stablyai/orca/pull/6951", "https://github.com/stablyai/orca/pull/6955", @@ -12154,7 +12163,9 @@ "Audit1400 retained but unvalidated assertion inventory pending a new run of the reduced command:\n[\n {\n \"file\": \"src/main/runtime/rpc/terminal-subscribe-buffer.test.ts\",\n \"assertions\": [\n \"legacy binary output queued during initial snapshot serialization stays bounded\",\n \"stale mobile resize re-stream completions are dropped for legacy binary streams\",\n \"aborted stream signals do not register stale listeners\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/terminal-output-batching.test.ts\",\n \"assertions\": [\n \"desktop output bursts coalesce before stream emission\",\n \"large binary output is encoded lazily before the first output frame\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/terminal-multiplex-snapshot-serialization.test.ts\",\n \"assertions\": [\n \"requested snapshots fall back smaller when serialized data exceeds the send budget\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/terminal-multiplex-ack-output-budget.test.ts\",\n \"assertions\": [\n \"oversized live output frames are bounded for subscribed binary streams\",\n \"multibyte live output flushes when encoded bytes reach the batch budget\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/terminal-multiplex-ack-overflow-recovery.test.ts\",\n \"assertions\": [\n \"send and recovery serialization failures detach once instead of leaking credit or retrying forever\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/terminal-multiplex-pty-wait-capacity.test.ts\",\n \"assertions\": [\n \"32 active or pending slots cap aggregate queued output and repeated pending-slot subscribe cancels its older waiter\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/terminal-multiplex-output-pause-and-viewport.test.ts\",\n \"assertions\": [\n \"three negotiated hidden desktop streams emit zero output frames under sustained load while an unpaused stream remains live\",\n \"an older client that omits pause negotiation continues receiving output\"\n ]\n },\n {\n \"file\": \"src/renderer/src/components/terminal-pane/pty-connection-hidden-replay.test.ts\",\n \"assertions\": [\n \"a runtime-owned hidden pane pauses output, consumes status/title/theme facts, and keeps input writable\",\n \"reveal resumes before one authoritative snapshot and exact live output with no hidden raw write, loss, or duplication\",\n \"dispose releases pause and unregisters the fact consumer\"\n ]\n },\n {\n \"file\": \"src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-stream-reconnect.test.ts\",\n \"assertions\": [\n \"desired pause reapplies after either capability/snapshot ordering and across reconnect\",\n \"reconnect delivers each authoritative snapshot and post-resume live marker exactly once\"\n ]\n },\n {\n \"file\": \"src/renderer/src/lib/pane-manager/terminal-delivery-credit.test.ts\",\n \"assertions\": [\n \"nested synchronous deliveries restore the outer credit owner\",\n \"every claimed scheduler child must settle before the parent credits\"\n ]\n },\n {\n \"file\": \"src/renderer/src/runtime/remote-runtime-terminal-parse-backpressure.test.ts\",\n \"assertions\": [\n \"paired renderer ACK waits for the output scheduler captured parse callback before releasing encoded-byte credit\",\n \"unknown stream output is unsubscribed and malformed framing closes the connection; malformed transformed data is discarded and credited before resync\",\n \"an ACK write failure tears down the stream with zero rearmed flush timers under fake time\"\n ]\n },\n {\n \"file\": \"mobile/src/session/native-chat/use-mobile-native-chat-terminal-stream.test.ts\",\n \"assertions\": [\n \"trades a lease-only stream for output when a chat tab hands off to a terminal tab\",\n \"repairs a lease-only stream once its WebView reports ready\",\n \"stops rearming a handle whose stream never comes back (covered: %s, #10681)\",\n \"does not charge the rearm budget for a subscribe its own gates turned away\",\n \"charges the rearm budget for a subscribe the bridge refused before returning\",\n \"refills the rearm budget when terminal.list reports the handle again (covered: %s, #10681)\",\n \"does not let a dead PTY buy a new budget with its own `subscribed` ack\",\n \"refills the budget for a rearmed stream that outlives the teardown window\",\n \"keeps an absence marker observed before the budget ran out\",\n \"keeps asking until a tab snapshot replaces the exhausted handle\",\n \"resumes a cold-start lease-only stream when WebView readiness arrives late\"\n ]\n }\n]", "Audit1400 historical assertion inventory for deleted/reduced sources; not current validated assertions:\n[\n {\n \"file\": \"src/main/runtime/rpc/terminal-multiplex-flow-control.bench.test.ts\",\n \"assertions\": [\n \"the opt-in benchmark reports modeled RTT throughput, window use, protocol-frame counts and completion spread, with model scheduler elapsed time and separately measured @xterm/headless parser CPU and retained heap\"\n ]\n }\n]", "Audit1400 archived original active assertionRefs verbatim after retirement of all passed receipts:\n[\n {\n \"file\": \"src/main/runtime/rpc/terminal-subscribe-buffer.test.ts\",\n \"assertions\": [\n \"legacy binary output queued during initial snapshot serialization stays bounded\",\n \"stale mobile resize re-stream completions are dropped for legacy binary streams\",\n \"aborted stream signals do not register stale listeners\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/terminal-output-batching.test.ts\",\n \"assertions\": [\n \"desktop output bursts coalesce before stream emission\",\n \"large binary output is encoded lazily before the first output frame\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/terminal-multiplex-snapshot-serialization.test.ts\",\n \"assertions\": [\n \"requested snapshots fall back smaller when serialized data exceeds the send budget\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/terminal-multiplex-ack-output-budget.test.ts\",\n \"assertions\": [\n \"oversized live output frames are bounded for subscribed binary streams\",\n \"multibyte live output flushes when encoded bytes reach the batch budget\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/terminal-multiplex-ack-overflow-recovery.test.ts\",\n \"assertions\": [\n \"send and recovery serialization failures detach once instead of leaking credit or retrying forever\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/terminal-multiplex-pty-wait-capacity.test.ts\",\n \"assertions\": [\n \"32 active or pending slots cap aggregate queued output and repeated pending-slot subscribe cancels its older waiter\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/terminal-multiplex-output-pause-and-viewport.test.ts\",\n \"assertions\": [\n \"three negotiated hidden desktop streams emit zero output frames under sustained load while an unpaused stream remains live\",\n \"an older client that omits pause negotiation continues receiving output\"\n ]\n },\n {\n \"file\": \"src/renderer/src/components/terminal-pane/pty-connection-hidden-replay.test.ts\",\n \"assertions\": [\n \"a runtime-owned hidden pane pauses output, consumes status/title/theme facts, and keeps input writable\",\n \"reveal resumes before one authoritative snapshot and exact live output with no hidden raw write, loss, or duplication\",\n \"dispose releases pause and unregisters the fact consumer\"\n ]\n },\n {\n \"file\": \"src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-stream-reconnect.test.ts\",\n \"assertions\": [\n \"desired pause reapplies after either capability/snapshot ordering and across reconnect\",\n \"reconnect delivers each authoritative snapshot and post-resume live marker exactly once\"\n ]\n },\n {\n \"file\": \"src/renderer/src/lib/pane-manager/terminal-delivery-credit.test.ts\",\n \"assertions\": [\n \"nested synchronous deliveries restore the outer credit owner\",\n \"every claimed scheduler child must settle before the parent credits\"\n ]\n },\n {\n \"file\": \"src/renderer/src/runtime/remote-runtime-terminal-parse-backpressure.test.ts\",\n \"assertions\": [\n \"paired renderer ACK waits for the output scheduler captured parse callback before releasing encoded-byte credit\",\n \"unknown stream output is unsubscribed and malformed framing closes the connection; malformed transformed data is discarded and credited before resync\",\n \"an ACK write failure tears down the stream with zero rearmed flush timers under fake time\"\n ]\n },\n {\n \"file\": \"src/main/runtime/rpc/terminal-multiplex-flow-control.bench.test.ts\",\n \"assertions\": [\n \"the opt-in benchmark reports modeled RTT throughput, window use, protocol-frame counts and completion spread, with model scheduler elapsed time and separately measured @xterm/headless parser CPU and retained heap\"\n ]\n },\n {\n \"file\": \"mobile/src/session/native-chat/use-mobile-native-chat-terminal-stream.test.ts\",\n \"assertions\": [\n \"trades a lease-only stream for output when a chat tab hands off to a terminal tab\",\n \"repairs a lease-only stream once its WebView reports ready\",\n \"stops rearming a handle whose stream never comes back (covered: %s, #10681)\",\n \"does not charge the rearm budget for a subscribe its own gates turned away\",\n \"charges the rearm budget for a subscribe the bridge refused before returning\",\n \"refills the rearm budget when terminal.list reports the handle again (covered: %s, #10681)\",\n \"does not let a dead PTY buy a new budget with its own `subscribed` ack\",\n \"refills the budget for a rearmed stream that outlives the teardown window\",\n \"keeps an absence marker observed before the budget ran out\",\n \"keeps asking until a tab snapshot replaces the exhausted handle\",\n \"resumes a cold-start lease-only stream when WebView readiness arrives late\"\n ]\n }\n ]", - "Audit1400 archived active selectors after retirement of all passed receipts: {\"commands\":[\"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/terminal-multiplex-snapshot-serialization.test.ts src/main/runtime/rpc/terminal-multiplex-ack-output-budget.test.ts src/main/runtime/rpc/terminal-multiplex-ack-overflow-recovery.test.ts src/main/runtime/rpc/terminal-multiplex-pty-wait-capacity.test.ts src/main/runtime/rpc/terminal-multiplex-output-pause-and-viewport.test.ts --maxWorkers=1\",\"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/terminal-subscribe-buffer.test.ts src/main/runtime/rpc/terminal-output-batching.test.ts src/main/runtime/rpc/terminal-multiplex-snapshot-serialization.test.ts src/main/runtime/rpc/terminal-multiplex-ack-output-budget.test.ts src/main/runtime/rpc/terminal-multiplex-ack-overflow-recovery.test.ts src/main/runtime/rpc/terminal-multiplex-pty-wait-capacity.test.ts src/main/runtime/rpc/terminal-multiplex-output-pause-and-viewport.test.ts\",\"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/terminal-subscribe-buffer.test.ts src/main/runtime/rpc/terminal-output-batching.test.ts src/main/runtime/rpc/terminal-multiplex-snapshot-serialization.test.ts src/main/runtime/rpc/terminal-multiplex-ack-output-budget.test.ts src/main/runtime/rpc/terminal-multiplex-ack-overflow-recovery.test.ts src/main/runtime/rpc/terminal-multiplex-pty-wait-capacity.test.ts src/main/runtime/rpc/terminal-multiplex-output-pause-and-viewport.test.ts src/renderer/src/components/terminal-pane/pty-connection-hidden-replay.test.ts src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-stream-reconnect.test.ts src/renderer/src/lib/pane-manager/terminal-delivery-credit.test.ts src/renderer/src/runtime/remote-runtime-terminal-parse-backpressure.test.ts src/renderer/src/runtime/runtime-terminal-stream.test.ts --maxWorkers=1\",\"ORCA_TERMINAL_PERF_BENCH=1 pnpm exec vitest run --config config/vitest.config.ts --disableConsoleIntercept src/main/runtime/rpc/terminal-multiplex-flow-control.bench.test.ts\",\"pnpm --dir mobile exec vitest run --root .. mobile/src/session/native-chat/use-mobile-native-chat-terminal-stream.test.ts\"],\"testFiles\":[\"src/main/runtime/rpc/terminal-subscribe-buffer.test.ts\",\"src/main/runtime/rpc/terminal-output-batching.test.ts\",\"src/main/runtime/rpc/terminal-multiplex-snapshot-serialization.test.ts\",\"src/main/runtime/rpc/terminal-multiplex-ack-output-budget.test.ts\",\"src/main/runtime/rpc/terminal-multiplex-ack-overflow-recovery.test.ts\",\"src/main/runtime/rpc/terminal-multiplex-pty-wait-capacity.test.ts\",\"src/main/runtime/rpc/terminal-multiplex-output-pause-and-viewport.test.ts\",\"src/main/runtime/rpc/terminal-multiplex-flow-control.bench.test.ts\",\"src/renderer/src/components/terminal-pane/pty-connection-hidden-replay.test.ts\",\"src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-stream-reconnect.test.ts\",\"src/renderer/src/lib/pane-manager/terminal-delivery-credit.test.ts\",\"src/renderer/src/runtime/remote-runtime-terminal-parse-backpressure.test.ts\",\"src/renderer/src/runtime/runtime-terminal-stream.test.ts\",\"mobile/src/session/native-chat/use-mobile-native-chat-terminal-stream.test.ts\"]}" + "Audit1400 archived active selectors after retirement of all passed receipts: {\"commands\":[\"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/terminal-multiplex-snapshot-serialization.test.ts src/main/runtime/rpc/terminal-multiplex-ack-output-budget.test.ts src/main/runtime/rpc/terminal-multiplex-ack-overflow-recovery.test.ts src/main/runtime/rpc/terminal-multiplex-pty-wait-capacity.test.ts src/main/runtime/rpc/terminal-multiplex-output-pause-and-viewport.test.ts --maxWorkers=1\",\"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/terminal-subscribe-buffer.test.ts src/main/runtime/rpc/terminal-output-batching.test.ts src/main/runtime/rpc/terminal-multiplex-snapshot-serialization.test.ts src/main/runtime/rpc/terminal-multiplex-ack-output-budget.test.ts src/main/runtime/rpc/terminal-multiplex-ack-overflow-recovery.test.ts src/main/runtime/rpc/terminal-multiplex-pty-wait-capacity.test.ts src/main/runtime/rpc/terminal-multiplex-output-pause-and-viewport.test.ts\",\"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/terminal-subscribe-buffer.test.ts src/main/runtime/rpc/terminal-output-batching.test.ts src/main/runtime/rpc/terminal-multiplex-snapshot-serialization.test.ts src/main/runtime/rpc/terminal-multiplex-ack-output-budget.test.ts src/main/runtime/rpc/terminal-multiplex-ack-overflow-recovery.test.ts src/main/runtime/rpc/terminal-multiplex-pty-wait-capacity.test.ts src/main/runtime/rpc/terminal-multiplex-output-pause-and-viewport.test.ts src/renderer/src/components/terminal-pane/pty-connection-hidden-replay.test.ts src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-stream-reconnect.test.ts src/renderer/src/lib/pane-manager/terminal-delivery-credit.test.ts src/renderer/src/runtime/remote-runtime-terminal-parse-backpressure.test.ts src/renderer/src/runtime/runtime-terminal-stream.test.ts --maxWorkers=1\",\"ORCA_TERMINAL_PERF_BENCH=1 pnpm exec vitest run --config config/vitest.config.ts --disableConsoleIntercept src/main/runtime/rpc/terminal-multiplex-flow-control.bench.test.ts\",\"pnpm --dir mobile exec vitest run --root .. mobile/src/session/native-chat/use-mobile-native-chat-terminal-stream.test.ts\"],\"testFiles\":[\"src/main/runtime/rpc/terminal-subscribe-buffer.test.ts\",\"src/main/runtime/rpc/terminal-output-batching.test.ts\",\"src/main/runtime/rpc/terminal-multiplex-snapshot-serialization.test.ts\",\"src/main/runtime/rpc/terminal-multiplex-ack-output-budget.test.ts\",\"src/main/runtime/rpc/terminal-multiplex-ack-overflow-recovery.test.ts\",\"src/main/runtime/rpc/terminal-multiplex-pty-wait-capacity.test.ts\",\"src/main/runtime/rpc/terminal-multiplex-output-pause-and-viewport.test.ts\",\"src/main/runtime/rpc/terminal-multiplex-flow-control.bench.test.ts\",\"src/renderer/src/components/terminal-pane/pty-connection-hidden-replay.test.ts\",\"src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-stream-reconnect.test.ts\",\"src/renderer/src/lib/pane-manager/terminal-delivery-credit.test.ts\",\"src/renderer/src/runtime/remote-runtime-terminal-parse-backpressure.test.ts\",\"src/renderer/src/runtime/runtime-terminal-stream.test.ts\",\"mobile/src/session/native-chat/use-mobile-native-chat-terminal-stream.test.ts\"]}", + "Broader617 Mobile owner follow-up retires six whole work-count/timing registrations from mobile/src/session/native-chat/use-mobile-native-chat-terminal-stream.test.ts, retaining five functional handoff/readiness/absence/recovery registrations. Prior Audit1400 retained-but-unvalidated and archived inventories describe earlier source and remain historical after this follow-up. No equivalent replacement, fresh execution, timing measurement, physical phone, or deployed mixed-host validation is claimed by this source change.", + "Current premerge review correction for the Broader617 Mobile owner follow-up: four additional whole mock-only/mock-produced-state stream registrations are retired, for ten total cuts and one unchanged retained registration, keeps asking until a tab snapshot replaces the exhausted handle. The preceding five-retained description records the superseded candidate, not current coverage. The retained case checks the real hook-owned recovery-needed result; handoff, readiness and absence-marker mock-delivery alarms are intentionally lost without equivalent replacement. Dead test render counting and unused handoff setup are removed. No new native, physical-phone, timing or deployed-host proof is implied." ], "demotionRule": "Cannot promote while a supported stream path has uncapped snapshot or live-output buffering." }, @@ -12770,14 +12781,14 @@ "providers": ["local", "remote-runtime", "ssh"], "coveredPlatforms": ["macos", "linux"], "coveredProviders": ["local", "remote-runtime", "ssh"], - "coverageNotes": "Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. 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): Audit2056 (sources2054/2055): Intentionally retire these low-value alarms without replacement: src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts: delivers remote file changes to listeners for the same worktree. src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/mobile-session-tabs-part-14.spec'). src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts: arms the stale-title timer for a seeded working title; arms the Command Code scrape from the noted spawn command; prefers the tracked title over a stale renderer lastTitle in the hydration seed; writes recent output into the current runtime output map; uses a later title handler replacement with the runtime receiver; calls the current injected listener with the runtime receiver; keeps optional reconciliation lazy after its callback is removed. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-14.spec.ts: lists them, so a paired client can mirror a migrated editor; closes one by retiring it from the host session; keeps an unsaved draft unless the close is forced; shares aggregate work but leaves a replacement pending promise alone; lets a targeted refresh finish while an aggregate refresh waits; refuses a close when the store lacks %s before the guard; keeps a later missing %s on the original caught failure path. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Exact retired assertionRefs, preserved as historical objects only: {\n \"file\": \"src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts\",\n \"assertions\": [\n \"terminal watcher error and setup failure evict the shared entry before retrying callbacks run\",\n \"an old stream end cannot evict the replacement stream, which still delivers to its listener\",\n \"two same-worktree listeners share a synthetic subscription until the final stop unsubscribes and sends unwatch\"\n ]\n } Historical prior account (preserved verbatim): Audit1973: Delete the standalone mocked watcher cleanup suite and its entire sole-file prospective command. Retire the removed file-command transport-abort alias; preserve the independent cancellation suite and final-overflow/error/end cleanup callback, and13 unrelated receipt objects. Whole original changed dated receipts are retired, never narrowed or transferred. This metadata review claims no fresh execution, equivalent replacement, provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial runtime files-watch suite retains controlled Windows close-event waiting, shared-client survival, late physical-exit ownership/deadline cleanup and shutdown joining. Its combined Windows close/deadline/late-exit alias remains backed by unchanged callbacks. Retire native-error-close, pre-publication setup ownership and failed-delete rearm aliases; associated delegation, failure forwarding, removal routing and recovery examples are lost. These tests inject watch/subscription seams and do not observe an actual native watcher or physical process. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Partial runtime watcher-host suite loses mocked option/event/overflow/resubscription forwarding, supplied teardown-error propagation, aborted-signal/no-call and private ten-thousand-waiter-count inventories. Retire the 10,000-caller bound and failed-recovery-subscriber-ending assertion aliases. Keep same-root owner cancellation, pre-ready replacement, held root-close join, stale-generation recovery delivery and initial failed-root ownership mappings backed by retained real-host callbacks with injected subscription/error/physical-exit promises. No actual native watcher, process termination or resource bound was observed. 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): 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: Audit1645 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1634 removes low-value IPC, filesystem and runtime projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite 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: Audit1516 removes package-electron-runtime-contract.test.mjs, a copied release-workflow platform and marker matrix. Its workflow wiring alarm is intentionally retired; no actual packaged watcher delivery was exercised and no equivalent replacement is claimed. Unaffected dated execution receipts retain their original scope; changed optional selectors have no fresh full-gate execution result. This audit removes the paired-web stopped-during-outage and late-ready direct-branch examples. The retained pre-ready cancellation, failed-unwatch retry and replay-continuity cases are not equivalent replacements for those ordering alarms. Current web-runtime-client.test.ts assertions below name only its retained pre-ready callback case; replay cases remain in their separate suite. Historical commands and results remain historical. Deterministic tests cover one shared healthy child per runtime process plus at most four bounded fault-quarantine children, native desktop, paired-runtime, and WSL snapshot processes sharing the same eight-physical-child reservation with typed serialized event-driven capacity recovery, including recursive re-wait when crash recovery reclaims an announced slot, one quarantine attempt per watch lifetime, generation-scoped cancellation, bounded termination with removable deadline waiters, replacement-crawl errors that cannot be blessed by a late readiness ack, pre-ready paired-web cancellation registered before an unbounded capacity wait, already-resolved and late physical-exit retry of a rejected paired-web teardown, physical desktop-install and local/SSH PTY teardown, stale-generation rejection, per-child stat bounds, final-overflow RPC delivery, and renderer eviction before terminal callbacks can retry. Destructive local and SSH removal fences both ID-derived and resolved-cwd terminal roots, including sibling-root/cwd combinations with reverse admission rollback, closes descendant relay watches before parent deletion, enumerates authoritative provider/cwd ownership, falls back to daemon spawn cwd before OSC 7, and keeps daemon/relay immediate shutdown pending until native exit or a bounded fail-closed error; a dead relay PID discovered during attach also settles concurrent shutdown before its stale entry is reaped, while Windows runtime watcher deadlines retain one removable physical-close waiter, treat Node's error-close path as positive physical-exit proof, and clear root ownership on late close. The relay policy test maps a standard repository's base, Git common directory, and worktree roots to one healthy supervisor, then proves a shared-child failure recovers those roots in separate quarantine supervisors with overflow and resumed events. Abortable capacity, quarantine, runtime-root, relay, SSH, and relay pre-install setup waits attach one reaction to each shared promise and explicitly remove 10,000 cancelled caller closures while one anchor remains. Built-entry macOS harnesses kill the desktop/runtime and SSH relay watcher children, then require automatic resubscription and later events while the host process and relay PTY survive. SSH bundles the child boundary beside relay.js, requires both artifacts for install completeness, and preserves registration-owned same-root cancellation. The test-value audit corrects the active renderer watch command/file reference to the existing runtime-file-client-watch.test.ts, whose three cases are retained unchanged. They observe synthetic subscription retry/fanout and unsubscribe/unwatch calls, not actual preload/main bookkeeping or physical watcher-process cleanup. The separate read/preview client suite loses forwarding, supplied-error and negative-only examples, retaining binary detection and Unicode SVG decoding. Historical evidence commands/results are unchanged. Test-value audit1293 removes src/main/providers/local-pty/local-pty-provider-session-inventory.test.ts (2 authored cases). Their isolated assertions no longer run; surviving tests are not claimed as equivalent coverage. Fresh execution against the candidate SHA is required. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1412: src/main/workspaces/removal/watcher-removal-gate.test.ts reduced. Loses exact removal-error compatibility with renderer predicate under shared message constants. Kept public refusal outcomes do not establish that renderer classification. 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": "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. 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): Audit2056 (sources2054/2055): Intentionally retire these low-value alarms without replacement: src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts: delivers remote file changes to listeners for the same worktree. src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/mobile-session-tabs-part-14.spec'). src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts: arms the stale-title timer for a seeded working title; arms the Command Code scrape from the noted spawn command; prefers the tracked title over a stale renderer lastTitle in the hydration seed; writes recent output into the current runtime output map; uses a later title handler replacement with the runtime receiver; calls the current injected listener with the runtime receiver; keeps optional reconciliation lazy after its callback is removed. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-14.spec.ts: lists them, so a paired client can mirror a migrated editor; closes one by retiring it from the host session; keeps an unsaved draft unless the close is forced; shares aggregate work but leaves a replacement pending promise alone; lets a targeted refresh finish while an aggregate refresh waits; refuses a close when the store lacks %s before the guard; keeps a later missing %s on the original caught failure path. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Exact retired assertionRefs, preserved as historical objects only: {\n \"file\": \"src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts\",\n \"assertions\": [\n \"terminal watcher error and setup failure evict the shared entry before retrying callbacks run\",\n \"an old stream end cannot evict the replacement stream, which still delivers to its listener\",\n \"two same-worktree listeners share a synthetic subscription until the final stop unsubscribes and sends unwatch\"\n ]\n } Historical prior account (preserved verbatim): Audit1973: Delete the standalone mocked watcher cleanup suite and its entire sole-file prospective command. Retire the removed file-command transport-abort alias; preserve the independent cancellation suite and final-overflow/error/end cleanup callback, and13 unrelated receipt objects. Whole original changed dated receipts are retired, never narrowed or transferred. This metadata review claims no fresh execution, equivalent replacement, provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial runtime files-watch suite retains controlled Windows close-event waiting, shared-client survival, late physical-exit ownership/deadline cleanup and shutdown joining. Its combined Windows close/deadline/late-exit alias remains backed by unchanged callbacks. Retire native-error-close, pre-publication setup ownership and failed-delete rearm aliases; associated delegation, failure forwarding, removal routing and recovery examples are lost. These tests inject watch/subscription seams and do not observe an actual native watcher or physical process. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Partial runtime watcher-host suite loses mocked option/event/overflow/resubscription forwarding, supplied teardown-error propagation, aborted-signal/no-call and private ten-thousand-waiter-count inventories. Retire the 10,000-caller bound and failed-recovery-subscriber-ending assertion aliases. Keep same-root owner cancellation, pre-ready replacement, held root-close join, stale-generation recovery delivery and initial failed-root ownership mappings backed by retained real-host callbacks with injected subscription/error/physical-exit promises. No actual native watcher, process termination or resource bound was observed. 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): 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: Audit1645 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1634 removes low-value IPC, filesystem and runtime projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite 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: Audit1516 removes package-electron-runtime-contract.test.mjs, a copied release-workflow platform and marker matrix. Its workflow wiring alarm is intentionally retired; no actual packaged watcher delivery was exercised and no equivalent replacement is claimed. Unaffected dated execution receipts retain their original scope; changed optional selectors have no fresh full-gate execution result. This audit removes the paired-web stopped-during-outage and late-ready direct-branch examples. The retained pre-ready cancellation, failed-unwatch retry and replay-continuity cases are not equivalent replacements for those ordering alarms. Current web-runtime-client.test.ts assertions below name only its retained pre-ready callback case; replay cases remain in their separate suite. Historical commands and results remain historical. Deterministic tests cover one shared healthy child per runtime process plus at most four bounded fault-quarantine children, native desktop, paired-runtime, and WSL snapshot processes sharing the same eight-physical-child reservation with typed serialized event-driven capacity recovery, including recursive re-wait when crash recovery reclaims an announced slot, one quarantine attempt per watch lifetime, generation-scoped cancellation, bounded termination with removable deadline waiters, replacement-crawl errors that cannot be blessed by a late readiness ack, pre-ready paired-web cancellation registered before an unbounded capacity wait, already-resolved and late physical-exit retry of a rejected paired-web teardown, physical desktop-install and local/SSH PTY teardown, stale-generation rejection, per-child stat bounds, final-overflow RPC delivery, and renderer eviction before terminal callbacks can retry. Destructive local and SSH removal fences both ID-derived and resolved-cwd terminal roots, including sibling-root/cwd combinations with reverse admission rollback, closes descendant relay watches before parent deletion, enumerates authoritative provider/cwd ownership, falls back to daemon spawn cwd before OSC 7, and keeps daemon/relay immediate shutdown pending until native exit or a bounded fail-closed error; a dead relay PID discovered during attach also settles concurrent shutdown before its stale entry is reaped, while Windows runtime watcher deadlines retain one removable physical-close waiter, treat Node's error-close path as positive physical-exit proof, and clear root ownership on late close. The relay policy test maps a standard repository's base, Git common directory, and worktree roots to one healthy supervisor, then proves a shared-child failure recovers those roots in separate quarantine supervisors with overflow and resumed events. Abortable capacity, quarantine, runtime-root, relay, SSH, and relay pre-install setup waits attach one reaction to each shared promise and explicitly remove 10,000 cancelled caller closures while one anchor remains. Built-entry macOS harnesses kill the desktop/runtime and SSH relay watcher children, then require automatic resubscription and later events while the host process and relay PTY survive. SSH bundles the child boundary beside relay.js, requires both artifacts for install completeness, and preserves registration-owned same-root cancellation. The test-value audit corrects the active renderer watch command/file reference to the existing runtime-file-client-watch.test.ts, whose three cases are retained unchanged. They observe synthetic subscription retry/fanout and unsubscribe/unwatch calls, not actual preload/main bookkeeping or physical watcher-process cleanup. The separate read/preview client suite loses forwarding, supplied-error and negative-only examples, retaining binary detection and Unicode SVG decoding. Historical evidence commands/results are unchanged. Test-value audit1293 removes src/main/providers/local-pty/local-pty-provider-session-inventory.test.ts (2 authored cases). Their isolated assertions no longer run; surviving tests are not claimed as equivalent coverage. Fresh execution against the candidate SHA is required. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1412: src/main/workspaces/removal/watcher-removal-gate.test.ts reduced. Loses exact removal-error compatibility with renderer predicate under shared message constants. Kept public refusal outcomes do not establish that renderer classification. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", "motivatingLinks": [ "https://github.com/stablyai/orca/issues/5308", "https://github.com/stablyai/orca/issues/7547", "https://github.com/stablyai/orca/issues/8212" ], "invariant": "Local runtime and SSH relay roots share one watcher child per host process while healthy and use at most four quarantine children after shard failure; native desktop, paired-runtime, and direct WSL snapshot children consume the same process-wide eight-child reservation and retry transient exhaustion without permanently disabling a root. Cancellation remains owned by its child generation and settles only after acknowledgement or bounded physical exit; paired-web retains cleanup ownership and can cancel before readiness even while capacity is exhausted, retries a failed unwatch after already-resolved or late physical exit without duplicating stream termination, replacements never overlap a still-retiring generation, and aborted or timed-out callers detach immediately even while queued behind same-root relay teardown. Destructive local and SSH cleanup holds one containment-aware watcher/terminal removal fence through descendant watcher and PTY physical exit plus parent Git/filesystem deletion; daemon and relay kill requests retain ownership until the actual subprocess exit callback or an equivalent positive dead-PID proof and propagate rejected signals or a bounded failure otherwise. A crash-fused shared shard moves affected roots into the bounded quarantine pool, a second fused quarantine ends those watch lifetimes, interrupted setup emits overflow after recovery, metadata work stays bounded, and the SSH relay, PTYs, Git, and other filesystem operations never load the watcher native addon or share its fault boundary.", - "oracle": "Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. 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): Audit2056 (sources2054/2055): Intentionally retire these low-value alarms without replacement: src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts: delivers remote file changes to listeners for the same worktree. src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/mobile-session-tabs-part-14.spec'). src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts: arms the stale-title timer for a seeded working title; arms the Command Code scrape from the noted spawn command; prefers the tracked title over a stale renderer lastTitle in the hydration seed; writes recent output into the current runtime output map; uses a later title handler replacement with the runtime receiver; calls the current injected listener with the runtime receiver; keeps optional reconciliation lazy after its callback is removed. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-14.spec.ts: lists them, so a paired client can mirror a migrated editor; closes one by retiring it from the host session; keeps an unsaved draft unless the close is forced; shares aggregate work but leaves a replacement pending promise alone; lets a targeted refresh finish while an aggregate refresh waits; refuses a close when the store lacks %s before the guard; keeps a later missing %s on the original caught failure path. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Exact retired assertionRefs, preserved as historical objects only: {\n \"file\": \"src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts\",\n \"assertions\": [\n \"terminal watcher error and setup failure evict the shared entry before retrying callbacks run\",\n \"an old stream end cannot evict the replacement stream, which still delivers to its listener\",\n \"two same-worktree listeners share a synthetic subscription until the final stop unsubscribes and sends unwatch\"\n ]\n } Historical prior account (preserved verbatim): Audit1973: Delete the standalone mocked watcher cleanup suite and its entire sole-file prospective command. Retire the removed file-command transport-abort alias; preserve the independent cancellation suite and final-overflow/error/end cleanup callback, and13 unrelated receipt objects. Whole original changed dated receipts are retired, never narrowed or transferred. This metadata review claims no fresh execution, equivalent replacement, provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial runtime files-watch suite retains controlled Windows close-event waiting, shared-client survival, late physical-exit ownership/deadline cleanup and shutdown joining. Its combined Windows close/deadline/late-exit alias remains backed by unchanged callbacks. Retire native-error-close, pre-publication setup ownership and failed-delete rearm aliases; associated delegation, failure forwarding, removal routing and recovery examples are lost. These tests inject watch/subscription seams and do not observe an actual native watcher or physical process. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Partial runtime watcher-host suite loses mocked option/event/overflow/resubscription forwarding, supplied teardown-error propagation, aborted-signal/no-call and private ten-thousand-waiter-count inventories. Retire the 10,000-caller bound and failed-recovery-subscriber-ending assertion aliases. Keep same-root owner cancellation, pre-ready replacement, held root-close join, stale-generation recovery delivery and initial failed-root ownership mappings backed by retained real-host callbacks with injected subscription/error/physical-exit promises. No actual native watcher, process termination or resource bound was observed. 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): 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: 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: Fill the global watcher-child reservation, require native desktop, paired-runtime, and WSL setup to retain typed transient capacity and retry after one serialized release, then cancel pending desktop and paired-client watches and require no retry. Hold one live anchor while aborting 10,000 callers at the capacity, quarantine-assignment, runtime-root, relay-setup, and SSH-registration layers; require exactly one explicit waiter and one base-promise reaction to remain, then zero after settlement. Hold an old relay unsubscribe, queue one same-root setup leader and one anchor, then abort 10,000 joiners; require every cancellation to settle before teardown releases, exactly one anchor waiter, and only one later physical install. Advance the former paired-web callback deadline while capacity remains full, require cancellation ownership to stay live, publish the server token before ready, and require files.unwatch to abort setup before a later slot release can install a native root. Reject the first ready-watch unwatch with a physical-exit promise, resolve that exit later, and require a fresh physical unwatch attempt, registry release, and exactly one stream end. Fill one healthy shared child with multiple roots, map a standard SSH repository's base, Git common directory, and worktree roots to one relay supervisor, then inject IPC disconnect-before-exit, queued and active cancellation, operations during termination, kill-without-exit, repeated unkillable generations, initial and recovery timeouts, and shard failure. During local and SSH deletion, attempt a late terminal spawn whose worktree identity and cwd name different roots, enumerate a non-prefix remote PTY by authoritative worktree ownership, withhold daemon/relay exit callbacks, make attach positively prove a concurrent-shutdown PID dead, and make the provider unavailable; require every acquired admission to roll back on rejection, dead-PID proof to settle physical exit before reaping, timeout to retain ownership, and Git/filesystem deletion never to start. Require bounded watcher process count, physical-exit settlement, healthy-root recovery, stale-generation rejection, overflow plus later events, and fail-closed destructive cleanup. Verify relay build hashes and remote install probes require both relay.js and relay-watcher.js. Launch the built relay with a real PTY and Parcel watch, kill only the watcher child, and require the same relay PID and PTY to answer before a replacement child delivers overflow and a post-crash event.", + "oracle": "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. 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): Audit2056 (sources2054/2055): Intentionally retire these low-value alarms without replacement: src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts: delivers remote file changes to listeners for the same worktree. src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/mobile-session-tabs-part-14.spec'). src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts: arms the stale-title timer for a seeded working title; arms the Command Code scrape from the noted spawn command; prefers the tracked title over a stale renderer lastTitle in the hydration seed; writes recent output into the current runtime output map; uses a later title handler replacement with the runtime receiver; calls the current injected listener with the runtime receiver; keeps optional reconciliation lazy after its callback is removed. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-14.spec.ts: lists them, so a paired client can mirror a migrated editor; closes one by retiring it from the host session; keeps an unsaved draft unless the close is forced; shares aggregate work but leaves a replacement pending promise alone; lets a targeted refresh finish while an aggregate refresh waits; refuses a close when the store lacks %s before the guard; keeps a later missing %s on the original caught failure path. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Exact retired assertionRefs, preserved as historical objects only: {\n \"file\": \"src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts\",\n \"assertions\": [\n \"terminal watcher error and setup failure evict the shared entry before retrying callbacks run\",\n \"an old stream end cannot evict the replacement stream, which still delivers to its listener\",\n \"two same-worktree listeners share a synthetic subscription until the final stop unsubscribes and sends unwatch\"\n ]\n } Historical prior account (preserved verbatim): Audit1973: Delete the standalone mocked watcher cleanup suite and its entire sole-file prospective command. Retire the removed file-command transport-abort alias; preserve the independent cancellation suite and final-overflow/error/end cleanup callback, and13 unrelated receipt objects. Whole original changed dated receipts are retired, never narrowed or transferred. This metadata review claims no fresh execution, equivalent replacement, provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial runtime files-watch suite retains controlled Windows close-event waiting, shared-client survival, late physical-exit ownership/deadline cleanup and shutdown joining. Its combined Windows close/deadline/late-exit alias remains backed by unchanged callbacks. Retire native-error-close, pre-publication setup ownership and failed-delete rearm aliases; associated delegation, failure forwarding, removal routing and recovery examples are lost. These tests inject watch/subscription seams and do not observe an actual native watcher or physical process. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Partial runtime watcher-host suite loses mocked option/event/overflow/resubscription forwarding, supplied teardown-error propagation, aborted-signal/no-call and private ten-thousand-waiter-count inventories. Retire the 10,000-caller bound and failed-recovery-subscriber-ending assertion aliases. Keep same-root owner cancellation, pre-ready replacement, held root-close join, stale-generation recovery delivery and initial failed-root ownership mappings backed by retained real-host callbacks with injected subscription/error/physical-exit promises. No actual native watcher, process termination or resource bound was observed. 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): 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: 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: Fill the global watcher-child reservation, require native desktop, paired-runtime, and WSL setup to retain typed transient capacity and retry after one serialized release, then cancel pending desktop and paired-client watches and require no retry. Hold one live anchor while aborting 10,000 callers at the capacity, quarantine-assignment, runtime-root, relay-setup, and SSH-registration layers; require exactly one explicit waiter and one base-promise reaction to remain, then zero after settlement. Hold an old relay unsubscribe, queue one same-root setup leader and one anchor, then abort 10,000 joiners; require every cancellation to settle before teardown releases, exactly one anchor waiter, and only one later physical install. Advance the former paired-web callback deadline while capacity remains full, require cancellation ownership to stay live, publish the server token before ready, and require files.unwatch to abort setup before a later slot release can install a native root. Reject the first ready-watch unwatch with a physical-exit promise, resolve that exit later, and require a fresh physical unwatch attempt, registry release, and exactly one stream end. Fill one healthy shared child with multiple roots, map a standard SSH repository's base, Git common directory, and worktree roots to one relay supervisor, then inject IPC disconnect-before-exit, queued and active cancellation, operations during termination, kill-without-exit, repeated unkillable generations, initial and recovery timeouts, and shard failure. During local and SSH deletion, attempt a late terminal spawn whose worktree identity and cwd name different roots, enumerate a non-prefix remote PTY by authoritative worktree ownership, withhold daemon/relay exit callbacks, make attach positively prove a concurrent-shutdown PID dead, and make the provider unavailable; require every acquired admission to roll back on rejection, dead-PID proof to settle physical exit before reaping, timeout to retain ownership, and Git/filesystem deletion never to start. Require bounded watcher process count, physical-exit settlement, healthy-root recovery, stale-generation rejection, overflow plus later events, and fail-closed destructive cleanup. Verify relay build hashes and remote install probes require both relay.js and relay-watcher.js. Launch the built relay with a real PTY and Parcel watch, kill only the watcher child, and require the same relay PID and PTY to answer before a replacement child delivers overflow and a post-crash event.", "commands": [ "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-unsubscribe-timeout.test.ts --reporter=dot", "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watchers/filesystem-watcher.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-native-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-registry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-launch.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-supervisor-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/filesystem/watcher-process/runtime-watcher-pending-assignment.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/workspaces/removal/watcher-removal-gate.test.ts src/main/runtime/files/watch/orca-runtime-files-watch.test.ts src/main/runtime/workspaces/removal/worktree-teardown.test.ts src/main/runtime/construction/orca-runtime.test.ts src/main/runtime/rpc/methods/files/files.test.ts src/main/runtime/rpc/methods/files/files-watch-cancellation.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/shared/physical-exit-tracker.test.ts src/shared/promise-settlement-waiters.test.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts src/main/providers/local-pty/local-pty-provider-shutdown.test.ts src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts src/main/daemon/pty-subprocess/testing/pty-subprocess.test.ts src/main/daemon/sessions/testing/session.test.ts src/main/daemon/terminal-host/testing/terminal-host.test.ts src/main/daemon/terminal-host/testing/terminal-host-session-reaping-leak.test.ts --reporter=dot", @@ -13208,7 +13219,10 @@ "Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction.", "Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed.", "Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed.", - "Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed." + "Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed.", + "Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed.", + "Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed.", + "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired." ], "demotionRule": "Demote or quarantine if the fault harness flakes without a product or harness bug, if healthy operation exceeds one runtime watcher child, if total physical operation exceeds eight children including retiring generations, if quarantine children outlive their roots or repeat after fusing, if event delivery becomes unbounded, or if metadata/stat work returns to the serve process." }, @@ -14452,10 +14466,10 @@ "providers": ["paired-runtime"], "coveredPlatforms": ["linux"], "coveredProviders": ["paired-runtime"], - "coverageNotes": "Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. 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): Audit1579 removes workflow/manifest/regex/private binary-header and diagnostic metric inventories, fixture selectors, injected forwarding/platform/signature/process examples, unproven overlap and internal churn counters without equivalent replacement coverage. Retains actual Git trust/diffs; filesystem hash/ELF-region/native discovery; child CLI module repair; compiler/lock/publication/rollback and synthetic Electron install/cache ownership; executable shell quoting/exit; controlled notary/timer cleanup; local patched extractor file/AST freshness; real Chromium/WebKit CSP/sandbox/HTTPS image/referrer/link/preservation controls under parsed Android headers. Five unchanged setup-pnpm/VM request-cleanup definitions reviewed and not rerun. GitHub, installer/archive, OS metric, client, native delegate, compressor, builder and Apple boundaries injected or absent where recorded. No actual native PTY, shipped full/native app, real Actions/cache/npm signature authority, downloaded Electron archive, real objdump/linker/native CLI/AppImage, signing/NSIS/notary/upload/updater or live freeze proof. Historical scope before this audit: Published Linux 1.4.188 desktop against current source in both directions; scheduled weekly and manually runnable. No required PR check.", + "coverageNotes": "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. 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): Audit1579 removes workflow/manifest/regex/private binary-header and diagnostic metric inventories, fixture selectors, injected forwarding/platform/signature/process examples, unproven overlap and internal churn counters without equivalent replacement coverage. Retains actual Git trust/diffs; filesystem hash/ELF-region/native discovery; child CLI module repair; compiler/lock/publication/rollback and synthetic Electron install/cache ownership; executable shell quoting/exit; controlled notary/timer cleanup; local patched extractor file/AST freshness; real Chromium/WebKit CSP/sandbox/HTTPS image/referrer/link/preservation controls under parsed Android headers. Five unchanged setup-pnpm/VM request-cleanup definitions reviewed and not rerun. GitHub, installer/archive, OS metric, client, native delegate, compressor, builder and Apple boundaries injected or absent where recorded. No actual native PTY, shipped full/native app, real Actions/cache/npm signature authority, downloaded Electron archive, real objdump/linker/native CLI/AppImage, signing/NSIS/notary/upload/updater or live freeze proof. Historical scope before this audit: Published Linux 1.4.188 desktop against current source in both directions; scheduled weekly and manually runnable. No required PR check.", "motivatingLinks": ["https://github.com/stablyai/orca/actions/runs/34069063016"], "invariant": "A paired client and host without client-hosted browser capabilities retain server-hosted browser placement across supported version skew.", - "oracle": "Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. 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): Require both existing named browser placement scenarios to pass three times with one attempt, zero skips, zero failures, and no report errors.", + "oracle": "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. 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): Require both existing named browser placement scenarios to pass three times with one attempt, zero skips, zero failures, and no report errors.", "commands": [ "gh workflow run packaged-browser-e2e.yml", "pnpm exec playwright test tests/e2e/packaged-mixed-version-browser-placement.spec.ts --config tests/playwright.config.ts --project=electron-headless --workers=1 --repeat-each=3 --retries=0", @@ -14534,7 +14548,10 @@ "Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction.", "Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed.", "Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed.", - "Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed." + "Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed.", + "Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed.", + "Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed.", + "Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired." ], "demotionRule": "Keep experimental if any direction skips or fails; do not extend timeouts or retry to green." }, diff --git a/config/scripts/static-analysis/ratchets/renderer-state/check-tab-map-seam-ratchet.test.mjs b/config/scripts/static-analysis/ratchets/renderer-state/check-tab-map-seam-ratchet.test.mjs deleted file mode 100644 index 7f4a6dfb6b1..00000000000 --- a/config/scripts/static-analysis/ratchets/renderer-state/check-tab-map-seam-ratchet.test.mjs +++ /dev/null @@ -1,87 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { CONSUMERS, consumerViolations, writerViolations } from './check-tab-map-seam-ratchet.mjs' - -const BRIDGE = - 'src/renderer/src/components/native-chat/session/status/StructuredAgentSessionStatusBridge.tsx' -const rules = CONSUMERS.get(BRIDGE) - -describe('tab-map seam guard', () => { - it('rejects an ordinary handler reaching the cold path or walking a map', () => { - const text = [ - 'const reconcileFromSnapshot = () => getStructuredAgentSessionTabs(source)', - 'const reconcile = () => reconcileFromSnapshot()', - 'const ordinary = () => { reconcileFromSnapshot(); Object.keys(source) }' - ].join('\n') - expect(consumerViolations('bridge.tsx', text, rules)).toEqual([ - 'bridge.tsx:3 reconcileFromSnapshot() outside a named cold path', - 'bridge.tsx:3 Object.keys outside a named cold path' - ]) - }) - - it('rejects an unreviewed value import, not type imports', () => { - const text = [ - "import { wholeMap } from './new-walk'", - "import type { Walk } from './new-walk'" - ].join('\n') - expect(consumerViolations('bridge.tsx', text, rules)).toEqual([ - 'bridge.tsx:1 imports wholeMap; repaired consumers import only reviewed helpers' - ]) - }) - - it('follows a raw record through a local binding unless it is marked full resync', () => { - const text = [ - 'function raw(state) {', - ' const next = { ...state.unifiedTabsByWorktree, [id]: tabs }', - ' set({ unifiedTabsByWorktree: next })', - '}', - 'function annotated(state) {', - ' const next = { ...state.unifiedTabsByWorktree, [id]: tabs }', - ' markFullResync(next, "hydration")', - ' set({ unifiedTabsByWorktree: next })', - '}' - ].join('\n') - expect(writerViolations('writer.ts', text)).toEqual([ - 'writer.ts:3 raw unifiedTabsByWorktree record; build it with a replace helper or draft, or mark it full resync' - ]) - }) - - it('follows aliases of cold helpers and enumerators', () => { - const text = [ - 'const reconcileFromSnapshot = () => getStructuredAgentSessionTabs(source)', - 'const reconcile = () => reconcileFromSnapshot()', - 'const resync = reconcileFromSnapshot', - 'const keys = Object.keys' - ].join('\n') - expect(consumerViolations('bridge.tsx', text, rules)).toEqual([ - 'bridge.tsx:3 reconcileFromSnapshot() outside a named cold path', - 'bridge.tsx:4 Object.keys outside a named cold path' - ]) - }) - - it('follows aliased raw records and requires annotation before publication', () => { - const raw = - 'raw unifiedTabsByWorktree record; build it with a replace helper or draft, or mark it full resync' - const text = [ - 'function aliased(state) {', - ' const next = { ...state.unifiedTabsByWorktree, [id]: tabs }', - ' const unifiedTabsByWorktree = next', - ' set({ unifiedTabsByWorktree })', - '}', - 'function late(state) {', - ' const next = { ...state.unifiedTabsByWorktree, [id]: tabs }', - ' set({ unifiedTabsByWorktree: next })', - ' markFullResync(next, "hydration")', - '}', - 'function early(state) {', - ' const next = { ...state.unifiedTabsByWorktree, [id]: tabs }', - ' const alias = next', - ' markFullResync(alias, "hydration")', - ' set({ unifiedTabsByWorktree: alias })', - '}' - ].join('\n') - expect(writerViolations('writer.ts', text)).toEqual([ - `writer.ts:4 ${raw}`, - `writer.ts:8 ${raw}` - ]) - }) -}) diff --git a/config/scripts/test-runtime/sqlite-admission/vitest-node-runtime-files.mjs b/config/scripts/test-runtime/sqlite-admission/vitest-node-runtime-files.mjs index 784ad9f736e..5688b10b0f9 100644 --- a/config/scripts/test-runtime/sqlite-admission/vitest-node-runtime-files.mjs +++ b/config/scripts/test-runtime/sqlite-admission/vitest-node-runtime-files.mjs @@ -170,7 +170,8 @@ const NODE_RUNTIME_INCLUDE = [ 'config/scripts/orcad-distribution/server-bundle/profile-state-worker-smoke.test.mjs', 'config/scripts/desktop-distribution/runtime-verification/process-host-dev-rebuild.test.ts', 'config/scripts/test-runtime/node-worker/vitest-node-runtime-pool.test.ts', - // Reopen the WAL-backed dismissal cache read-only through the row cache, which Bun on macOS cannot. + // Reopen WAL-backed row caches read-only, which Bun on macOS cannot. + 'src/main/agent-hooks/server/testing/identity/server-hook-session-binding.test.ts', 'src/main/runtime/push/notifications/mobile-notification-dismissal-store.test.ts', 'src/main/runtime/push/notifications/mobile-notification-dismissal-read-failure.test.ts', 'src/main/ipc/notifications-subject-retirement.test.ts', diff --git a/mobile/src/agent-history/mobile-ai-vault-resume-operations.ts b/mobile/src/agent-history/mobile-ai-vault-resume-operations.ts index e3a0dbc0ef2..879c6fde5e3 100644 --- a/mobile/src/agent-history/mobile-ai-vault-resume-operations.ts +++ b/mobile/src/agent-history/mobile-ai-vault-resume-operations.ts @@ -4,7 +4,6 @@ import '../files/mobile-file-preview-operations' import { aiVaultResumePreparationSchema } from './mobile-ai-vault-resume-reply-schema' import '../browser/mobile-session-browser-reply-schema' import '../files/session-documents/mobile-file-tap-reply-schema' -import '../transport/rpc/rpc-uninterpreted-reply-schemas' // Legacy resume reads unsupported-method refusals raw to fall back to shared home. export const aiVaultResumePreparationRun = bindDeferredRpcOperation( diff --git a/mobile/src/browser/mobile-session-browser-operations.ts b/mobile/src/browser/mobile-session-browser-operations.ts index 597ef6fac7a..2dee93227b4 100644 --- a/mobile/src/browser/mobile-session-browser-operations.ts +++ b/mobile/src/browser/mobile-session-browser-operations.ts @@ -4,7 +4,6 @@ import '../files/mobile-file-preview-operations' import { browserTabCreatedSchema } from './mobile-session-browser-reply-schema' import '../agent-history/mobile-ai-vault-resume-reply-schema' import '../files/session-documents/mobile-file-tap-reply-schema' -import '../transport/rpc/rpc-uninterpreted-reply-schemas' export const sessionBrowserTabCreate = bindDeferredRpcOperation( defineRpcOperation({ diff --git a/mobile/src/components/use-new-workspace-repositories.test.ts b/mobile/src/components/use-new-workspace-repositories.test.ts index 14196e03e81..09ada54c9cf 100644 --- a/mobile/src/components/use-new-workspace-repositories.test.ts +++ b/mobile/src/components/use-new-workspace-repositories.test.ts @@ -44,31 +44,25 @@ afterEach(async () => { }) describe('useNewWorkspaceRepositories initial repo', () => { - it.each([ - { order: 'desktop first', desktopFirst: true }, - { order: 'server first', desktopFirst: false } - ])( - 'picks the named host’s copy of a repo id two hosts share ($order)', - async ({ desktopFirst }) => { - const client = desktopListing(desktopFirst ? [repo()] : []) - let picked: MobileWorkspaceRepo | null = null - mounted = hookMount(() => { - picked = useNewWorkspaceRepositories({ - client, - hostId: 'host-1', - visible: true, - initialRepo: { id: 'api', executionHostId: SERVER } - }).selectedRepo - }) - mounted.mount() - await settleQueryNotifications() - // The desktop's same-id repo must not stand in while the server's listing is on its way. - expect(picked).toBeNull() + it('picks the named host’s copy of a repo id two hosts share', async () => { + const client = desktopListing([repo()]) + let picked: MobileWorkspaceRepo | null = null + mounted = hookMount(() => { + picked = useNewWorkspaceRepositories({ + client, + hostId: 'host-1', + visible: true, + initialRepo: { id: 'api', executionHostId: SERVER } + }).selectedRepo + }) + mounted.mount() + await settleQueryNotifications() + // The desktop's same-id repo must not stand in while the server's listing is on its way. + expect(picked).toBeNull() - servers.repos = new Map([[SERVER, [repo(SERVER)]]]) - act(() => mounted?.update()) - await settleQueryNotifications() - expect(picked).toMatchObject({ id: 'api', executionHostId: SERVER }) - } - ) + servers.repos = new Map([[SERVER, [repo(SERVER)]]]) + act(() => mounted?.update()) + await settleQueryNotifications() + expect(picked).toMatchObject({ id: 'api', executionHostId: SERVER }) + }) }) diff --git a/mobile/src/files/native-chat-file-search-operations.ts b/mobile/src/files/native-chat-file-search-operations.ts index 44192e60de9..8f39e7d5873 100644 --- a/mobile/src/files/native-chat-file-search-operations.ts +++ b/mobile/src/files/native-chat-file-search-operations.ts @@ -2,13 +2,6 @@ import { bindDeferredRpcOperation, defineRpcOperation } from '../transport/rpc/r import { rpcResultVariant } from '../transport/rpc/rpc-operation-result-reader' import '../terminal/terminal-reply-schema' import { workspaceFilePathsSchema } from './workspace-file-paths-reply-schema' -import '../session/agent-launch/mobile-agent-detection-reply-schema' -import './session-documents/mobile-markdown-tab-reply-schema' -import '../transport/rpc/rpc-uninterpreted-reply-schemas' -import '../terminal/session/mobile-session-terminal-reply-schema' -import '../worktree/session-worktree-record-reply-schema' -import '../session/native-chat/composer/mobile-native-chat-skill-reply-schema' -import '../terminal/quick-commands/mobile-quick-command-reply-schema' // Skip refusals to retain suggestions; inspect method_not_found first to fall back from search to inventory. export const nativeChatFileSearchRead = bindDeferredRpcOperation( diff --git a/mobile/src/files/session-documents/mobile-file-tap-operations.ts b/mobile/src/files/session-documents/mobile-file-tap-operations.ts index ce347a864c1..d4da628703a 100644 --- a/mobile/src/files/session-documents/mobile-file-tap-operations.ts +++ b/mobile/src/files/session-documents/mobile-file-tap-operations.ts @@ -4,7 +4,6 @@ import '../mobile-file-preview-operations' import { fileTapOpenedSchema } from './mobile-file-tap-reply-schema' import '../../agent-history/mobile-ai-vault-resume-reply-schema' import '../../browser/mobile-session-browser-reply-schema' -import '../../transport/rpc/rpc-uninterpreted-reply-schemas' // Best-effort taps skip refused opens; explicit Changes-screen opens instead show the host error. export const fileTapOpenRun = bindDeferredRpcOperation( diff --git a/mobile/src/files/session-documents/mobile-markdown-tab-operations.ts b/mobile/src/files/session-documents/mobile-markdown-tab-operations.ts index 6978b9515cf..2d3d4a336d6 100644 --- a/mobile/src/files/session-documents/mobile-markdown-tab-operations.ts +++ b/mobile/src/files/session-documents/mobile-markdown-tab-operations.ts @@ -19,13 +19,6 @@ export const sessionMarkdownNoteCreate = bindDeferredRpcOperation( import '../../terminal/terminal-reply-schema' import { markdownTabDocumentSchema } from './mobile-markdown-tab-reply-schema' -import '../../session/agent-launch/mobile-agent-detection-reply-schema' - -import '../../terminal/session/mobile-session-terminal-reply-schema' -import '../../worktree/session-worktree-record-reply-schema' -import '../../session/native-chat/composer/mobile-native-chat-skill-reply-schema' -import '../../terminal/quick-commands/mobile-quick-command-reply-schema' -import '../workspace-file-paths-reply-schema' // Inspect renderer_unavailable before interpretation so headless hosts can fall back to disk. export const markdownTabRead = bindDeferredRpcOperation( @@ -38,8 +31,6 @@ export const markdownTabRead = bindDeferredRpcOperation( }) ) -import '../../session/tabs/mobile-session-tab-write-reply-schema' - import '../../terminal/quick-commands/mobile-quick-command-operations' export const markdownTabSave = bindDeferredRpcOperation( diff --git a/mobile/src/i18n/locales/de.json b/mobile/src/i18n/locales/de.json index ab13aa29c12..4ace38e5fa1 100644 --- a/mobile/src/i18n/locales/de.json +++ b/mobile/src/i18n/locales/de.json @@ -3364,6 +3364,21 @@ } }, "tasks": { + "hostedMerge": { + "merged": "Zusammengeführt", + "closed": "Geschlossen", + "conflicts": "Konflikte", + "behind": "Nicht aktuell", + "blocked": "Blockiert", + "checksPending": "Prüfungen ausstehend", + "ableToMerge": "Zusammenführen möglich", + "unknown": "Unbekannt" + }, + "pagination": { + "pageUnreachable": "Seite {{page}} liegt außerhalb des Bereichs der GitHub-Suche.", + "loadPageFailed": "Seite {{page}} konnte nicht von GitHub geladen werden.", + "noMoreResults": "Keine weiteren Ergebnisse auf Seite {{page}}." + }, "composerSource": { "baseFailed": "Der Basis-Branch konnte nicht ermittelt werden.", "forkPushWarning": "Bei diesem PR ist „Allow edits from maintainers“ deaktiviert; GitHub könnte einen Push zum Fork ablehnen." diff --git a/mobile/src/i18n/locales/es.json b/mobile/src/i18n/locales/es.json index ad24b5ef7c1..f994d2c966b 100644 --- a/mobile/src/i18n/locales/es.json +++ b/mobile/src/i18n/locales/es.json @@ -1502,11 +1502,11 @@ "updateRequired": "Actualiza Orca Mobile para abrir archivos PDF" }, "unsavedEditsOffer": { - "changedSince": "Modificado en el escritorio desde tus cambios de las {{time}}", + "changedSince": "Modificado en el ordenador después de tus cambios de {{time}}", "copyMyEdits": "Copiar mis cambios", "discard": "Descartar", "restore": "Restaurar", - "unsavedFrom": "Cambios sin guardar de las {{time}}" + "unsavedFrom": "Cambios sin guardar ({{time}})" } }, "home": { @@ -3452,6 +3452,21 @@ } }, "tasks": { + "hostedMerge": { + "merged": "Fusionado", + "closed": "Cerrado", + "conflicts": "Conflictos", + "behind": "Desactualizado", + "blocked": "Bloqueado", + "checksPending": "Comprobaciones pendientes", + "ableToMerge": "Se puede fusionar", + "unknown": "Desconocido" + }, + "pagination": { + "pageUnreachable": "La página {{page}} está fuera del alcance de la búsqueda de GitHub.", + "loadPageFailed": "No se pudo cargar la página {{page}} desde GitHub.", + "noMoreResults": "No hay más resultados en la página {{page}}." + }, "composerSource": { "baseFailed": "No se pudo resolver la rama base.", "forkPushWarning": "Esta PR tiene desactivada la opción \"Allow edits from maintainers\"; GitHub podría rechazar el push al fork." diff --git a/mobile/src/i18n/locales/fr.json b/mobile/src/i18n/locales/fr.json index e825464bfe5..966264702ec 100644 --- a/mobile/src/i18n/locales/fr.json +++ b/mobile/src/i18n/locales/fr.json @@ -3452,6 +3452,21 @@ } }, "tasks": { + "hostedMerge": { + "merged": "Fusionné", + "closed": "Fermé", + "conflicts": "Conflits", + "behind": "En retard", + "blocked": "Bloqué", + "checksPending": "Vérifications en attente", + "ableToMerge": "Fusion possible", + "unknown": "Inconnu" + }, + "pagination": { + "pageUnreachable": "La page {{page}} dépasse la limite des résultats de recherche GitHub.", + "loadPageFailed": "La page {{page}} n’a pas pu être chargée depuis GitHub.", + "noMoreResults": "Aucun autre résultat sur la page {{page}}." + }, "composerSource": { "baseFailed": "Échec de la résolution de la branche de base.", "forkPushWarning": "L'option « Autoriser les modifications des mainteneurs » est désactivée pour cette PR ; le push vers le fork peut être refusé par GitHub." diff --git a/mobile/src/i18n/locales/ja.json b/mobile/src/i18n/locales/ja.json index 85a5d0e8e03..39364412640 100644 --- a/mobile/src/i18n/locales/ja.json +++ b/mobile/src/i18n/locales/ja.json @@ -3440,6 +3440,16 @@ "githubViewControls": { "openView": "GitHub でビューを開く" }, + "hostedMerge": { + "merged": "マージ済み", + "closed": "クローズ済み", + "conflicts": "競合あり", + "behind": "遅れあり", + "blocked": "ブロック中", + "checksPending": "チェック待ち", + "ableToMerge": "マージ可能", + "unknown": "不明" + }, "itemActions": { "changeStatus": "ステータスを変更", "copyGitHubLink": "GitHub リンクをコピーする", @@ -3586,6 +3596,11 @@ "updated": "更新日時", "updatedSortDescription": "アクティビティが新しい順" }, + "pagination": { + "pageUnreachable": "ページ {{page}} は GitHub 検索で取得できる範囲を超えています。", + "loadPageFailed": "ページ {{page}} を GitHub から読み込めませんでした。", + "noMoreResults": "ページ {{page}} にこれ以上の結果はありません。" + }, "pickerProjection": { "allRepos": "すべてのリポジトリ", "allSites": "すべてのサイト", diff --git a/mobile/src/i18n/locales/ko.json b/mobile/src/i18n/locales/ko.json index b4ccb7ee5d9..c8304776585 100644 --- a/mobile/src/i18n/locales/ko.json +++ b/mobile/src/i18n/locales/ko.json @@ -3360,6 +3360,21 @@ } }, "tasks": { + "hostedMerge": { + "merged": "병합됨", + "closed": "닫힘", + "conflicts": "충돌", + "behind": "뒤처짐", + "blocked": "차단됨", + "checksPending": "검사 대기 중", + "ableToMerge": "병합 가능", + "unknown": "알 수 없음" + }, + "pagination": { + "pageUnreachable": "{{page}}페이지는 GitHub 검색에서 반환할 수 있는 범위를 벗어났습니다.", + "loadPageFailed": "GitHub에서 {{page}}페이지를 불러오지 못했습니다.", + "noMoreResults": "{{page}}페이지에 더 이상 결과가 없습니다." + }, "composerSource": { "baseFailed": "기본 브랜치를 확인하지 못했습니다.", "forkPushWarning": "이 PR에서 \"유지 관리자의 수정 허용\"이 꺼져 있어 GitHub에서 포크로의 푸시를 거부할 수 있습니다." diff --git a/mobile/src/i18n/locales/pt.json b/mobile/src/i18n/locales/pt.json index 93713b0a400..7bd8fa165f6 100644 --- a/mobile/src/i18n/locales/pt.json +++ b/mobile/src/i18n/locales/pt.json @@ -3976,6 +3976,21 @@ } }, "tasks": { + "hostedMerge": { + "merged": "Mesclado", + "closed": "Fechado", + "conflicts": "Conflitos", + "behind": "Desatualizado", + "blocked": "Bloqueado", + "checksPending": "Verificações pendentes", + "ableToMerge": "Pode ser mesclado", + "unknown": "Desconhecido" + }, + "pagination": { + "pageUnreachable": "A página {{page}} está além do que a pesquisa do GitHub pode retornar.", + "loadPageFailed": "A página {{page}} não pôde ser carregada do GitHub.", + "noMoreResults": "Não há mais resultados na página {{page}}." + }, "composerSource": { "baseFailed": "Falha ao determinar a branch base.", "forkPushWarning": "Este PR está com \"Permitir edições de mantenedores\" desativado; o GitHub pode rejeitar o push para o fork." diff --git a/mobile/src/i18n/locales/ru.json b/mobile/src/i18n/locales/ru.json index d43bb31d722..1333beff214 100644 --- a/mobile/src/i18n/locales/ru.json +++ b/mobile/src/i18n/locales/ru.json @@ -3540,6 +3540,21 @@ } }, "tasks": { + "hostedMerge": { + "merged": "Слито", + "closed": "Закрыто", + "conflicts": "Конфликты", + "behind": "Отстаёт", + "blocked": "Заблокировано", + "checksPending": "Проверки ожидаются", + "ableToMerge": "Можно слить", + "unknown": "Неизвестно" + }, + "pagination": { + "pageUnreachable": "Страница {{page}} выходит за пределы результатов поиска GitHub.", + "loadPageFailed": "Не удалось загрузить страницу {{page}} из GitHub.", + "noMoreResults": "На странице {{page}} больше нет результатов." + }, "composerSource": { "baseFailed": "Не удалось определить базовую ветку.", "forkPushWarning": "В этом PR отключена настройка «Разрешить правки сопровождающим»; GitHub может отклонить отправку в форк." diff --git a/mobile/src/i18n/locales/tr.json b/mobile/src/i18n/locales/tr.json index a08a81a9ca4..8c58ec1fe2e 100644 --- a/mobile/src/i18n/locales/tr.json +++ b/mobile/src/i18n/locales/tr.json @@ -1461,11 +1461,11 @@ "updateRequired": "PDF'leri açmak için Orca Mobile'ı güncelleyin" }, "unsavedEditsOffer": { - "changedSince": "{{time}} tarihli düzenlemelerinizden sonra masaüstünde değişti", + "changedSince": "Düzenlemelerinizden ({{time}}) sonra masaüstünde değişti", "copyMyEdits": "Düzenlemelerimi kopyala", "discard": "Vazgeç", "restore": "Geri yükle", - "unsavedFrom": "{{time}} tarihli kaydedilmemiş düzenlemeler" + "unsavedFrom": "Kaydedilmemiş düzenlemeler ({{time}})" } }, "home": { @@ -3364,6 +3364,21 @@ } }, "tasks": { + "hostedMerge": { + "merged": "Birleştirildi", + "closed": "Kapatıldı", + "conflicts": "Çakışmalar", + "behind": "Geride", + "blocked": "Engellendi", + "checksPending": "Kontroller bekleniyor", + "ableToMerge": "Birleştirilebilir", + "unknown": "Bilinmiyor" + }, + "pagination": { + "pageUnreachable": "{{page}}. sayfa GitHub aramasının döndürebileceği aralığın dışında.", + "loadPageFailed": "{{page}}. sayfa GitHub’dan yüklenemedi.", + "noMoreResults": "{{page}}. sayfada başka sonuç yok." + }, "composerSource": { "baseFailed": "Temel branch çözümlenemedi.", "forkPushWarning": "Bu PR'da “Allow edits from maintainers” kapalı; fork'a push işlemi GitHub tarafından reddedilebilir." diff --git a/mobile/src/i18n/locales/zh-Hant.json b/mobile/src/i18n/locales/zh-Hant.json index 5b00ba4341c..3e4a1c25efc 100644 --- a/mobile/src/i18n/locales/zh-Hant.json +++ b/mobile/src/i18n/locales/zh-Hant.json @@ -3360,6 +3360,21 @@ } }, "tasks": { + "hostedMerge": { + "merged": "已合併", + "closed": "已關閉", + "conflicts": "有衝突", + "behind": "落後", + "blocked": "已封鎖", + "checksPending": "等待檢查", + "ableToMerge": "可以合併", + "unknown": "未知" + }, + "pagination": { + "pageUnreachable": "第 {{page}} 頁超出 GitHub 搜尋可傳回的範圍。", + "loadPageFailed": "無法從 GitHub 載入第 {{page}} 頁。", + "noMoreResults": "第 {{page}} 頁沒有更多結果。" + }, "composerSource": { "baseFailed": "無法解析基礎分支。", "forkPushWarning": "此 PR 未啟用「允許維護者編輯」;推送至分叉存放庫可能會遭 GitHub 拒絕。" diff --git a/mobile/src/i18n/locales/zh.json b/mobile/src/i18n/locales/zh.json index 5cb1759bdc1..8254737d38c 100644 --- a/mobile/src/i18n/locales/zh.json +++ b/mobile/src/i18n/locales/zh.json @@ -3449,6 +3449,16 @@ "githubViewControls": { "openView": "在 GitHub 中打开视图" }, + "hostedMerge": { + "merged": "已合并", + "closed": "已关闭", + "conflicts": "有冲突", + "behind": "落后", + "blocked": "已阻止", + "checksPending": "检查待完成", + "ableToMerge": "可以合并", + "unknown": "未知" + }, "itemActions": { "changeStatus": "更改状态", "copyGitHubLink": "复制 GitHub 链接", @@ -3595,6 +3605,11 @@ "updated": "已更新", "updatedSortDescription": "最新活动优先" }, + "pagination": { + "pageUnreachable": "第 {{page}} 页超出了 GitHub 搜索可返回的范围。", + "loadPageFailed": "无法从 GitHub 加载第 {{page}} 页。", + "noMoreResults": "第 {{page}} 页没有更多结果。" + }, "pickerProjection": { "allRepos": "所有仓库", "allSites": "所有站点", diff --git a/mobile/src/notifications/notification-reply-schema.test.ts b/mobile/src/notifications/notification-reply-schema.test.ts deleted file mode 100644 index 78f4f1e6fc2..00000000000 --- a/mobile/src/notifications/notification-reply-schema.test.ts +++ /dev/null @@ -1,101 +0,0 @@ -import { describe, expect, it } from 'vitest' -import type { z } from 'zod' -import { - missedNotificationsSchema, - notificationUnreadReplySchema, - PUSH_REGISTER_REFUSAL_REASONS, - PUSH_TEST_REFUSAL_REASONS, - pushDeliveryTestResultSchema, - pushRouteRegistrationSchema -} from './notification-reply-schema' - -function reads(schema: z.ZodType, value: unknown): T { - const parsed = schema.safeParse(value) - if (!parsed.success) { - throw new Error(`expected a readable reply: ${parsed.error.message}`) - } - return parsed.data -} - -function refuses(schema: z.ZodType, value: unknown): boolean { - return !schema.safeParse(value).success -} - -describe('notification replies tolerate the shapes their call sites guard', () => { - it('reads a test-push reply the screen reaches through optional chaining', () => { - expect(reads(pushDeliveryTestResultSchema, { accepted: true })?.accepted).toBe(true) - expect(reads(pushDeliveryTestResultSchema, null)).toBe(null) - expect(reads(pushDeliveryTestResultSchema, undefined)).toBe(undefined) - expect(reads(pushDeliveryTestResultSchema, { error: 'refused' })?.accepted).toBe(undefined) - }) - - // Schema refusal would replace the screen’s generic send-failure copy with a parser error. - it('reads a non-object test-push result as absent, which takes the generic copy', () => { - for (const value of ['garbage', 7, true, []]) { - expect(refuses(pushDeliveryTestResultSchema, value)).toBe(false) - const result = reads(pushDeliveryTestResultSchema, value) - expect(result?.accepted).toBe(undefined) - expect(result?.reason).toBe(undefined) - } - }) - - it('reads a registration reply the reconciler reaches through optional chaining', () => { - expect(reads(pushRouteRegistrationSchema, { registered: true })?.registered).toBe(true) - expect(reads(pushRouteRegistrationSchema, null)).toBe(null) - expect(reads(pushRouteRegistrationSchema, { registered: 'yes' })?.registered).toBe(undefined) - }) - - it('takes every reply at the two sites whose body nothing reads', () => { - expect(refuses(notificationUnreadReplySchema, undefined)).toBe(false) - expect(refuses(notificationUnreadReplySchema, null)).toBe(false) - expect(refuses(notificationUnreadReplySchema, 'anything')).toBe(false) - }) -}) - -describe('closed enums degrade to the copy main showed', () => { - it('keeps a reason the screen branches on and drops one it does not know', () => { - expect( - reads(pushDeliveryTestResultSchema, { accepted: false, reason: 'rate_limited' })?.reason - ).toBe('rate_limited') - expect( - reads(pushDeliveryTestResultSchema, { accepted: false, reason: 'not_registered' })?.reason - ).toBe('not_registered') - expect(reads(pushDeliveryTestResultSchema, { accepted: false, reason: 'quota' })?.reason).toBe( - undefined - ) - }) - - it('keeps a registration reason and drops an unknown one', () => { - const reply = { registered: false, reason: 'throttled' } - expect(reads(pushRouteRegistrationSchema, reply)?.reason).toBe('throttled') - expect( - reads(pushRouteRegistrationSchema, { registered: false, reason: 'moon-phase' })?.reason - ).toBe(undefined) - }) - - // Host-pinned unions cover every arm; these loops prove each survives parsing. - it('keeps every refusal reason the host declares for either route', () => { - for (const reason of PUSH_TEST_REFUSAL_REASONS) { - expect(reads(pushDeliveryTestResultSchema, { accepted: false, reason })?.reason).toBe(reason) - } - for (const reason of PUSH_REGISTER_REFUSAL_REASONS) { - expect(reads(pushRouteRegistrationSchema, { registered: false, reason })?.reason).toBe(reason) - } - }) -}) - -describe('dismissal rows stay opaque', () => { - it('keeps every row for readPushNotificationIdentity to judge', () => { - const rows = [{ notificationId: 'n-1' }, 'not-a-row', 7] - expect(reads(missedNotificationsSchema, { dismissedPushes: rows })?.dismissedPushes).toEqual( - rows - ) - }) - - it('drops a dismissedPushes that is not an array, as Array.isArray did', () => { - expect(reads(missedNotificationsSchema, { dismissedPushes: 'all' })?.dismissedPushes).toBe( - undefined - ) - expect(reads(missedNotificationsSchema, null)).toBe(null) - }) -}) diff --git a/mobile/src/session/agent-launch/mobile-agent-detection-operations.ts b/mobile/src/session/agent-launch/mobile-agent-detection-operations.ts index 443525aca2d..a46d1f47914 100644 --- a/mobile/src/session/agent-launch/mobile-agent-detection-operations.ts +++ b/mobile/src/session/agent-launch/mobile-agent-detection-operations.ts @@ -2,13 +2,6 @@ import { bindDeferredRpcOperation, defineRpcOperation } from '../../transport/rp import { rpcResultVariant } from '../../transport/rpc/rpc-operation-result-reader' import '../../terminal/terminal-reply-schema' import { detectedAgentsSchema, refreshedAgentsSchema } from './mobile-agent-detection-reply-schema' -import '../../files/session-documents/mobile-markdown-tab-reply-schema' -import '../../transport/rpc/rpc-uninterpreted-reply-schemas' -import '../../terminal/session/mobile-session-terminal-reply-schema' -import '../../worktree/session-worktree-record-reply-schema' -import '../native-chat/composer/mobile-native-chat-skill-reply-schema' -import '../../terminal/quick-commands/mobile-quick-command-reply-schema' -import '../../files/workspace-file-paths-reply-schema' // Launch detection surfaces host refusals; advisory task-drawer readers intentionally skip them. export const preflightDetectAgentsRead = bindDeferredRpcOperation( diff --git a/mobile/src/session/agent-launch/mobile-runtime-repo-operations.ts b/mobile/src/session/agent-launch/mobile-runtime-repo-operations.ts index cb885ee3fc6..246a1a00edb 100644 --- a/mobile/src/session/agent-launch/mobile-runtime-repo-operations.ts +++ b/mobile/src/session/agent-launch/mobile-runtime-repo-operations.ts @@ -2,13 +2,6 @@ import { bindDeferredRpcOperation, defineRpcOperation } from '../../transport/rp import { rpcResultVariant } from '../../transport/rpc/rpc-operation-result-reader' import '../../terminal/terminal-reply-schema' import { runtimeRepoListSchema } from './mobile-agent-detection-reply-schema' -import '../../files/session-documents/mobile-markdown-tab-reply-schema' -import '../../transport/rpc/rpc-uninterpreted-reply-schemas' -import '../../terminal/session/mobile-session-terminal-reply-schema' -import '../../worktree/session-worktree-record-reply-schema' -import '../native-chat/composer/mobile-native-chat-skill-reply-schema' -import '../../terminal/quick-commands/mobile-quick-command-reply-schema' -import '../../files/workspace-file-paths-reply-schema' export type MobileRuntimeRepoSummary = { id: string diff --git a/mobile/src/session/floating-workspace.test.ts b/mobile/src/session/floating-workspace.test.ts index 8f29646b49b..056db4ca1db 100644 --- a/mobile/src/session/floating-workspace.test.ts +++ b/mobile/src/session/floating-workspace.test.ts @@ -1,9 +1,5 @@ import { describe, expect, it } from 'vitest' -import { - FLOATING_WORKSPACE_WORKTREE_ID, - floatingWorkspaceSessionPath, - isFloatingWorkspaceWorktreeId -} from './floating-workspace' +import { isFloatingWorkspaceWorktreeId } from './floating-workspace' describe('floating workspace routing', () => { it('matches only the desktop sentinel id', () => { @@ -13,10 +9,4 @@ describe('floating workspace routing', () => { expect(isFloatingWorkspaceWorktreeId(undefined)).toBe(false) expect(isFloatingWorkspaceWorktreeId(null)).toBe(false) }) - - it('builds the session route with an explicit title seed', () => { - expect(floatingWorkspaceSessionPath('host-1')).toBe( - `/h/host-1/session/${FLOATING_WORKSPACE_WORKTREE_ID}?name=Floating%20Workspace` - ) - }) }) diff --git a/mobile/src/session/mobile-session-appearance-startup.test.tsx b/mobile/src/session/mobile-session-appearance-startup.test.tsx deleted file mode 100644 index afa67b42404..00000000000 --- a/mobile/src/session/mobile-session-appearance-startup.test.tsx +++ /dev/null @@ -1,77 +0,0 @@ -import { createElement } from 'react' -import { act, create, type ReactTestInstance, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, describe, expect, it, vi } from 'vitest' -import { MobileSessionRouteScreen } from './MobileSessionRouteScreen' - -// Mocked react-native components are string tags that ReactTestInstance's ElementType omits. -function hostType(node: ReactTestInstance): unknown { - return node.type -} - -const state = vi.hoisted(() => ({ - terminalPreferencesReady: false, - accessoryPreferencesReady: false, - nativeChatController: { sessionViewReady: false } -})) -const mounts = vi.hoisted(() => ({ count: 0 })) -vi.mock('react-native', () => ({ - ActivityIndicator: 'ActivityIndicator', - Text: 'Text', - View: 'View' -})) -vi.mock('./mobile-session-styles', () => ({ styles: {} })) -vi.mock('./use-mobile-session-controller', () => ({ useMobileSessionController: () => state })) -vi.mock('./MobileSessionSurface', async () => { - const react = await import('react') - return { - MobileSessionSurface: () => { - react.useEffect(() => { - mounts.count += 1 - }, []) - return react.createElement('ReadySession') - } - } -}) - -let renderer: ReactTestRenderer | null = null -afterEach(() => { - act(() => renderer?.unmount()) - renderer = null -}) - -describe('first visible session appearance', () => { - it.each(['terminal', 'accessory', 'chat'] as const)( - 'waits for the saved %s setting before mounting the session', - (waiting) => { - state.terminalPreferencesReady = waiting !== 'terminal' - state.accessoryPreferencesReady = waiting !== 'accessory' - state.nativeChatController.sessionViewReady = waiting !== 'chat' - mounts.count = 0 - const render = () => - act(() => { - if (renderer) { - renderer.update(createElement(MobileSessionRouteScreen)) - } else { - renderer = create(createElement(MobileSessionRouteScreen)) - } - }) - const expectPreparing = () => { - expect(renderer?.root.findAll((node) => hostType(node) === 'ReadySession')).toHaveLength(0) - expect( - renderer?.root.findAll((node) => hostType(node) === 'ActivityIndicator') - ).toHaveLength(1) - expect(mounts.count).toBe(0) - } - render() - expectPreparing() - state.terminalPreferencesReady = true - state.accessoryPreferencesReady = true - state.nativeChatController.sessionViewReady = true - render() - expect(renderer?.root.findAll((node) => hostType(node) === 'ReadySession')).toHaveLength(1) - expect(mounts.count).toBe(1) - render() - expect(mounts.count).toBe(1) - } - ) -}) diff --git a/mobile/src/session/mobile-session-status-result.ts b/mobile/src/session/mobile-session-status-result.ts deleted file mode 100644 index 722e62ab480..00000000000 --- a/mobile/src/session/mobile-session-status-result.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type RuntimeStatusResult = { - capabilities?: string[] -} diff --git a/mobile/src/session/native-chat/MobileNativeChatView.turn-status.test.ts b/mobile/src/session/native-chat/MobileNativeChatView.turn-status.test.ts deleted file mode 100644 index b8dcf5eda98..00000000000 --- a/mobile/src/session/native-chat/MobileNativeChatView.turn-status.test.ts +++ /dev/null @@ -1,213 +0,0 @@ -import './MobileNativeChatView.harness.test-fixture' -import { createElement, type ReactNode } from 'react' -import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { NativeChatMessage } from '../../../../src/shared/native-chat/native-chat-types' -import { MobileNativeChatView } from './MobileNativeChatView' - -const scrollToEnd = vi.hoisted(() => vi.fn()) -const scrollToOffset = vi.hoisted(() => vi.fn()) - -vi.mock('react-native', async () => { - const React = await import('react') - return { - ...(await import('../../test-support/react-native-motion-stub')).reactNativeMotionStub(), - ActivityIndicator: 'ActivityIndicator', - FlatList: React.forwardRef< - unknown, - { - data: NativeChatMessage[] - renderItem: (row: { item: NativeChatMessage; index: number }) => ReactNode - ListFooterComponent: ReactNode - } - >((props, ref) => { - React.useImperativeHandle(ref, () => ({ scrollToEnd, scrollToOffset }), []) - return React.createElement( - 'FlatList', - props, - props.data.map((item, index) => - React.createElement(React.Fragment, { key: item.id }, props.renderItem({ item, index })) - ), - props.ListFooterComponent - ) - }), - Platform: { OS: 'ios' }, - Pressable: 'Pressable', - StyleSheet: { create: (styles: unknown) => styles, hairlineWidth: 1 }, - Text: 'Text', - View: 'View' - } -}) - -vi.mock('react-native-safe-area-context', () => ({ - useSafeAreaInsets: () => ({ top: 0, bottom: 0, left: 0, right: 0 }) -})) - -vi.mock('react-native-gesture-handler', () => { - const chain = { - runOnJS: () => chain, - onStart: () => chain, - onUpdate: () => chain - } - return { - Gesture: { Simultaneous: () => ({}), Native: () => ({}), Pinch: () => chain }, - GestureDetector: 'GestureDetector', - GestureHandlerRootView: 'GestureHandlerRootView' - } -}) - -vi.mock('lucide-react-native', () => ({ - ArrowDown: 'ArrowDown', - ChevronsDownUp: 'ChevronsDownUp', - ChevronsUpDown: 'ChevronsUpDown', - Square: 'Square' -})) - -vi.mock('./transcript/MobileNativeChatMessage', () => ({ - MobileNativeChatMessage: 'ChatMessage' -})) -vi.mock('./transcript/MobileNativeChatLiveLine', () => ({ - MobileNativeChatLiveLine: 'LiveStatus' -})) -vi.mock('./input/MobileNativeChatAsk', () => ({ MobileNativeChatAsk: 'ChatAsk' })) -vi.mock('./input/MobileNativeChatPermission', () => ({ - MobileNativeChatPermission: 'ChatPermission' -})) -vi.mock('./input/MobileNativeChatQuestion', () => ({ - MobileNativeChatQuestion: 'ChatQuestion' -})) -vi.mock('../../components/ActionSheetModal', () => ({ ActionSheetModal: 'ActionSheetModal' })) - -vi.mock('./composer/MobileNativeChatComposer', async () => { - const { composerStub } = await import('./MobileNativeChatView.render-stubs.test-fixture') - return composerStub() -}) - -type Overrides = { - messages?: Parameters[0]['messages'] - folded?: Parameters[0]['folded'] - streaming?: string | null - sendErrorMessage?: string | null - onClearSendError?: () => void - inputLockReason?: 'disconnected' | 'waiting' | null - onSend?: (text: string) => Promise - pending?: Parameters[0]['pending'] - structuredActivityUi?: boolean - turnIndicator?: Parameters[0]['turnIndicator'] - agentWorking?: boolean - canStop?: boolean - ask?: Parameters[0]['ask'] - question?: Parameters[0]['question'] - permission?: Parameters[0]['permission'] - sendSurfaceId?: string - keyboardInset?: number - hasMore?: boolean - onLoadEarlier?: () => void -} - -function chatViewElement(overrides: Overrides): ReturnType { - return createElement(MobileNativeChatView, { - messages: [], - folded: [], - status: 'ready', - streaming: null, - onSend: vi.fn().mockResolvedValue(true), - sendSurfaceId: 'tab-a', - getSendCompletionGeneration: () => 0, - getComposerEditGeneration: () => 0, - pending: [], - draftKey: null, - onComposerTextChange: vi.fn(), - ...overrides - }) -} - -describe('MobileNativeChatView', () => { - let renderer: ReactTestRenderer | null = null - - beforeEach(() => { - vi.stubGlobal('requestAnimationFrame', (callback: FrameRequestCallback) => - setTimeout(() => callback(0), 0) - ) - vi.stubGlobal('cancelAnimationFrame', (handle: ReturnType) => - clearTimeout(handle) - ) - }) - - afterEach(() => { - act(() => renderer?.unmount()) - renderer = null - scrollToEnd.mockReset() - scrollToOffset.mockReset() - vi.unstubAllGlobals() - }) - - async function render(overrides: Overrides = {}): Promise { - await act(async () => { - renderer = create(chatViewElement(overrides)) - }) - } - - async function update(overrides: Overrides = {}): Promise { - await act(async () => { - renderer?.update(chatViewElement(overrides)) - }) - } - - function renderedRow(id: string): ReturnType { - return createElement( - 'Row', - renderer!.root.find( - (node) => String(node.type) === 'ChatMessage' && node.props.message.id === id - ).props - ) - } - - describe('structured turn status wiring', () => { - const userTurn = (id: string, text: string): NativeChatMessage => ({ - id, - role: 'user', - blocks: [{ type: 'text', text }], - timestamp: 0, - source: 'transcript' - }) - - function rowProps(id: string): Record { - return (renderedRow(id) as { props: Record }).props - } - - it('does not carry a running turn clock across chat surfaces', async () => { - vi.useFakeTimers() - try { - vi.setSystemTime(1_000) - const firstTab = [userTurn('u1', 'first')] - await render({ - messages: firstTab, - folded: firstTab, - structuredActivityUi: true, - agentWorking: true, - sendSurfaceId: 'host\0worktree\0tab-a' - }) - expect(rowProps('u1').turnStatus).toMatchObject({ startedAt: 1_000 }) - - vi.setSystemTime(12_000) - const secondTab = [userTurn('u2', 'second')] - await update({ - messages: secondTab, - folded: secondTab, - structuredActivityUi: true, - agentWorking: true, - sendSurfaceId: 'host\0worktree\0tab-b' - }) - - expect(rowProps('u2').turnStatus).toMatchObject({ startedAt: 12_000 }) - } finally { - vi.useRealTimers() - } - }) - }) -}) - -vi.mock('./input/MobileQueuedMessageComposer', () => ({ - MobileQueuedMessageComposer: 'QueuedMessageComposer' -})) diff --git a/mobile/src/session/native-chat/agent-session/mobile-native-chat-page-read-operations.ts b/mobile/src/session/native-chat/agent-session/mobile-native-chat-page-read-operations.ts index b91d5156f2d..f7a712d7aba 100644 --- a/mobile/src/session/native-chat/agent-session/mobile-native-chat-page-read-operations.ts +++ b/mobile/src/session/native-chat/agent-session/mobile-native-chat-page-read-operations.ts @@ -2,13 +2,6 @@ import { bindDeferredRpcOperation, defineRpcOperation } from '../../../transport import { rpcResultVariant } from '../../../transport/rpc/rpc-operation-result-reader' import '../../../terminal/terminal-reply-schema' import { sessionForwardedReplySchema } from '../../../transport/rpc/rpc-uninterpreted-reply-schemas' -import '../../agent-launch/mobile-agent-detection-reply-schema' -import '../../../files/session-documents/mobile-markdown-tab-reply-schema' -import '../../../terminal/session/mobile-session-terminal-reply-schema' -import '../../../worktree/session-worktree-record-reply-schema' -import '../composer/mobile-native-chat-skill-reply-schema' -import '../../../terminal/quick-commands/mobile-quick-command-reply-schema' -import '../../../files/workspace-file-paths-reply-schema' // Retain the live window on refusal and let the caller offer retry; read the whole legacy error/window union before selecting messages. export const nativeChatSessionPageRead = bindDeferredRpcOperation( diff --git a/mobile/src/session/native-chat/composer/mobile-draft-inputs-scaling.test.ts b/mobile/src/session/native-chat/composer/mobile-draft-inputs-scaling.test.ts deleted file mode 100644 index 8155332bd37..00000000000 --- a/mobile/src/session/native-chat/composer/mobile-draft-inputs-scaling.test.ts +++ /dev/null @@ -1,166 +0,0 @@ -import { createElement } from 'react' -import { act, create } from 'react-test-renderer' -import { afterEach, expect, it, vi } from 'vitest' -import { useMobileNativeChatFileAttachments } from './use-mobile-native-chat-file-attachments' -import { useMobileNativeChatImageAttachments } from './use-mobile-native-chat-image-attachments' -import { - useMobileNativeChatDraft, - setMobileNativeChatDraftText, - resetMobileNativeChatDraftStoreForTests -} from './mobile-native-chat-draft-store' -import { - subscribeMobileNativeChatDraftInputs, - updateMobileNativeChatDraftInputs, - closeMobileNativeChatEditInputs, - useMobileNativeChatDraftInputs -} from './mobile-native-chat-draft-inputs' - -const picker = vi.hoisted(() => ({ pickFiles: vi.fn(), pickImages: vi.fn() })) -vi.mock('../../../platform/media-picker', () => ({ useMediaPicker: () => picker })) -afterEach(resetMobileNativeChatDraftStoreForTests) - -it.each([20, 200])( - 'isolates mounted text, input, image and file consumers across %i other scopes', - async (count) => { - const scopes = [ - 'own-host:target', - ...Array.from({ length: count }, (_, i) => `other-host:${i}`) - ] - const own = scopes[0] - const renders = scopes.map(() => ({ text: 0, input: 0, image: 0, file: 0 })) - const values: { - text: string - pending: number - images: readonly string[] - files: readonly string[] - }[] = scopes.map(() => ({ text: '', pending: 0, images: [], files: [] })) - const upstream = scopes.map(() => vi.fn()) - const releases = scopes.map((scope, i) => - subscribeMobileNativeChatDraftInputs(scope, upstream[i]) - ) - function Text({ index }: { index: number }) { - values[index].text = useMobileNativeChatDraft(scopes[index]) - renders[index].text++ - return null - } - function Input({ index }: { index: number }) { - values[index].pending = useMobileNativeChatDraftInputs(scopes[index]).pending ?? 0 - renders[index].input++ - return null - } - function File({ index }: { index: number }) { - const file = useMobileNativeChatFileAttachments({ - client: null, - sessionId: null, - scopeKey: scopes[index], - enabled: false, - showToast: vi.fn() - }) - values[index].files = file.files.map((entry) => entry.path ?? '') - renders[index].file++ - return null - } - function Image({ index }: { index: number }) { - const image = useMobileNativeChatImageAttachments({ - client: null, - agent: 'codex', - activeHandleRef: { current: null }, - deviceTokenRef: { current: null }, - getActiveWorktreeConnectionId: async () => null, - connState: 'disconnected', - scopeKey: scopes[index], - enabled: false, - structuredNativeChat: true, - showToast: vi.fn(), - onSendError: vi.fn(), - baseSend: async () => 'rejected', - readSeededLaunchDraft: () => null - }) - values[index].images = image.attachments.map((entry) => entry.path) - renders[index].image++ - return null - } - let view: ReturnType | undefined - await act(async () => { - view = create( - createElement( - 'fixture', - {}, - scopes.flatMap((_, index) => [ - createElement(Text, { key: `t${index}`, index }), - createElement(Input, { key: `p${index}`, index }), - createElement(File, { key: `f${index}`, index }), - createElement(Image, { key: `i${index}`, index }) - ]) - ) - ) - }) - renders.forEach((entry) => { - entry.text = entry.input = entry.image = entry.file = 0 - }) - try { - await act(async () => setMobileNativeChatDraftText(own, 'own text')) - expect(values[0].text).toBe('own text') - expect(renders[0]).toEqual({ text: 1, input: 0, image: 0, file: 0 }) - await act(async () => - updateMobileNativeChatDraftInputs(own, (current) => ({ ...current, pending: 1 })) - ) - expect(values[0].pending).toBe(1) - await act(async () => - updateMobileNativeChatDraftInputs(own, (current) => ({ - ...current, - images: [{ id: 'image', path: '/saved.png', previewUri: 'file:///saved.png' }] - })) - ) - expect(values[0].images).toEqual(['/saved.png']) - await act(async () => - updateMobileNativeChatDraftInputs(own, (current) => ({ - ...current, - files: [ - { id: 'file', path: '/saved.txt', name: 'saved.txt', mime: 'text/plain', byteLength: 1 } - ] - })) - ) - expect(values[0].files).toEqual(['/saved.txt']) - expect(renders[0]).toEqual({ text: 1, input: 3, image: 2, file: 1 }) - expect(upstream[0]).toHaveBeenCalledTimes(3) - for (let index = 1; index < scopes.length; index++) { - expect(renders[index]).toEqual({ text: 0, input: 0, image: 0, file: 0 }) - expect(upstream[index]).not.toHaveBeenCalled() - } - } finally { - await act(async () => view?.unmount()) - releases.forEach((release) => release()) - } - await act(async () => - updateMobileNativeChatDraftInputs(own, (current) => ({ ...current, pending: 0 })) - ) - expect(renders[0]).toEqual({ text: 1, input: 3, image: 2, file: 1 }) - expect(upstream[0]).toHaveBeenCalledTimes(3) - } -) -it.each([20, 200])( - 'notifies only affected scopes across %i retained input subscribers and retires listeners', - (count) => { - const idle = vi.fn() - const releases = Array.from({ length: count }, (_, index) => - subscribeMobileNativeChatDraftInputs(`idle-${index}`, idle) - ) - const source = vi.fn() - const destination = vi.fn() - releases.push( - subscribeMobileNativeChatDraftInputs('queued-edit:one', source), - subscribeMobileNativeChatDraftInputs('bottom', destination) - ) - updateMobileNativeChatDraftInputs('queued-edit:one', (inputs) => ({ ...inputs, pending: 1 })) - expect(source).toHaveBeenCalledTimes(1) - expect(idle).not.toHaveBeenCalled() - closeMobileNativeChatEditInputs('queued-edit:one', 'bottom') - expect(source).toHaveBeenCalledTimes(2) - expect(destination).toHaveBeenCalledTimes(1) - expect(idle).not.toHaveBeenCalled() - releases.forEach((release) => release()) - updateMobileNativeChatDraftInputs('bottom', (inputs) => ({ ...inputs, pending: 0 })) - expect(destination).toHaveBeenCalledTimes(1) - } -) diff --git a/mobile/src/session/native-chat/composer/mobile-native-chat-file-attachment.test.ts b/mobile/src/session/native-chat/composer/mobile-native-chat-file-attachment.test.ts index c6a04295615..37a0d18ae6a 100644 --- a/mobile/src/session/native-chat/composer/mobile-native-chat-file-attachment.test.ts +++ b/mobile/src/session/native-chat/composer/mobile-native-chat-file-attachment.test.ts @@ -1,8 +1,5 @@ import { describe, expect, it } from 'vitest' -import { - MobileFileTooLargeError, - type PickedMobileFile -} from '../../../platform/media-picker-contract' +import type { PickedMobileFile } from '../../../platform/media-picker-contract' import { nativeChatTextWithFileReferences, uploadPickedNativeChatFiles, @@ -83,20 +80,4 @@ describe('uploadPickedNativeChatFiles', () => { expect([...chips.values()].map((chip) => chip.path)).toEqual(['/store/a.txt', '/store/b.txt']) expect(errors).toEqual([]) }) - - it('drops the chip of a failed upload, says which file, and carries on', async () => { - const { chips, errors, done } = run(pickedFiles([picked('a.txt'), picked('b.txt')]), 'a.txt') - await done - expect([...chips.values()].map((chip) => chip.name)).toEqual(['b.txt']) - expect(errors).toEqual(["Couldn't upload a.txt"]) - }) - - it('keeps what was stored before the picker refused an oversized file', async () => { - const { chips, errors, done } = run( - pickedFiles([picked('a.txt')], new MobileFileTooLargeError('clip.mov')) - ) - await done - expect([...chips.values()].map((chip) => chip.name)).toEqual(['a.txt']) - expect(errors).toEqual([new MobileFileTooLargeError('clip.mov').message]) - }) }) diff --git a/mobile/src/session/native-chat/composer/mobile-native-chat-image-scope-state.ts b/mobile/src/session/native-chat/composer/mobile-native-chat-image-scope-state.ts deleted file mode 100644 index 3429717ed67..00000000000 --- a/mobile/src/session/native-chat/composer/mobile-native-chat-image-scope-state.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { PendingNativeChatImage } from './mobile-native-chat-image-attachment' - -export const NO_NATIVE_CHAT_IMAGE_ATTACHMENTS: PendingNativeChatImage[] = [] - -export type MobileNativeChatImagesByScope = Record - -export function withScopeAttachments( - byScope: Readonly>, - scope: string, - next: List -): Record { - if (next.length > 0) { - return { ...byScope, [scope]: next } - } - const remaining = { ...byScope } - delete remaining[scope] - return remaining -} diff --git a/mobile/src/session/native-chat/composer/mobile-native-chat-skill-operations.ts b/mobile/src/session/native-chat/composer/mobile-native-chat-skill-operations.ts index fc06f8e0be0..de98372945e 100644 --- a/mobile/src/session/native-chat/composer/mobile-native-chat-skill-operations.ts +++ b/mobile/src/session/native-chat/composer/mobile-native-chat-skill-operations.ts @@ -2,13 +2,6 @@ import { bindDeferredRpcOperation, defineRpcOperation } from '../../../transport import { rpcResultVariant } from '../../../transport/rpc/rpc-operation-result-reader' import '../../../terminal/terminal-reply-schema' import { skillDiscoveryReplySchema } from './mobile-native-chat-skill-reply-schema' -import '../../agent-launch/mobile-agent-detection-reply-schema' -import '../../../files/session-documents/mobile-markdown-tab-reply-schema' -import '../../../transport/rpc/rpc-uninterpreted-reply-schemas' -import '../../../terminal/session/mobile-session-terminal-reply-schema' -import '../../../worktree/session-worktree-record-reply-schema' -import '../../../terminal/quick-commands/mobile-quick-command-reply-schema' -import '../../../files/workspace-file-paths-reply-schema' // Mobile names the workspace and lets the host resolve and scan it; see SKILL_DISCOVER_WORKSPACE_CAPABILITY. export const nativeChatSkillDiscoveryRead = bindDeferredRpcOperation( diff --git a/mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts.test.ts b/mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts.test.ts index 3545d6e078a..0a35b683597 100644 --- a/mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts.test.ts +++ b/mobile/src/session/native-chat/composer/use-mobile-native-chat-drafts.test.ts @@ -354,52 +354,6 @@ describe('useMobileNativeChatDrafts', () => { expect(state?.composerText).toBe(' /clear') }) - it('reconciles an image-only unconfirmed send against the next user turn (no false warning)', async () => { - vi.useFakeTimers() - try { - await mount('a') - await act(async () => - renderer?.update( - createElement(Harness, { tabId: 'a', messages: [assistantTextMessage('a1', 'hi')] }) - ) - ) - const origin = state?.captureSendOrigin('') - const onUnconfirmed = vi.fn() - act(() => { - if (origin) { - state?.holdUnconfirmedSend(origin, '', onUnconfirmed) - } - }) - - await act(async () => - renderer?.update( - createElement(Harness, { - tabId: 'a', - messages: [assistantTextMessage('a1', 'hi'), assistantTextMessage('a2', 'ok')] - }) - ) - ) - await act(async () => - renderer?.update( - createElement(Harness, { - tabId: 'a', - messages: [ - assistantTextMessage('a1', 'hi'), - assistantTextMessage('a2', 'ok'), - userTextMessage('u1', '') - ] - }) - ) - ) - act(() => { - vi.advanceTimersByTime(30_000) - }) - expect(onUnconfirmed).not.toHaveBeenCalled() - } finally { - vi.useRealTimers() - } - }) - it('clears image-only echoes one per landed user turn, not all at once', async () => { await mount('a') await act(async () => @@ -430,59 +384,6 @@ describe('useMobileNativeChatDrafts', () => { expect(state?.pending.map((pending) => pending.images)).toEqual([['file:///b.jpg']]) }) - it('registers no deadline when the transcript echo beat the ambiguous RPC rejection', async () => { - vi.useFakeTimers() - try { - await mount('a') - const origin = state?.captureSendOrigin('ping') - const onUnconfirmed = vi.fn() - - await act(async () => - renderer?.update( - createElement(Harness, { tabId: 'a', messages: [userTextMessage('m1', 'ping')] }) - ) - ) - act(() => { - if (origin) { - state?.holdUnconfirmedSend(origin, 'ping', onUnconfirmed) - } - }) - - expect(vi.getTimerCount()).toBe(0) - act(() => { - vi.advanceTimersByTime(30_000) - }) - expect(onUnconfirmed).not.toHaveBeenCalled() - } finally { - vi.useRealTimers() - } - }) - - it('surfaces uncertainty when no echo lands before the deadline', async () => { - vi.useFakeTimers() - try { - await mount('a') - const origin = state?.captureSendOrigin('ping') - const onUnconfirmed = vi.fn() - act(() => { - if (origin) { - state?.holdUnconfirmedSend(origin, 'ping', onUnconfirmed) - } - }) - - act(() => { - vi.advanceTimersByTime(19_999) - }) - expect(onUnconfirmed).not.toHaveBeenCalled() - act(() => { - vi.advanceTimersByTime(1) - }) - expect(onUnconfirmed).toHaveBeenCalledTimes(1) - } finally { - vi.useRealTimers() - } - }) - it('does not confirm an unconfirmed send against an older identical turn', async () => { vi.useFakeTimers() try { @@ -556,63 +457,6 @@ describe('useMobileNativeChatDrafts', () => { } }) - it('requires one new transcript echo per repeated unconfirmed send', async () => { - vi.useFakeTimers() - try { - await mount('a') - act(() => state?.setComposerText('ping')) - const origin = state?.captureSendOrigin('ping') - const firstUnconfirmed = vi.fn() - const secondUnconfirmed = vi.fn() - act(() => { - if (origin) { - state?.holdUnconfirmedSend(origin, 'ping', firstUnconfirmed) - state?.holdUnconfirmedSend(origin, 'ping', secondUnconfirmed) - } - }) - - await act(async () => - renderer?.update( - createElement(Harness, { tabId: 'a', messages: [userTextMessage('echo-1', 'ping')] }) - ) - ) - act(() => { - vi.advanceTimersByTime(30_000) - }) - - expect(firstUnconfirmed).not.toHaveBeenCalled() - expect(secondUnconfirmed).toHaveBeenCalledTimes(1) - } finally { - vi.useRealTimers() - } - }) - - it('does not retain a deadline when an ambiguous send settles after unmount', async () => { - vi.useFakeTimers() - try { - await mount('a') - const origin = state?.captureSendOrigin('ping') - const holdUnconfirmedSend = state?.holdUnconfirmedSend - const onUnconfirmed = vi.fn() - act(() => renderer?.unmount()) - renderer = null - - act(() => { - if (origin) { - holdUnconfirmedSend?.(origin, 'ping', onUnconfirmed) - } - }) - - expect(vi.getTimerCount()).toBe(0) - act(() => { - vi.advanceTimersByTime(30_000) - }) - expect(onUnconfirmed).not.toHaveBeenCalled() - } finally { - vi.useRealTimers() - } - }) - it('does not erase newer edits when an unconfirmed send lands', async () => { await mount('a') act(() => state?.setComposerText('submitted')) diff --git a/mobile/src/session/native-chat/input/MobileNativeChatBackgroundTasks.test.tsx b/mobile/src/session/native-chat/input/MobileNativeChatBackgroundTasks.test.tsx index 8e39cddc41d..55bd4868066 100644 --- a/mobile/src/session/native-chat/input/MobileNativeChatBackgroundTasks.test.tsx +++ b/mobile/src/session/native-chat/input/MobileNativeChatBackgroundTasks.test.tsx @@ -52,7 +52,6 @@ type Props = Parameters[0] type StopResult = Awaited> const REJECTED: StopResult = { status: 'rejected' } -const UNCONFIRMED: StopResult = { status: 'unknown' } const STOPPED: StopResult = { status: 'accepted', value: { cancelled: true }, sameFence: true } const NOTHING_STOPPED: StopResult = { status: 'accepted', @@ -98,20 +97,6 @@ describe('MobileNativeChatBackgroundTasks', () => { return mounted } - function styleOf(node: ReactTestInstance): Record { - const rendered: unknown = - typeof node.props.style === 'function' - ? node.props.style({ pressed: false }) - : node.props.style - const parts = Array.isArray(rendered) ? rendered : [rendered] - return Object.assign( - {}, - ...parts.filter( - (part): part is Record => typeof part === 'object' && part !== null - ) - ) - } - function header(mounted: ReactTestRenderer): ReactTestInstance { return mounted.root.findAll( (node) => @@ -132,31 +117,6 @@ describe('MobileNativeChatBackgroundTasks', () => { ) } - it('stops one row by its provider id and holds its button while the Stop is on its way', async () => { - let finish: (result: StopResult) => void = () => {} - const stop = vi.fn(() => new Promise((resolve) => (finish = resolve))) - const mounted = mount( - tasksFor( - { - state: 'monitoring', - supportsTaskStop: true, - children: [view('a'), view('b', { stoppable: false })] - }, - { stop } - ) - ) - expand(mounted) - const buttons = stopButtons(mounted) - expect(buttons.map((button) => button.props.accessibilityLabel)).toEqual(['Stop review a']) - act(() => buttons[0]!.props.onPress()) - act(() => buttons[0]!.props.onPress()) - expect(stop).toHaveBeenCalledTimes(1) - expect(stop).toHaveBeenCalledWith('task-a') - expect(stopButtons(mounted)[0]!.props.disabled).toBe(true) - await act(async () => finish(UNCONFIRMED)) - expect(stopButtons(mounted)[0]!.props.disabled).toBe(false) - }) - it('keeps a confirmed Stop held until its row leaves, and offers it again if the row comes back', async () => { let finish: (result: StopResult) => void = () => {} const stop = vi.fn(() => new Promise((resolve) => (finish = resolve))) @@ -206,30 +166,4 @@ describe('MobileNativeChatBackgroundTasks', () => { }) expect(stopButtons(mounted)[0]!.props.disabled).toBe(false) }) - - it('offers Stop all only to a host with no per-row stop that still accepts one', async () => { - let finish: (result: StopResult) => void = () => {} - const stop = vi.fn(() => new Promise((resolve) => (finish = resolve))) - const fallback = mount(tasksFor({ state: 'monitoring', children: [view('a')] }, { stop })) - expand(fallback) - expect(stopButtons(fallback).map((button) => button.props.accessibilityLabel)).toEqual([ - 'Stop background tasks' - ]) - const button = stopButtons(fallback)[0]! - expect(styleOf(button)).toMatchObject({ minHeight: 32, minWidth: 44 }) - expect(button.props.hitSlop).toBe(6) - expect(Number(styleOf(button).minHeight) + 2 * button.props.hitSlop).toBe(44) - act(() => button.props.onPress()) - act(() => button.props.onPress()) - expect(stop).toHaveBeenCalledTimes(1) - expect(stop).toHaveBeenCalledWith(undefined) - expect(stopButtons(fallback)[0]!.props.disabled).toBe(true) - await act(async () => finish(STOPPED)) - expect(stopButtons(fallback)[0]!.props.disabled).toBe(false) - const none = mount( - tasksFor({ state: 'monitoring', supportsStopAll: false, children: [view('a')] }) - ) - expand(none) - expect(stopButtons(none)).toEqual([]) - }) }) diff --git a/mobile/src/session/native-chat/input/mobile-native-chat-answer-stepping.test.ts b/mobile/src/session/native-chat/input/mobile-native-chat-answer-stepping.test.ts deleted file mode 100644 index ed8d3c730ea..00000000000 --- a/mobile/src/session/native-chat/input/mobile-native-chat-answer-stepping.test.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { - mobileNativeChatQuestionOffsets, - scheduleMobileClaudeAnswer, - MOBILE_NATIVE_CHAT_ADVANCE_BUFFER_MS, - MOBILE_NATIVE_CHAT_SUBMIT_DELAY_MS -} from './mobile-native-chat-answer-stepping' - -describe('mobileNativeChatQuestionOffsets', () => { - it('paces each question a full step apart, Enter 500ms after its body', () => { - expect(mobileNativeChatQuestionOffsets(0)).toEqual({ bodyAt: 0, enterAt: 500 }) - expect(mobileNativeChatQuestionOffsets(1)).toEqual({ bodyAt: 1000, enterAt: 1500 }) - expect(mobileNativeChatQuestionOffsets(2)).toEqual({ bodyAt: 2000, enterAt: 2500 }) - }) -}) - -describe('scheduleMobileClaudeAnswer', () => { - beforeEach(() => vi.useFakeTimers()) - afterEach(() => vi.useRealTimers()) - - it('writes each question body then its Enter, paced per step, one Enter per line', () => { - const events: string[] = [] - const timers = scheduleMobileClaudeAnswer( - ['', 'b', 'c'], - (line) => events.push(`body:${line}`), - () => events.push('enter') - ) - expect(timers).toHaveLength(6) - - vi.advanceTimersByTime(0) - expect(events).toEqual(['body:']) - vi.advanceTimersByTime(MOBILE_NATIVE_CHAT_SUBMIT_DELAY_MS - 1) - expect(events).toEqual(['body:']) - vi.advanceTimersByTime(1) - expect(events).toEqual(['body:', 'enter']) - vi.advanceTimersByTime(MOBILE_NATIVE_CHAT_ADVANCE_BUFFER_MS) - expect(events).toEqual(['body:', 'enter', 'body:b']) - - vi.runAllTimers() - expect(events).toEqual(['body:', 'enter', 'body:b', 'enter', 'body:c', 'enter']) - }) - - it('cancelling the returned timers stops all pending writes', () => { - const events: string[] = [] - const timers = scheduleMobileClaudeAnswer( - ['a', 'b'], - (line) => events.push(`body:${line}`), - () => events.push('enter') - ) - for (const timer of timers) { - clearTimeout(timer) - } - vi.runAllTimers() - expect(events).toEqual([]) - }) -}) diff --git a/mobile/src/session/native-chat/input/mobile-native-chat-answer-stepping.ts b/mobile/src/session/native-chat/input/mobile-native-chat-answer-stepping.ts deleted file mode 100644 index ad105d55a74..00000000000 --- a/mobile/src/session/native-chat/input/mobile-native-chat-answer-stepping.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { - nativeChatQuestionOffsets, - scheduleNativeChatAnswer, - NATIVE_CHAT_ADVANCE_BUFFER_MS, - NATIVE_CHAT_QUESTION_STEP_MS, - NATIVE_CHAT_SUBMIT_DELAY_MS -} from '../../../../../src/shared/native-chat/input/native-chat-answer-stepping' - -export const MOBILE_NATIVE_CHAT_ADVANCE_BUFFER_MS = NATIVE_CHAT_ADVANCE_BUFFER_MS -export const MOBILE_NATIVE_CHAT_QUESTION_STEP_MS = NATIVE_CHAT_QUESTION_STEP_MS -export const MOBILE_NATIVE_CHAT_SUBMIT_DELAY_MS = NATIVE_CHAT_SUBMIT_DELAY_MS -export const mobileNativeChatQuestionOffsets = nativeChatQuestionOffsets -export const scheduleMobileClaudeAnswer = scheduleNativeChatAnswer diff --git a/mobile/src/session/native-chat/input/mobile-native-chat-answered-prompts.test-fixture.ts b/mobile/src/session/native-chat/input/mobile-native-chat-answered-prompts.test-fixture.ts deleted file mode 100644 index 829ffd49bda..00000000000 --- a/mobile/src/session/native-chat/input/mobile-native-chat-answered-prompts.test-fixture.ts +++ /dev/null @@ -1,261 +0,0 @@ -// A structured Claude chat on the desktop, read back with `agentSession.history` after its owner -// approved a Bash call and answered an AskUserQuestion (Claude Code 2.1.300, 2026-10-15). - -import type { AgentJournalRenderItem } from '../../../../../src/shared/agent-session/journal/agent-session-journal-types' - -export const ANSWERED_PROMPT_ITEMS: AgentJournalRenderItem[] = [ - { - itemId: 'orca:1792024009236-87ed41e5430c47008ef7978ca5d60505', - revision: 0, - body: { - kind: 'message', - role: 'user', - blocks: [ - { - type: 'text', - text: 'Run the bash command: echo receipt-check > receipt.txt' - } - ] - }, - sequence: 43, - observedAt: 1792024010442, - turnScope: { - kind: 'thread' - } - }, - { - itemId: - 'orca:claude-tool%3A2ee61cec-1207-4f44-a915-b6adbcbf169b%3Atoolu_01FhhC72BuRiD3d9hXkAsURD', - revision: 2, - body: { - kind: 'tool-call', - name: 'Bash', - input: { - command: 'echo receipt-check > receipt.txt', - description: 'Write receipt-check to receipt.txt' - }, - callId: 'toolu_01FhhC72BuRiD3d9hXkAsURD', - state: 'completed', - output: { - head: '(Bash completed with no output)', - byteLength: 31, - digest: 'cac1685585590361647e7a27b58a25a590f335bfcd0ab70fcdc0424e40c20843', - truncated: false - } - }, - sequence: 46, - observedAt: 1792024014854, - turnScope: { - kind: 'turn', - turnItemId: - 'legacy:claude:2ee61cec-1207-4f44-a915-b6adbcbf169b:turn-lifecycle%3A6a80bc01-4be4-466f-bd98-5cae8368ed1d' - } - }, - { - itemId: - 'orca:claude-prompt%3Aclaude_c65b4304_2acf_4eec_a749_e06876328e0c%3A79c45210-730e-482c-82bd-db0708c992e5', - revision: 2, - body: { - kind: 'approval', - title: 'Allow Bash?', - displayName: 'Bash', - description: 'Write receipt-check to receipt.txt', - blockedPath: '/private/tmp/mnw-scratch/receipt.txt', - detail: - '{\n "command": "echo receipt-check > receipt.txt",\n "description": "Write receipt-check to receipt.txt"\n}', - options: [ - { - id: 'allow', - label: 'Allow' - }, - { - id: 'allowForSession', - label: 'Allow for this session' - }, - { - id: 'deny', - label: 'Deny' - } - ], - resolution: { - state: 'resolved', - selectedOptionId: 'allow', - resolvedBy: 'desktop-renderer', - resolvedAt: 1792024037937 - } - }, - sequence: 48, - observedAt: 1792024014910, - turnScope: { - kind: 'turn', - turnItemId: - 'legacy:claude:2ee61cec-1207-4f44-a915-b6adbcbf169b:turn-lifecycle%3A6a80bc01-4be4-466f-bd98-5cae8368ed1d' - } - }, - { - itemId: 'claude:2ee61cec-1207-4f44-a915-b6adbcbf169b:4408cf7b-bbe2-4a5d-aa80-6471db6d9c18', - revision: 2, - body: { - kind: 'message', - role: 'assistant', - blocks: [ - { - type: 'text', - text: 'I ran the command. `receipt.txt` in `/private/tmp/mnw-scratch` now holds the line `receipt-check`.' - } - ] - }, - sequence: 51, - observedAt: 1792024040901, - turnScope: { - kind: 'turn', - turnItemId: - 'legacy:claude:2ee61cec-1207-4f44-a915-b6adbcbf169b:turn-lifecycle%3A6a80bc01-4be4-466f-bd98-5cae8368ed1d' - } - }, - { - itemId: 'orca:1792024048049-e58989ce33eb411a970225d03d2e4a18', - revision: 0, - body: { - kind: 'message', - role: 'user', - blocks: [ - { - type: 'text', - text: 'Use the AskUserQuestion tool to ask me whether I prefer tea or coffee, then reply with my answer in one short sentence.' - } - ] - }, - sequence: 57, - observedAt: 1792024048075, - turnScope: { - kind: 'thread' - } - }, - { - itemId: - 'orca:claude-tool%3A2ee61cec-1207-4f44-a915-b6adbcbf169b%3Atoolu_01WByTgphD4HFByq9zPKXn2J', - revision: 2, - body: { - kind: 'tool-call', - name: 'AskUserQuestion', - input: { - questions: [ - { - question: 'Do you prefer tea or coffee?', - header: 'Drink', - multiSelect: false, - options: [ - { - label: 'Tea', - description: 'You prefer tea.' - }, - { - label: 'Coffee', - description: 'You prefer coffee.' - } - ] - } - ] - }, - callId: 'toolu_01WByTgphD4HFByq9zPKXn2J', - state: 'completed', - output: { - head: 'Your questions have been answered: "Do you prefer tea or coffee?"="Coffee". You can now continue with these answers in mind.', - byteLength: 124, - digest: '65dfb0af315c9ab1c70fc26c6c6bfb4ef0138216e35c89cf332927d10cbb629d', - truncated: false - } - }, - sequence: 60, - observedAt: 1792024052205, - turnScope: { - kind: 'turn', - turnItemId: - 'legacy:claude:2ee61cec-1207-4f44-a915-b6adbcbf169b:turn-lifecycle%3A1ea7cf09-10c6-4635-93bb-8d4b16fb1c60' - } - }, - { - itemId: - 'orca:claude-prompt%3Aclaude_c65b4304_2acf_4eec_a749_e06876328e0c%3A6fd8be6a-830f-44b4-a3ef-a7f044cd4a4f', - revision: 2, - body: { - kind: 'question', - question: 'Do you prefer tea or coffee?', - options: [ - { - id: 'q1:choice-1', - label: 'Tea', - description: 'You prefer tea.' - }, - { - id: 'q1:choice-2', - label: 'Coffee', - description: 'You prefer coffee.' - } - ], - freeTextQuestionId: 'q1', - questions: [ - { - id: 'q1', - question: 'Do you prefer tea or coffee?', - header: 'Drink', - multiSelect: false, - options: [ - { - id: 'q1:choice-1', - label: 'Tea', - description: 'You prefer tea.' - }, - { - id: 'q1:choice-2', - label: 'Coffee', - description: 'You prefer coffee.' - } - ], - freeTextQuestionId: 'q1' - } - ], - resolution: { - state: 'resolved', - selectedOptionId: 'question-group:[{"questionId":"q1","optionIds":["q1:choice-2"]}]', - answers: [ - { - questionId: 'q1', - optionIds: ['q1:choice-2'] - } - ], - resolvedBy: 'desktop-renderer', - resolvedAt: 1792024081980 - } - }, - sequence: 62, - observedAt: 1792024052228, - turnScope: { - kind: 'turn', - turnItemId: - 'legacy:claude:2ee61cec-1207-4f44-a915-b6adbcbf169b:turn-lifecycle%3A1ea7cf09-10c6-4635-93bb-8d4b16fb1c60' - } - }, - { - itemId: 'claude:2ee61cec-1207-4f44-a915-b6adbcbf169b:32c8a879-b68c-41ba-9a9e-4b844fa07890', - revision: 2, - body: { - kind: 'message', - role: 'assistant', - blocks: [ - { - type: 'text', - text: 'You prefer coffee.' - } - ] - }, - sequence: 65, - observedAt: 1792024084176, - turnScope: { - kind: 'turn', - turnItemId: - 'legacy:claude:2ee61cec-1207-4f44-a915-b6adbcbf169b:turn-lifecycle%3A1ea7cf09-10c6-4635-93bb-8d4b16fb1c60' - } - } -] diff --git a/mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.ts b/mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.ts index 96460626c77..c14ccdac4fd 100644 --- a/mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.ts +++ b/mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.ts @@ -8,7 +8,7 @@ import { import type { AskAnswerSelection } from '../../../../../src/shared/native-chat/input/native-chat-ask-answer' import type { AskPrompt } from '../../../../../src/shared/native-chat/input/native-chat-ask-types' import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' -import { MOBILE_NATIVE_CHAT_QUESTION_STEP_MS } from './mobile-native-chat-answer-stepping' +import { NATIVE_CHAT_QUESTION_STEP_MS } from '../../../../../src/shared/native-chat/input/native-chat-answer-stepping' import { openMobileNativeChatSendBudget, sendMobileNativeChatMessageWithOutcome @@ -229,11 +229,11 @@ export function useMobileNativeChatAnswerSend(args: { return fail() } if (index < groups.length - 1) { - if (!(await wait(MOBILE_NATIVE_CHAT_QUESTION_STEP_MS))) { + if (!(await wait(NATIVE_CHAT_QUESTION_STEP_MS))) { return false } // Pacing is deliberate, not transport latency — don't charge it to the budget. - deadline += MOBILE_NATIVE_CHAT_QUESTION_STEP_MS + deadline += NATIVE_CHAT_QUESTION_STEP_MS } } return groups.length > 0 && writeTurnsRef.current.get(handle) === turn diff --git a/mobile/src/session/native-chat/input/use-mobile-structured-agent-options.chat-return.test.ts b/mobile/src/session/native-chat/input/use-mobile-structured-agent-options.chat-return.test.ts deleted file mode 100644 index 572915f7b60..00000000000 --- a/mobile/src/session/native-chat/input/use-mobile-structured-agent-options.chat-return.test.ts +++ /dev/null @@ -1,107 +0,0 @@ -// One phone chat view serves every chat tab, so returning to a chat must not wait on its next read. - -import { act } from 'react-test-renderer' -import { expect, it } from 'vitest' -import type { AgentSessionOptionsResult } from '../../../../../src/shared/agent-session/options/agent-session-options-result' -import { - BASE, - OPTIONS, - accepted, - currentValueOf, - deferred, - mountOptions, - optionsClient, - recordingMutate, - settle -} from './use-mobile-structured-agent-options.test-fixture' - -const COMMAND = 'compact' -const CHAT_A: AgentSessionOptionsResult = { - ...OPTIONS, - acceptsImages: true, - conversationCommands: [COMMAND], - current: { - model: 'gpt-fast', - effort: 'low', - permissionMode: 'own', - reportedPermissionMode: 'ask', - acceptedInputSources: { model: 'saved', effort: 'saved' } - } -} -const CHAT_B: AgentSessionOptionsResult = { - ...OPTIONS, - acceptsImages: false, - current: { model: 'gpt-live', effort: 'high', permissionMode: 'ask' } -} - -/** Host replies per chat; later reads for chat A wait until the test answers them. */ -function chats() { - const later: ReturnType>[] = [] - let readsOfA = 0 - let readingB = false - const client = optionsClient(() => { - if (readingB) { - return Promise.resolve(CHAT_B) - } - if (readsOfA++ === 0) { - return Promise.resolve(CHAT_A) - } - const reply = deferred() - later.push(reply) - return reply.promise - }) - const send = client.client.sendRequest - client.client.sendRequest = (method, params, options) => { - if (method === 'agentSession.options') { - readingB = JSON.stringify(params).includes('chat-b') - } - return send(method, params, options) - } - return { client, later } -} - -it("shows a chat's last answer on return, without its reports, until its new read lands", async () => { - const { client, later } = chats() - const { mutate } = recordingMutate(async () => accepted({ key: 'model', value: 'x' }, true)) - const harness = await mountOptions({ - ...BASE, - sessionId: 'chat-a', - fence: 1, - client: client.client, - mutate, - permissionOwn: true, - sendSelection: true - }) - await harness.rerender({ sessionId: 'chat-b', fence: 7 }) - expect(currentValueOf(harness.current().optionSnapshot, 'model')).toBe('gpt-live') - const commitsOnB = harness.commits.length - await harness.rerender({ sessionId: 'chat-a', fence: 2 }) - expect(later).toHaveLength(1) - // From the first commit on return, not only after a later effect catches up. - for (const commit of harness.commits.slice(commitsOnB)) { - expect(currentValueOf(commit.optionSnapshot, 'model')).toBe('gpt-fast') - } - const shown = harness.current() - expect(currentValueOf(shown.optionSnapshot, 'model')).toBe('gpt-fast') - expect(currentValueOf(shown.optionSnapshot, 'effort')).toBe('low') - expect(shown.conversationCommands).toEqual([COMMAND]) - expect(shown.acceptsImages).toBe(true) - // Saved permission intent survives a restart independently of runtime reports. - expect(currentValueOf(shown.optionSnapshot, 'permissionMode')).toBe('own') - expect(shown.sendSelection()).toEqual({ selection: {} }) - - await act(async () => { - later[0].resolve({ - ...CHAT_A, - conversationCommands: [], - current: { ...CHAT_A.current, model: 'gpt-live' } - }) - }) - await settle() - const answered = harness.current() - expect(currentValueOf(answered.optionSnapshot, 'model')).toBe('gpt-live') - expect(currentValueOf(answered.optionSnapshot, 'permissionMode')).toBe('own') - expect(answered.conversationCommands).toEqual([]) - expect(answered.sendSelection()).toEqual({ selection: { model: 'gpt-live', effort: 'low' } }) - await harness.unmount() -}) diff --git a/mobile/src/session/native-chat/mobile-native-chat-diff.test.ts b/mobile/src/session/native-chat/mobile-native-chat-diff.test.ts deleted file mode 100644 index cb2936e8c51..00000000000 --- a/mobile/src/session/native-chat/mobile-native-chat-diff.test.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { diffFromText } from '../../../../src/shared/native-chat/tools/native-chat-diff' - -describe('diffFromText', () => { - it('caps large diffs before creating render rows', () => { - const text = Array.from( - { length: 1_000 }, - (_unused, index) => `${index % 2 === 0 ? '+' : '-'}line-${index}` - ).join('\n') - const lines = diffFromText(text) - - expect(lines).toHaveLength(120) - expect(lines?.at(-1)).toEqual({ kind: 'meta', text: '… diff truncated …' }) - }) - - it('honors a smaller caller-owned aggregate row budget', () => { - const text = Array.from( - { length: 100 }, - (_unused, index) => `${index % 2 === 0 ? '+' : '-'}line-${index}` - ).join('\n') - - expect(diffFromText(text, 20)).toHaveLength(20) - }) -}) diff --git a/mobile/src/session/native-chat/mobile-native-chat-merge.test.ts b/mobile/src/session/native-chat/mobile-native-chat-merge.test.ts deleted file mode 100644 index 3b922e822f0..00000000000 --- a/mobile/src/session/native-chat/mobile-native-chat-merge.test.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { mergeNativeChatMessages } from '../../../../src/shared/native-chat/native-chat-merge' -import type { NativeChatMessage } from '../../../../src/shared/native-chat/native-chat-types' - -function msg(id: string, overrides: Partial = {}): NativeChatMessage { - return { - id, - role: 'assistant', - blocks: [{ type: 'text', text: id }], - timestamp: 0, - source: 'transcript', - ...overrides - } -} - -describe('mergeNativeChatMessages', () => { - it('appends new ids in arrival order', () => { - const merged = mergeNativeChatMessages([msg('a')], [msg('b'), msg('c')]) - expect(merged.map((m) => m.id)).toEqual(['a', 'b', 'c']) - }) - - it('replaces a re-emitted id in place without reordering', () => { - const merged = mergeNativeChatMessages( - [msg('a'), msg('b'), msg('c')], - [msg('b', { blocks: [{ type: 'text', text: 'updated' }] })] - ) - expect(merged.map((m) => m.id)).toEqual(['a', 'b', 'c']) - expect(merged[1]!.blocks).toEqual([{ type: 'text', text: 'updated' }]) - }) - - it('does not let a lower-priority source overwrite a higher one', () => { - const merged = mergeNativeChatMessages( - [msg('a', { source: 'transcript', blocks: [{ type: 'text', text: 'real' }] })], - [msg('a', { source: 'scrape', blocks: [{ type: 'text', text: 'scraped' }] })] - ) - expect(merged[0]!.blocks).toEqual([{ type: 'text', text: 'real' }]) - }) - - it('returns the existing array unchanged for an empty batch', () => { - const existing = [msg('a')] - expect(mergeNativeChatMessages(existing, [])).toBe(existing) - }) - - it('does not mutate the existing array', () => { - const existing = [msg('a')] - mergeNativeChatMessages(existing, [msg('b')]) - expect(existing.map((m) => m.id)).toEqual(['a']) - }) -}) diff --git a/mobile/src/session/native-chat/mobile-native-chat-merger-oracle.test.ts b/mobile/src/session/native-chat/mobile-native-chat-merger-oracle.test.ts deleted file mode 100644 index d0f7b928f97..00000000000 --- a/mobile/src/session/native-chat/mobile-native-chat-merger-oracle.test.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { describe, expect, it } from 'vitest' -import type { NativeChatMessage } from '../../../../src/shared/native-chat/native-chat-types' -import { - applyAppend, - createNativeChatMerger, - mergeNativeChatMessages, - replaceList -} from '../../../../src/shared/native-chat/native-chat-merge' - -function msg(id: string, overrides: Partial = {}): NativeChatMessage { - return { - id, - role: 'assistant', - blocks: [{ type: 'text', text: id }], - timestamp: 0, - source: 'transcript', - ...overrides - } -} - -// Compare each adversarial prefix with the pure merger so cached indexes cannot diverge from a full rebuild. -describe('mobile stateful merger — oracle vs pure merge', () => { - const base = [msg('a'), msg('b', { source: 'hook' })] - const batches: NativeChatMessage[][] = [ - [msg('c')], - [], - [msg('b', { source: 'transcript', blocks: [{ type: 'text', text: 'final' }] })], - [msg('b', { source: 'scrape' })], - [msg('a')], - [msg('d'), msg('e')] - ] - - it('matches the pure merge for every prefix', () => { - const merger = createNativeChatMerger() - replaceList(merger, base) - let pure = mergeNativeChatMessages(base, []) - expect(merger.list).toEqual(pure) - for (const batch of batches) { - const out = applyAppend(merger, batch) - pure = mergeNativeChatMessages(pure, batch) - expect(out).toEqual(pure) - } - }) - - it('keeps prior row identity on a pure tail append', () => { - const merger = createNativeChatMerger() - replaceList(merger, base) - const before = merger.list - const tail = msg('z') - const after = applyAppend(merger, [tail]) - expect(after).not.toBe(before) - expect(after[0]).toBe(before[0]) - expect(after[after.length - 1]).toBe(tail) - }) - - it('bounds live appends and rebuilds the cached indexes for the retained tail', () => { - const merger = createNativeChatMerger() - replaceList(merger, [msg('a'), msg('b'), msg('c')]) - - expect(applyAppend(merger, [msg('d'), msg('e')], 3).map((m) => m.id)).toEqual(['c', 'd', 'e']) - expect(merger.indexById.has('a')).toBe(false) - expect(merger.indexById.get('c')).toBe(0) - expect( - applyAppend(merger, [msg('d', { blocks: [{ type: 'text', text: 'updated' }] })], 3)[1] - ).toMatchObject({ id: 'd', blocks: [{ type: 'text', text: 'updated' }] }) - }) -}) diff --git a/mobile/src/session/native-chat/transcript/MobileNativeChatTurnStatus.test.ts b/mobile/src/session/native-chat/transcript/MobileNativeChatTurnStatus.test.ts deleted file mode 100644 index 52ae2dd631a..00000000000 --- a/mobile/src/session/native-chat/transcript/MobileNativeChatTurnStatus.test.ts +++ /dev/null @@ -1,147 +0,0 @@ -import { createElement, type ReactNode } from 'react' -import { act, create, type ReactTestInstance, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { AppStateStatus } from 'react-native' - -const appState = vi.hoisted(() => ({ - current: 'active', - listeners: new Set<(state: AppStateStatus) => void>() -})) - -vi.mock('react-native', async () => { - const React = await import('react') - const Text = ({ children, ...props }: { children?: ReactNode }): unknown => - React.createElement('Text', props, children) - return { - AppState: { - get currentState() { - return appState.current - }, - addEventListener: (_event: string, listener: (state: AppStateStatus) => void) => { - appState.listeners.add(listener) - return { - remove: () => { - appState.listeners.delete(listener) - } - } - } - }, - ActivityIndicator: (props: Record) => - React.createElement('ActivityIndicator', props), - Pressable: ({ children, ...props }: { children?: ReactNode }) => - React.createElement('Pressable', props, children), - Text, - View: ({ children, ...props }: { children?: ReactNode }) => - React.createElement('View', props, children), - StyleSheet: { create: (styles: unknown) => styles, hairlineWidth: 1 } - } -}) -vi.mock('lucide-react-native', () => ({ ChevronRight: 'ChevronRight' })) - -import { MobileNativeChatTurnStatus } from './MobileNativeChatTurnStatus' -import { findAllByHostType } from '../../../test-support/react-test-renderer-host-nodes' - -const labels = (node: ReactTestInstance): string[] => - findAllByHostType(node, 'Text').map((text) => String(text.children.join(''))) - -let renderer: ReactTestRenderer | null = null - -beforeEach(() => { - vi.useFakeTimers() - vi.setSystemTime(new Date('2026-09-04T00:00:00Z')) - appState.current = 'active' - appState.listeners.clear() -}) - -afterEach(() => { - act(() => renderer?.unmount()) - renderer = null - vi.restoreAllMocks() - vi.useRealTimers() -}) - -describe('MobileNativeChatTurnStatus', () => { - function changeAppState(state: AppStateStatus) { - act(() => { - appState.current = state - for (const listener of appState.listeners) { - listener(state) - } - }) - } - function render(props: { - startedAt: number | null - workedSeconds?: number | null - verdict?: 'interruption' | 'cancellation' - expanded?: boolean - onToggleExpanded?: () => void - }): ReactTestRenderer { - act(() => { - renderer = create(createElement(MobileNativeChatTurnStatus, props)) - }) - return renderer! - } - - it('stops clock callbacks in the background and catches up immediately on resume', () => { - const tree = render({ startedAt: Date.now() }) - act(() => { - vi.advanceTimersByTime(2_000) - }) - expect(labels(tree.root)).toEqual(['Working for 2s']) - - changeAppState('background') - const clockReads = vi.spyOn(Date, 'now') - act(() => { - vi.advanceTimersByTime(60_000) - }) - expect(clockReads).not.toHaveBeenCalled() - expect(vi.getTimerCount()).toBe(0) - expect(labels(tree.root)).toEqual(['Working for 2s']) - - changeAppState('active') - expect(labels(tree.root)).toEqual(['Working for 1m 2s']) - expect(vi.getTimerCount()).toBe(1) - act(() => { - vi.advanceTimersByTime(1_000) - }) - expect(labels(tree.root)).toEqual(['Working for 1m 3s']) - }) - - it('keeps the original pre-stamp epoch through background and settlement transitions', () => { - const tree = render({ startedAt: null }) - act(() => { - vi.advanceTimersByTime(3_000) - }) - expect(labels(tree.root)).toEqual(['Working for 3s']) - changeAppState('background') - act(() => { - vi.advanceTimersByTime(10_000) - }) - act(() => - tree.update(createElement(MobileNativeChatTurnStatus, { startedAt: null, workedSeconds: 8 })) - ) - changeAppState('active') - expect(labels(tree.root)).toEqual(['Worked for 8s']) - expect(vi.getTimerCount()).toBe(0) - - act(() => tree.update(createElement(MobileNativeChatTurnStatus, { startedAt: null }))) - expect(labels(tree.root)).toEqual(['Working for 13s']) - expect(vi.getTimerCount()).toBe(1) - act(() => tree.unmount()) - expect(vi.getTimerCount()).toBe(0) - expect(appState.listeners.size).toBe(0) - }) - - it('creates no clock while initially backgrounded and uses a supplied start time on resume', () => { - appState.current = 'background' - const startedAt = Date.now() - 5_000 - const tree = render({ startedAt }) - expect(vi.getTimerCount()).toBe(0) - act(() => { - vi.advanceTimersByTime(15_000) - }) - changeAppState('active') - expect(labels(tree.root)).toEqual(['Working for 20s']) - expect(vi.getTimerCount()).toBe(1) - }) -}) diff --git a/mobile/src/session/native-chat/transcript/mobile-agent-message-renderer.test-fixture.ts b/mobile/src/session/native-chat/transcript/mobile-agent-message-renderer.test-fixture.ts index 301d7c57d18..abb586ea7d8 100644 --- a/mobile/src/session/native-chat/transcript/mobile-agent-message-renderer.test-fixture.ts +++ b/mobile/src/session/native-chat/transcript/mobile-agent-message-renderer.test-fixture.ts @@ -63,15 +63,11 @@ vi.mock('lucide-react-native', () => ({ Wrench: 'Wrench', Terminal: 'Terminal' })) -const proseRenders = vi.hoisted(() => ({ count: 0 })) -export function proseRenderCount() { - return proseRenders.count -} + vi.mock('../../../components/MobileMarkdown', async () => { const React = await import('react') return { MobileMarkdown: (props: ComponentProps) => { - proseRenders.count++ return React.createElement('MobileMarkdown', props) } } diff --git a/mobile/src/session/native-chat/transcript/mobile-native-chat-stream-frame.test.ts b/mobile/src/session/native-chat/transcript/mobile-native-chat-stream-frame.test.ts new file mode 100644 index 00000000000..59938201fe1 --- /dev/null +++ b/mobile/src/session/native-chat/transcript/mobile-native-chat-stream-frame.test.ts @@ -0,0 +1,62 @@ +import { describe, expect, it } from 'vitest' +import { + createNativeChatMerger, + replaceList +} from '../../../../../src/shared/native-chat/native-chat-merge' +import type { NativeChatMessage } from '../../../../../src/shared/native-chat/native-chat-types' +import { applyMobileNativeChatStreamFrame } from './mobile-native-chat-stream-frame' + +function message(id: string): NativeChatMessage { + return { + id, + role: 'assistant', + blocks: [{ type: 'text', text: id }], + timestamp: 0, + source: 'transcript' + } +} + +describe('applyMobileNativeChatStreamFrame', () => { + it('replaces a partially overlapping replay that no longer extends the retained tail', () => { + const merger = createNativeChatMerger() + replaceList(merger, ['old-1', 'shared', 'old-tail'].map(message)) + + // Keep hasMore true so only the contiguity check can reject the interleaved row. + const replay = [message('shared'), message('compacted-summary'), message('old-tail')] + expect( + applyMobileNativeChatStreamFrame({ + merger, + frame: { type: 'snapshot', messages: replay, hasMore: true, beforeOffset: 9 }, + limit: 100, + replaceSnapshot: false + }) + ).toEqual({ + kind: 'messages', + messages: replay, + hasMore: true, + beforeOffset: 9, + windowReplaced: true + }) + }) + + it('replaces retained history when replay metadata says no earlier rows remain', () => { + const merger = createNativeChatMerger() + replaceList(merger, ['removed-1', 'removed-2', 'a', 'b'].map(message)) + + const replay = [message('a'), message('b')] + expect( + applyMobileNativeChatStreamFrame({ + merger, + frame: { type: 'snapshot', messages: replay, hasMore: false, beforeOffset: 0 }, + limit: 100, + replaceSnapshot: false + }) + ).toEqual({ + kind: 'messages', + messages: replay, + hasMore: false, + beforeOffset: 0, + windowReplaced: true + }) + }) +}) diff --git a/mobile/src/session/native-chat/transcript/native-chat-tool-run-words.test.ts b/mobile/src/session/native-chat/transcript/native-chat-tool-run-words.test.ts deleted file mode 100644 index 3258cc79084..00000000000 --- a/mobile/src/session/native-chat/transcript/native-chat-tool-run-words.test.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import type { SupportedUiLocale } from '../../../../../src/shared/ui-locale' -import { - joinNativeChatToolRunClauses, - nativeChatToolRunSentence -} from '../../../../../src/shared/native-chat/tools/native-chat-tool-run-sentence' -import { getMobileUiLocale } from '../../../i18n/mobile-i18n' -import { nativeChatToolRunWords } from './native-chat-tool-run-words' - -vi.mock('../../../i18n/mobile-i18n', () => ({ - getMobileUiLocale: vi.fn(() => 'en') -})) - -const joiners = { - pair: (first: string, second: string) => `${first} | ${second}`, - list: (leading: readonly string[], last: string) => [...leading, last].join(' | ') -} - -function mobileWords(locale: SupportedUiLocale) { - vi.mocked(getMobileUiLocale).mockReturnValue(locale) - return { ...nativeChatToolRunWords((_key, fallback) => fallback), ...joiners } -} - -describe('mobile tool-run sentence continuations', () => { - it('keeps German noun capitalization through the sentence formatter', () => { - const words = mobileWords('de') - expect( - nativeChatToolRunSentence( - [ - { type: 'tool-call', name: 'read', input: {} }, - { type: 'tool-call', name: 'Bash', input: { command: 'orca snapshot --page p1' } } - ], - {}, - { - ...words, - clause: (category) => (category === 'browser' ? 'Browser verwendet' : 'Datei gelesen') - } - ) - ).toBe('Datei gelesen | Browser verwendet') - }) - - it('uses Turkish casing for both dotted and dotless I in later clauses', () => { - expect(joinNativeChatToolRunClauses(['Başladı', 'İnceledi', 'Isındı'], mobileWords('tr'))).toBe( - 'Başladı | inceledi | ısındı' - ) - }) -}) diff --git a/mobile/src/session/native-chat/transcript/native-chat-turn-draw-order-scaling.test.ts b/mobile/src/session/native-chat/transcript/native-chat-turn-draw-order-scaling.test.ts deleted file mode 100644 index 33e322c37ea..00000000000 --- a/mobile/src/session/native-chat/transcript/native-chat-turn-draw-order-scaling.test.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { expect, it } from 'vitest' -import { nativeChatTurnDrawOrder } from '../../../../../src/shared/native-chat/transcript/native-chat-turn-grouping' -import { nativeChatTurnMembership } from '../../../../../src/shared/native-chat/transcript/native-chat-turn-membership' -import type { - AgentJournalItemBody, - AgentJournalRenderItem -} from '../../../../../src/shared/agent-session/journal/agent-session-journal-types' - -it.each([10, 100])( - 'reads turn ownership linearly for %i queued openers and earlier-turn rows', - (count) => { - const messages = [ - { id: 'first', role: 'user' as const }, - ...Array.from({ length: count }, (_, index) => ({ - id: `queued-${index}`, - role: 'user' as const - })), - ...Array.from({ length: count }, (_, index) => ({ - id: `tail-${index}`, - role: 'assistant' as const - })), - ...Array.from({ length: count }, (_, index) => ({ - id: `answer-${index}`, - role: 'assistant' as const - })) - ] - const keys = [ - 'first', - ...Array.from({ length: count }, (_, index) => `queued-${index}`), - ...Array.from({ length: count }, () => 'first'), - ...Array.from({ length: count }, (_, index) => `queued-${index}`) - ] - const openers = new Set(keys.slice(0, count + 1)) - let reads = 0 - keys.forEach((key, index) => { - Object.defineProperty(keys, index, { - get: () => { - reads += 1 - return key - } - }) - }) - const order = nativeChatTurnDrawOrder(messages, keys, openers) - const visits = reads - expect(order?.map((index) => messages[index]?.id)).toEqual([ - 'first', - ...Array.from({ length: count }, (_, index) => `tail-${index}`), - ...Array.from({ length: count }, (_, index) => [`queued-${index}`, `answer-${index}`]).flat() - ]) - const journalItems: AgentJournalRenderItem[] = [] - const append = (itemId: string, body: AgentJournalItemBody, turnItemId: string) => { - const sequence = journalItems.length + 1 - journalItems.push({ - itemId, - body, - revision: 0, - sequence, - observedAt: sequence, - turnScope: { kind: 'turn', turnItemId } - }) - } - append('first', { kind: 'message', role: 'user', blocks: [] }, 'turn-first') - append( - 'turn-first', - { kind: 'turn', turnId: 'first', state: 'completed', userItemId: 'first' }, - 'turn-first' - ) - for (let index = 0; index < count; index += 1) { - append(`queued-${index}`, { kind: 'message', role: 'user', blocks: [] }, `turn-${index}`) - } - for (let index = 0; index < count; index += 1) { - append(`tail-${index}`, { kind: 'message', role: 'assistant', blocks: [] }, 'turn-first') - } - for (let index = 0; index < count; index += 1) { - append( - `turn-${index}`, - { kind: 'turn', turnId: `t${index}`, state: 'completed', userItemId: `queued-${index}` }, - `turn-${index}` - ) - append(`answer-${index}`, { kind: 'message', role: 'assistant', blocks: [] }, `turn-${index}`) - } - const membership = nativeChatTurnMembership(messages, { items: journalItems, submissions: [] }) - expect(membership.turnKeys).toEqual(keys) - expect(membership.drawOrder).toEqual(order) - expect(visits).toBeLessThanOrEqual(messages.length * 4) - } -) diff --git a/mobile/src/session/native-chat/transcript/use-mobile-structured-agent-turn-timing.test.tsx b/mobile/src/session/native-chat/transcript/use-mobile-structured-agent-turn-timing.test.tsx deleted file mode 100644 index 5e024daf652..00000000000 --- a/mobile/src/session/native-chat/transcript/use-mobile-structured-agent-turn-timing.test.tsx +++ /dev/null @@ -1,80 +0,0 @@ -import { createElement } from 'react' -import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, describe, expect, it, vi } from 'vitest' -import type { - AgentJournalRenderItem, - AgentJournalSubmission, - AgentJournalTurnLifecycle -} from '../../../../../src/shared/agent-session/journal/agent-session-journal-types' -import { agentJournalTurnBody } from '../../../../../src/shared/agent-session/lifecycle/agent-session-turn-record' -import { useMobileStructuredAgentTurnTiming } from './use-mobile-structured-agent-turn-timing' - -// Skew the host clock by an hour so unconverted timestamp leakage is obvious. -const HOST_START = 3_600_000_000 -const CLIENT_NOW = 12_345_000 - -function user(itemId: string, sequence: number): AgentJournalRenderItem { - return { - itemId, - revision: 0, - sequence, - observedAt: HOST_START + sequence, - body: { kind: 'message', role: 'user', blocks: [{ type: 'text', text: itemId }] } - } -} - -function lifecycle( - turnId: string, - sequence: number, - turn: Omit, - observedAt: number -): AgentJournalRenderItem { - return { - itemId: `lifecycle-${turnId}`, - revision: 1, - sequence, - observedAt, - body: agentJournalTurnBody({ turnId, ...turn }) - } -} - -type Timing = ReturnType -const NO_SUBMISSIONS: readonly AgentJournalSubmission[] = [] - -describe('useMobileStructuredAgentTurnTiming', () => { - let renderer: ReactTestRenderer | null = null - let timing: Timing | null = null - - function Harness({ - items, - submissions = NO_SUBMISSIONS, - turnId, - hostClock - }: { - items: readonly AgentJournalRenderItem[] - submissions?: readonly AgentJournalSubmission[] - turnId: string | null - hostClock?: { hostNow: number; receivedAt: number } - }): null { - timing = useMobileStructuredAgentTurnTiming({ items, submissions, hostClock }, turnId) - return null - } - - afterEach(() => { - act(() => renderer?.unmount()) - renderer = null - timing = null - vi.useRealTimers() - }) - - it('leaves the anchor null when an older host records no start', () => { - vi.useFakeTimers() - vi.setSystemTime(CLIENT_NOW) - const items = [user('u1', 1), lifecycle('t1', 2, { state: 'running' }, HOST_START)] - act(() => { - renderer = create(createElement(Harness, { items, turnId: 't1' })) - }) - expect(timing?.workingStartedAt).toBeNull() - expect(timing?.settledTurns.size).toBe(0) - }) -}) diff --git a/mobile/src/session/native-chat/use-mobile-native-chat-terminal-stream.test.ts b/mobile/src/session/native-chat/use-mobile-native-chat-terminal-stream.test.ts index daa4e74a737..084b090f152 100644 --- a/mobile/src/session/native-chat/use-mobile-native-chat-terminal-stream.test.ts +++ b/mobile/src/session/native-chat/use-mobile-native-chat-terminal-stream.test.ts @@ -5,19 +5,13 @@ import { useMobileNativeChatTerminalStream } from './use-mobile-native-chat-term describe('useMobileNativeChatTerminalStream', () => { let renderer: ReactTestRenderer | null = null - let harnessRenderCount = 0 const subscriptionsRef = { current: new Map void>() } const subscribingRef = { current: new Set() } const leaseOnlyRef = { current: new Set() } const webReadyRef = { current: new Set(['terminal-1']) } - let subscribeOpensLeaseOnly = false const registerSubscription = (handle: string): boolean => { subscriptionsRef.current.set(handle, () => {}) - if (subscribeOpensLeaseOnly) { - leaseOnlyRef.current.add(handle) - } else { - leaseOnlyRef.current.delete(handle) - } + leaseOnlyRef.current.delete(handle) return true } const subscribe = vi.fn(registerSubscription) @@ -25,7 +19,6 @@ describe('useMobileNativeChatTerminalStream', () => { subscriptionsRef.current.delete(handle) leaseOnlyRef.current.delete(handle) }) - const notifyWebReadyRef = { current: (_handle: string, _wasAlreadyReady: boolean): void => {} } const notifyListedHandlesRef = { current: (_liveHandles: ReadonlySet): void => {} } const hasTabsRecoveryNeedRef = { current: (): boolean => false } @@ -33,9 +26,7 @@ describe('useMobileNativeChatTerminalStream', () => { subscriptionsRef.current = new Map([['terminal-1', () => {}]]) subscribingRef.current = new Set() leaseOnlyRef.current = new Set() - subscribeOpensLeaseOnly = false webReadyRef.current = new Set(['terminal-1']) - harnessRenderCount = 0 subscribe.mockClear() unsubscribe.mockClear() }) @@ -56,7 +47,6 @@ describe('useMobileNativeChatTerminalStream', () => { leaseReady?: boolean streamRevision?: number }): null { - harnessRenderCount += 1 const stream = useMobileNativeChatTerminalStream({ showNativeChat, activeHandle, @@ -70,7 +60,6 @@ describe('useMobileNativeChatTerminalStream', () => { subscribe, unsubscribe }) - notifyWebReadyRef.current = stream.notifyWebReady notifyListedHandlesRef.current = stream.notifyListedHandles hasTabsRecoveryNeedRef.current = stream.hasTabsRecoveryNeed return null @@ -95,244 +84,6 @@ describe('useMobileNativeChatTerminalStream', () => { }) } - // A synchronous tab switch still sees old chat coverage and opens the incoming terminal as lease-only. - function handOffToTerminalTwo(): void { - subscribeOpensLeaseOnly = true - subscribe('terminal-2') - subscribeOpensLeaseOnly = false - subscribe.mockClear() - unsubscribe.mockClear() - } - - it('trades a lease-only stream for output when a chat tab hands off to a terminal tab', async () => { - webReadyRef.current.add('terminal-2') - await act(async () => { - renderer = create(createElement(Harness, { showNativeChat: true })) - }) - handOffToTerminalTwo() - - await act(async () => { - renderer?.update( - createElement(Harness, { showNativeChat: false, activeHandle: 'terminal-2' }) - ) - }) - - expect(unsubscribe).toHaveBeenCalledWith('terminal-2') - expect(subscribe).toHaveBeenCalledWith('terminal-2') - expect(leaseOnlyRef.current.has('terminal-2')).toBe(false) - }) - - it('repairs a lease-only stream once its WebView reports ready', async () => { - await act(async () => { - renderer = create(createElement(Harness, { showNativeChat: true })) - }) - handOffToTerminalTwo() - await act(async () => { - renderer?.update( - createElement(Harness, { showNativeChat: false, activeHandle: 'terminal-2' }) - ) - }) - - // A cold WebView must wait; its normal ready path skips already-live lease subscriptions. - expect(subscribe).not.toHaveBeenCalled() - - await act(async () => { - webReadyRef.current.add('terminal-2') - notifyWebReadyRef.current('terminal-2', false) - }) - - expect(unsubscribe).toHaveBeenCalledWith('terminal-2') - expect(subscribe).toHaveBeenCalledWith('terminal-2') - }) - - it.each([true, false])( - 'stops rearming a handle whose stream never comes back (covered: %s, #10681)', - async (showNativeChat) => { - await act(async () => { - renderer = create(createElement(Harness, { showNativeChat })) - }) - subscribe.mockClear() - // Dead PTYs answer subscribed/end repeatedly; rearm must stop rather than loop through host waits. - for (let revision = 1; revision <= 6; revision += 1) { - subscriptionsRef.current.delete('terminal-1') - await act(async () => { - renderer?.update( - createElement(Harness, { - showNativeChat, - leaseReady: false, - streamRevision: revision - }) - ) - }) - } - - expect(subscribe.mock.calls.length).toBeLessThanOrEqual(3) - } - ) - - it('does not charge the rearm budget for a subscribe its own gates turned away', async () => { - try { - await act(async () => { - renderer = create(createElement(Harness, { showNativeChat: true })) - }) - subscribe.mockClear() - // Locally rejected subscribes never reached the host and must not spend real attempts. - subscribe.mockImplementation(() => false) - for (let revision = 1; revision <= 5; revision += 1) { - subscriptionsRef.current.delete('terminal-1') - await act(async () => { - renderer?.update( - createElement(Harness, { - showNativeChat: true, - leaseReady: false, - streamRevision: revision - }) - ) - }) - } - - expect(subscribe).toHaveBeenCalledTimes(5) - } finally { - subscribe.mockImplementation(registerSubscription) - } - }) - - it('charges the rearm budget for a subscribe the bridge refused before returning', async () => { - try { - await act(async () => { - renderer = create(createElement(Harness, { showNativeChat: false })) - }) - subscribe.mockClear() - // A synchronous refusal ends the stream inside subscribe, so no ref ever shows it was sent. - subscribe.mockImplementation(() => true) - for (let revision = 1; revision <= 5; revision += 1) { - subscriptionsRef.current.delete('terminal-1') - await act(async () => { - renderer?.update( - createElement(Harness, { - showNativeChat: false, - leaseReady: false, - streamRevision: revision - }) - ) - }) - } - - expect(subscribe).toHaveBeenCalledTimes(3) - } finally { - subscribe.mockImplementation(registerSubscription) - } - }) - - it.each([true, false])( - 'refills the rearm budget when terminal.list reports the handle again (covered: %s, #10681)', - async (showNativeChat) => { - await act(async () => { - renderer = create(createElement(Harness, { showNativeChat })) - }) - for (let revision = 1; revision <= 5; revision += 1) { - subscriptionsRef.current.delete('terminal-1') - await act(async () => { - renderer?.update( - createElement(Harness, { - showNativeChat, - leaseReady: false, - streamRevision: revision - }) - ) - }) - } - subscribe.mockClear() - await act(async () => { - renderer?.update( - createElement(Harness, { showNativeChat, leaseReady: false, streamRevision: 6 }) - ) - }) - expect(subscribe).not.toHaveBeenCalled() - - // Still-listed dead handles must not refill on every inventory refresh. - await act(async () => { - notifyListedHandlesRef.current(new Set(['terminal-1'])) - notifyListedHandlesRef.current(new Set(['terminal-1'])) - }) - expect(subscribe).not.toHaveBeenCalled() - - await act(async () => { - notifyListedHandlesRef.current(new Set()) - notifyListedHandlesRef.current(new Set(['terminal-1'])) - }) - - expect(subscribe).toHaveBeenCalledWith('terminal-1') - } - ) - - it('does not let a dead PTY buy a new budget with its own `subscribed` ack', async () => { - await act(async () => { - renderer = create(createElement(Harness, { showNativeChat: true })) - }) - subscribe.mockClear() - // Subscribed is only half a dead-PTY reply; clearing attempts there would refill the loop forever. - for (let revision = 1; revision <= 6; revision += 1) { - await playDeadPtyRoundTrip(revision) - } - - expect(subscribe.mock.calls.length).toBeLessThanOrEqual(3) - }) - - it('refills the budget for a rearmed stream that outlives the teardown window', async () => { - vi.useFakeTimers() - try { - await act(async () => { - renderer = create(createElement(Harness, { showNativeChat: true })) - }) - subscribe.mockClear() - for (let revision = 1; revision <= 3; revision += 1) { - await playDeadPtyRoundTrip(revision) - } - expect(subscribe).toHaveBeenCalledTimes(3) - - subscribe.mockClear() - subscriptionsRef.current.set('terminal-1', () => {}) - await act(async () => { - renderer?.update( - createElement(Harness, { showNativeChat: true, leaseReady: true, streamRevision: 4 }) - ) - }) - await act(async () => { - vi.advanceTimersByTime(5_000) - }) - await playDeadPtyRoundTrip(5) - - expect(subscribe).toHaveBeenCalledWith('terminal-1') - } finally { - vi.useRealTimers() - } - }) - - it('keeps an absence marker observed before the budget ran out', async () => { - await act(async () => { - renderer = create(createElement(Harness, { showNativeChat: true })) - }) - for (let revision = 1; revision <= 2; revision += 1) { - await playDeadPtyRoundTrip(revision) - } - // Preserve absence markers until exhaustion actually consumes them; early consumption can permanently lock a still-listed handle. - await act(async () => { - notifyListedHandlesRef.current(new Set()) - notifyListedHandlesRef.current(new Set(['terminal-1'])) - }) - await playDeadPtyRoundTrip(3) - subscribe.mockClear() - await playDeadPtyRoundTrip(4) - expect(subscribe).not.toHaveBeenCalled() - - await act(async () => { - notifyListedHandlesRef.current(new Set(['terminal-1'])) - }) - - expect(subscribe).toHaveBeenCalledWith('terminal-1') - }) - it('keeps asking until a tab snapshot replaces the exhausted handle', async () => { await act(async () => { renderer = create(createElement(Harness, { showNativeChat: true })) @@ -364,25 +115,4 @@ describe('useMobileNativeChatTerminalStream', () => { }) expect(hasTabsRecoveryNeedRef.current()).toBe(false) }) - - it('resumes a cold-start lease-only stream when WebView readiness arrives late', async () => { - webReadyRef.current.clear() - await act(async () => { - renderer = create(createElement(Harness, { showNativeChat: true })) - }) - await act(async () => { - renderer?.update(createElement(Harness, { showNativeChat: false })) - }) - - expect(unsubscribe).toHaveBeenCalledOnce() - expect(subscribe).toHaveBeenCalledOnce() - - webReadyRef.current.add('terminal-1') - await act(async () => { - notifyWebReadyRef.current('terminal-1', false) - }) - - expect(unsubscribe).toHaveBeenNthCalledWith(2, 'terminal-1') - expect(subscribe).toHaveBeenNthCalledWith(2, 'terminal-1') - }) }) diff --git a/mobile/src/session/tabs/mobile-session-tab-read-operations.ts b/mobile/src/session/tabs/mobile-session-tab-read-operations.ts index fe0c2f30db2..c1a9bb6ffc8 100644 --- a/mobile/src/session/tabs/mobile-session-tab-read-operations.ts +++ b/mobile/src/session/tabs/mobile-session-tab-read-operations.ts @@ -2,13 +2,6 @@ import { bindDeferredRpcOperation, defineRpcOperation } from '../../transport/rp import { rpcResultVariant } from '../../transport/rpc/rpc-operation-result-reader' import '../../terminal/terminal-reply-schema' import { sessionForwardedReplySchema } from '../../transport/rpc/rpc-uninterpreted-reply-schemas' -import '../agent-launch/mobile-agent-detection-reply-schema' -import '../../files/session-documents/mobile-markdown-tab-reply-schema' -import '../../terminal/session/mobile-session-terminal-reply-schema' -import '../../worktree/session-worktree-record-reply-schema' -import '../native-chat/composer/mobile-native-chat-skill-reply-schema' -import '../../terminal/quick-commands/mobile-quick-command-reply-schema' -import '../../files/workspace-file-paths-reply-schema' // Leave replies raw until the controller’s generation, barrier and application-revision guards pass. export const sessionTabsListRead = bindDeferredRpcOperation( diff --git a/mobile/src/session/tabs/mobile-session-tab-write-operations.ts b/mobile/src/session/tabs/mobile-session-tab-write-operations.ts index a450d1f6a6e..856c3323fa8 100644 --- a/mobile/src/session/tabs/mobile-session-tab-write-operations.ts +++ b/mobile/src/session/tabs/mobile-session-tab-write-operations.ts @@ -1,7 +1,5 @@ import { bindDeferredRpcOperation, defineRpcOperation } from '../../transport/rpc/rpc-operation' import { rpcResultVariant } from '../../transport/rpc/rpc-operation-result-reader' -import '../../files/session-documents/mobile-markdown-tab-reply-schema' -import '../../worktree/session-worktree-record-reply-schema' import '../../terminal/terminal-reply-schema' import { sessionCreatedTerminalTabSchema } from '../../terminal/session/mobile-session-terminal-reply-schema' import { sessionTabCloseReplySchema } from './mobile-session-tab-write-reply-schema' diff --git a/mobile/src/session/tabs/mobile-session-tab-write-reply-schema.ts b/mobile/src/session/tabs/mobile-session-tab-write-reply-schema.ts index 245fe3f5f02..009b0d95835 100644 --- a/mobile/src/session/tabs/mobile-session-tab-write-reply-schema.ts +++ b/mobile/src/session/tabs/mobile-session-tab-write-reply-schema.ts @@ -1,5 +1,4 @@ import * as z from 'zod' -import '../../../../src/shared/zod-salvage' // Bare legacy success and delegated closes do not prove permanent retirement. export const sessionTabCloseReplySchema = z diff --git a/mobile/src/session/use-missing-worktree-bounce.test.ts b/mobile/src/session/use-missing-worktree-bounce.test.ts index a697bbfb905..49600fd89d8 100644 --- a/mobile/src/session/use-missing-worktree-bounce.test.ts +++ b/mobile/src/session/use-missing-worktree-bounce.test.ts @@ -1,12 +1,6 @@ -import { createElement } from 'react' -import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { WorktreeShowResolution } from '../worktree/worktree-show-resolution' +import { describe, expect, it } from 'vitest' import { isSyntheticWorkspaceRoute } from './synthetic-workspace-route' -import { - shouldBounceMissingWorktree, - useMissingWorktreeBounce -} from './use-missing-worktree-bounce' +import { shouldBounceMissingWorktree } from './use-missing-worktree-bounce' describe('shouldBounceMissingWorktree', () => { it('bounces only a host-proven missing worktree', () => { @@ -21,60 +15,3 @@ describe('shouldBounceMissingWorktree', () => { expect(shouldBounceMissingWorktree('global-floating-terminal', 'missing')).toBe(false) }) }) - -describe('useMissingWorktreeBounce', () => { - let renderer: ReactTestRenderer | null = null - const bounce = vi.fn() - - beforeEach(() => { - bounce.mockReset() - renderer = null - }) - - function Harness(props: { worktreeId: string; resolution: WorktreeShowResolution }): null { - useMissingWorktreeBounce({ - hostId: 'host-1', - worktreeId: props.worktreeId, - resolution: props.resolution, - bounce - }) - return null - } - - function render(worktreeId: string, resolution: WorktreeShowResolution): void { - act(() => { - const element = createElement(Harness, { worktreeId, resolution }) - if (renderer) { - renderer.update(element) - } else { - renderer = create(element) - } - }) - } - - it('bounces exactly once per worktree even across re-renders', () => { - render('repo::wt', 'unknown') - expect(bounce).not.toHaveBeenCalled() - - render('repo::wt', 'missing') - expect(bounce).toHaveBeenCalledExactlyOnceWith('host-1') - - // Why: navigation lands after the render, so the pre-unmount renders must not re-fire. - render('repo::wt', 'missing') - render('repo::wt', 'unknown') - render('repo::wt', 'missing') - expect(bounce).toHaveBeenCalledTimes(1) - act(() => renderer?.unmount()) - }) - - it('re-arms for a different worktree on the reused screen', () => { - render('repo::wt-1', 'missing') - expect(bounce).toHaveBeenCalledTimes(1) - - render('repo::wt-2', 'unknown') - expect(bounce).toHaveBeenCalledTimes(1) - render('repo::wt-2', 'missing') - expect(bounce).toHaveBeenCalledTimes(2) - act(() => renderer?.unmount()) - }) -}) diff --git a/mobile/src/session/use-mobile-default-session-view-preference.test.ts b/mobile/src/session/use-mobile-default-session-view-preference.test.ts index 084164b6a40..53891f46444 100644 --- a/mobile/src/session/use-mobile-default-session-view-preference.test.ts +++ b/mobile/src/session/use-mobile-default-session-view-preference.test.ts @@ -68,52 +68,6 @@ describe('useMobileDefaultSessionViewPreference', () => { expect(saveDefaultSessionView).toHaveBeenCalledWith('chat') }) - it('submits every change immediately so shared persistence preserves event order', async () => { - const firstSave = deferred() - vi.mocked(saveDefaultSessionView) - .mockImplementationOnce(() => firstSave.promise) - .mockResolvedValue(undefined) - await mount() - - act(() => preference?.setDefaultView('chat')) - await act(async () => { - await Promise.resolve() - }) - act(() => preference?.setDefaultView('terminal')) - act(() => preference?.setDefaultView('chat')) - await act(async () => { - await Promise.resolve() - }) - expect(saveDefaultSessionView).toHaveBeenCalledTimes(3) - expect(saveDefaultSessionView).toHaveBeenNthCalledWith(2, 'terminal') - expect(saveDefaultSessionView).toHaveBeenNthCalledWith(3, 'chat') - - await act(async () => { - firstSave.resolve() - await firstSave.promise - await Promise.resolve() - }) - expect(saveDefaultSessionView).toHaveBeenCalledTimes(3) - }) - - it('reloads the persisted value when the latest write fails', async () => { - vi.mocked(loadDefaultSessionView) - .mockResolvedValueOnce('terminal') - .mockResolvedValueOnce('terminal') - vi.mocked(saveDefaultSessionView).mockRejectedValue(new Error('storage unavailable')) - await mount() - - await act(async () => { - preference?.setDefaultView('chat') - await Promise.resolve() - await Promise.resolve() - await Promise.resolve() - }) - - expect(preference?.defaultView).toBe('terminal') - expect(loadDefaultSessionView).toHaveBeenCalledTimes(2) - }) - it('does not let an older failed write roll back a newer choice', async () => { const recoveryLoad = deferred() vi.mocked(loadDefaultSessionView) @@ -140,27 +94,4 @@ describe('useMobileDefaultSessionViewPreference', () => { expect(preference?.defaultView).toBe('terminal') expect(saveDefaultSessionView).toHaveBeenNthCalledWith(2, 'terminal') }) - - it('submits the latest write before the Settings route unmounts', async () => { - const firstSave = deferred() - vi.mocked(saveDefaultSessionView) - .mockImplementationOnce(() => firstSave.promise) - .mockResolvedValueOnce(undefined) - await mount() - - act(() => preference?.setDefaultView('chat')) - await act(async () => { - await Promise.resolve() - }) - act(() => preference?.setDefaultView('terminal')) - expect(saveDefaultSessionView).toHaveBeenNthCalledWith(2, 'terminal') - act(() => renderer?.unmount()) - renderer = null - - await act(async () => { - firstSave.resolve() - await firstSave.promise - await Promise.resolve() - }) - }) }) diff --git a/mobile/src/session/use-mobile-session-view-mode.test.ts b/mobile/src/session/use-mobile-session-view-mode.test.ts index ad3edfa01bb..659ad7d9818 100644 --- a/mobile/src/session/use-mobile-session-view-mode.test.ts +++ b/mobile/src/session/use-mobile-session-view-mode.test.ts @@ -146,19 +146,6 @@ describe('useMobileSessionViewMode', () => { expect(controller?.ready).toBe(true) }) - it('toggles from the effective view and persists the override', async () => { - await mount({ defaultView: 'chat' }) - - await act(async () => { - controller?.toggleTabChatView('t1') - await Promise.resolve() - }) - - expect(updateSessionViewOverride).toHaveBeenLastCalledWith('h', 'w', 't1', 'terminal') - expect(controller?.isTabChatView('t1')).toBe(false) - expect(readSessionViewOverridesPreference).toHaveBeenCalledTimes(1) - }) - it('toggles a terminal-default tab into chat', async () => { await mount({ defaultView: 'terminal' }) @@ -293,41 +280,6 @@ describe('useMobileSessionViewMode', () => { }) }) - it('submits rapid mutations in event order', async () => { - await mount({ defaultView: 'terminal' }) - act(() => controller?.toggleTabChatView('t1')) - act(() => controller?.toggleTabChatView('t2')) - - expect(updateSessionViewOverride).toHaveBeenNthCalledWith(1, 'h', 'w', 't1', 'chat') - expect(updateSessionViewOverride).toHaveBeenNthCalledWith(2, 'h', 'w', 't2', 'chat') - }) - - it('reconciles the latest optimistic override when persistence fails', async () => { - vi.mocked(updateSessionViewOverride).mockRejectedValue(new Error('storage unavailable')) - vi.mocked(readSessionViewOverridesPreference) - .mockResolvedValueOnce({ - overrides: new Map([['t1', 'terminal']]), - loaded: true - }) - .mockResolvedValueOnce({ - overrides: new Map([['t1', 'terminal']]), - loaded: true - }) - await mount({ - defaultView: 'terminal', - overrides: new Map([['t1', 'terminal']]) - }) - - await act(async () => { - controller?.toggleTabChatView('t1') - await Promise.resolve() - await Promise.resolve() - }) - - expect(controller?.isTabChatView('t1')).toBe(false) - expect(readSessionViewOverridesPreference).toHaveBeenCalledTimes(2) - }) - it('does not let an older failed override roll back a newer choice', async () => { const recoveryLoad = deferred>() vi.mocked(updateSessionViewOverride) @@ -354,47 +306,6 @@ describe('useMobileSessionViewMode', () => { expect(updateSessionViewOverride).toHaveBeenNthCalledWith(2, 'h', 'w', 't1', 'terminal') }) - it('fails closed when both an override write and its recovery read fail', async () => { - vi.mocked(loadDefaultSessionView).mockResolvedValue('chat') - vi.mocked(updateSessionViewOverride).mockRejectedValue(new Error('storage unavailable')) - vi.mocked(readSessionViewOverridesPreference) - .mockResolvedValueOnce({ - overrides: new Map([['t1', 'terminal']]), - loaded: true - }) - .mockResolvedValueOnce({ overrides: new Map(), loaded: false }) - await mount({ - defaultView: 'chat', - overrides: new Map([['t1', 'terminal']]) - }) - - await act(async () => { - controller?.toggleTabChatView('t1') - await Promise.resolve() - await Promise.resolve() - }) - - expect(controller?.isTabChatView('t1')).toBe(false) - expect(readSessionViewOverridesPreference).toHaveBeenCalledTimes(2) - }) - - it('does not reload a failed override after the route unmounts', async () => { - const failedWrite = deferred() - vi.mocked(updateSessionViewOverride).mockReturnValue(failedWrite.promise) - await mount({ defaultView: 'terminal' }) - - act(() => controller?.toggleTabChatView('t1')) - act(() => renderer?.unmount()) - renderer = null - await act(async () => { - failedWrite.reject(new Error('storage unavailable')) - await Promise.resolve() - await Promise.resolve() - }) - - expect(readSessionViewOverridesPreference).toHaveBeenCalledTimes(1) - }) - it('fails closed to terminal when overrides cannot be read under a chat default', async () => { vi.mocked(loadDefaultSessionView).mockResolvedValue('chat') vi.mocked(readSessionViewOverridesPreference).mockResolvedValue({ diff --git a/mobile/src/source-control/folder/MobileFolderSourceControlPanel.test.tsx b/mobile/src/source-control/folder/MobileFolderSourceControlPanel.test.tsx deleted file mode 100644 index 102d52bad8b..00000000000 --- a/mobile/src/source-control/folder/MobileFolderSourceControlPanel.test.tsx +++ /dev/null @@ -1,126 +0,0 @@ -import { createElement, type ReactNode } from 'react' -import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, describe, expect, it, vi } from 'vitest' -import type { FolderListRow } from './mobile-folder-attached-worktrees' - -const seen = vi.hoisted(() => { - const state: { covered: boolean; membersObserving: boolean[]; rowsSubscribed: boolean[] } = { - covered: false, - membersObserving: [], - rowsSubscribed: [] - } - return state -}) -vi.mock('react-native', () => ({ ScrollView: 'ScrollView', View: 'View' })) -vi.mock('lucide-react-native', () => ({ GitBranch: 'GitBranch' })) -vi.mock('expo-router', () => ({ useFocusEffect: () => {} })) -vi.mock('react-native-safe-area-context', () => ({ - SafeAreaView: 'SafeAreaView', - useSafeAreaInsets: () => ({ bottom: 0 }) -})) -vi.mock('../../components/MobileStateView', () => ({ - MobileLoadErrorState: 'MobileLoadErrorState', - MobileOfflineState: 'MobileOfflineState', - MobileStateView: 'MobileStateView' -})) -vi.mock('../../transport/connection/connection-retry-action', () => ({ - connectionRetryAction: () => () => {} -})) -vi.mock('../../transport/connection/host-client-hooks', () => ({ - useForceReconnect: () => () => {} -})) -vi.mock('../../components/bottom-drawer/BottomDrawer', () => ({ - OptionPager: ({ main }: { main: ReactNode }) => main, - useOptionPager: () => ({ page: null, open: () => {}, close: () => {} }) -})) -vi.mock('../../components/list/ListGroup', () => ({ ListGroup: 'ListGroup' })) -vi.mock('../../i18n/use-mobile-translation', () => ({ - useMobileTranslation: () => (_key: string, fallback: string) => fallback -})) -vi.mock('../../navigation/use-back-claim', () => ({ useBackClaim: () => {} })) -vi.mock('../../navigation/workspace-route-handoff', () => ({ - useWorkspaceRouteHandoff: () => ({ back: () => {} }) -})) -vi.mock('../../navigation/workspace-route', () => ({ - WorkspaceExecutionScope: 'WorkspaceExecutionScope' -})) -vi.mock('../../theme/mobile-theme', () => ({ colors: {}, spacing: { lg: 16 } })) -vi.mock('../../theme/themed-styles', () => ({ - themedStyleSheet: (styles: () => unknown) => styles() -})) -vi.mock('../../theme/use-mobile-color-scheme', () => ({ useMobileColorScheme: () => {} })) -vi.mock('../MobileSourceControlHeader', () => ({ - MobileSourceControlHeader: 'MobileSourceControlHeader' -})) -vi.mock('../MobileSourceControlPanel', () => ({ MobileSourceControlPanel: 'Panel' })) -vi.mock('../mobile-source-control-styles', () => ({ styles: {} })) -vi.mock('./MobileFolderEmptyState', () => ({ MobileFolderEmptyState: 'EmptyState' })) -vi.mock('../../components/host-protocol-gates-context', () => ({ - useOptionalHostProtocolGates: () => null -})) -vi.mock('./use-folder-create-flow', () => ({ - useFolderCreateFlow: () => ({ - onCreate: async () => {}, - covered: seen.covered, - composerElement: null, - toastElement: null - }) -})) -vi.mock('./MobileFolderWorktreeRow', () => ({ - MobileFolderWorktreeRow: (props: { subscribed: boolean }) => { - seen.rowsSubscribed.push(props.subscribed) - return null - } -})) -vi.mock('./use-mobile-folder-attached-worktrees', () => ({ - useMobileFolderAttachedWorktrees: (_hostId: string, _folderId: string, observing: boolean) => { - seen.membersObserving.push(observing) - return { - folder: { worktreeId: 'folder:f-1', repoId: 'folder-workspace:f-1', displayName: 'payments' }, - worktrees: [ROW], - desktopCapabilities: [], - serverHosts: [], - connState: 'connected', - loadError: null, - refetch: () => {} - } - } -})) - -import { MobileFolderSourceControlPanel } from './MobileFolderSourceControlPanel' - -const ROW: FolderListRow = { - worktreeId: 'repo-1::/w/payments', - repoId: 'repo-1', - repo: 'orca', - displayName: 'payments', - branch: 'payments' -} - -let renderer: ReactTestRenderer | null = null -afterEach(() => { - act(() => renderer?.unmount()) - renderer = null - seen.covered = false - seen.membersObserving = [] - seen.rowsSubscribed = [] -}) - -describe('MobileFolderSourceControlPanel', () => { - it('pauses row status under the create form while the folder members stay live', () => { - seen.covered = true - act(() => { - renderer = create( - createElement(MobileFolderSourceControlPanel, { - hostId: 'host-1', - folderWorktreeId: 'folder:f-1', - name: 'payments', - embedded: true - }) - ) - }) - - expect(seen.rowsSubscribed.at(-1)).toBe(false) - expect(seen.membersObserving.at(-1)).toBe(true) - }) -}) diff --git a/mobile/src/source-control/folder/folder-source-repos-query.test.ts b/mobile/src/source-control/folder/folder-source-repos-query.test.ts index 523143d4bc8..89c1dcda79d 100644 --- a/mobile/src/source-control/folder/folder-source-repos-query.test.ts +++ b/mobile/src/source-control/folder/folder-source-repos-query.test.ts @@ -1,16 +1,6 @@ -import { createElement } from 'react' -import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, describe, expect, it, vi } from 'vitest' -import { stubRpcClient } from '../../transport/rpc/rpc-client-test-stub' -import { useHostQuery } from '../../query/host-query' -import { scopeRpcClientToExecutionHost } from '../../worktree/execution-host-scoped-rpc-client' -import { - documentQueryClient, - settleQueryNotifications -} from '../../test-support/rpc-recording/hook-mount' +import { describe, expect, it, vi } from 'vitest' import { FakeSession } from '../../transport/connection/mobile-endpoint-supervisor-test-fakes' import { - folderSourceCatalogQuery, serverFolderSourceCatalogQuery, selectFolderSourceRepos } from './folder-source-repos-query' @@ -64,61 +54,3 @@ describe('folder source repositories', () => { expect(selectFolderSourceRepos(catalog, 'group-1').map((found) => found.id)).toEqual(['api']) }) }) - -describe('folder source catalog reads', () => { - let renderer: ReactTestRenderer | null = null - const queries = documentQueryClient() - afterEach(async () => { - act(() => renderer?.unmount()) - renderer = null - await queries.end() - }) - - it.each([true, false])( - "reads a server folder's catalog on the desktop's one event stream (subscribed: %s)", - async (subscribed) => { - let eventStreams = 0 - const desktop = stubRpcClient({ - getLastConnectedAt: () => 1, - sendRequest: async (method) => ({ - id: '1', - ok: true, - result: method === 'repo.list' ? { repos: [] } : { groups: [GROUP] }, - _meta: { runtimeId: 'r' } - }), - subscribe: (method) => { - if (method === 'runtime.clientEvents.subscribe') { - eventStreams += 1 - } - return () => {} - } - }) - const server = scopeRpcClientToExecutionHost(desktop, 'runtime:env-1') - function Harness(): null { - useHostQuery( - folderSourceCatalogQuery, - { hostId: 'host-1', client: desktop }, - { exec: 'local' }, - {}, - { - subscribed: true - } - ) - useHostQuery( - serverFolderSourceCatalogQuery, - { hostId: 'host-1', client: server }, - { exec: 'runtime:env-1' }, - {}, - { subscribed } - ) - return null - } - await act(async () => { - renderer = create(queries.wrap(createElement(Harness))) - }) - await settleQueryNotifications() - - expect(eventStreams).toBe(1) - } - ) -}) diff --git a/mobile/src/source-control/review/mobile-review-notes-operations.ts b/mobile/src/source-control/review/mobile-review-notes-operations.ts index ed7d8688140..3a70976f334 100644 --- a/mobile/src/source-control/review/mobile-review-notes-operations.ts +++ b/mobile/src/source-control/review/mobile-review-notes-operations.ts @@ -1,11 +1,7 @@ import { bindDeferredRpcOperation, defineRpcOperation } from '../../transport/rpc/rpc-operation' import { rpcResultVariant } from '../../transport/rpc/rpc-operation-result-reader' import { sessionWorktreeRecordSchema } from '../../worktree/session-worktree-record-reply-schema' -import '../../files/session-documents/mobile-markdown-tab-reply-schema' import '../../terminal/terminal-reply-schema' -import '../../terminal/session/mobile-session-terminal-reply-schema' -import '../../session/tabs/mobile-session-tab-write-reply-schema' -import '../../transport/rpc/rpc-uninterpreted-reply-schemas' import '../../terminal/quick-commands/mobile-quick-command-operations' // Preserve host refusal text for optimistic rollback; the reply's record carries the host's merged notes. diff --git a/mobile/src/terminal/quick-commands/QuickCommandRow.test.ts b/mobile/src/terminal/quick-commands/QuickCommandRow.test.ts deleted file mode 100644 index 3728dff5c4f..00000000000 --- a/mobile/src/terminal/quick-commands/QuickCommandRow.test.ts +++ /dev/null @@ -1,110 +0,0 @@ -import { createElement } from 'react' -import { act, create, type ReactTestRenderer } from 'react-test-renderer' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { TerminalQuickCommand } from '../../../../src/shared/terminal/quick-commands/terminal-quick-command-types' -import { QuickCommandRow } from './QuickCommandRow' - -const clipboard = vi.hoisted(() => ({ setStringAsync: vi.fn(() => Promise.resolve(true)) })) -const haptics = vi.hoisted(() => ({ notificationAsync: vi.fn(() => Promise.resolve()) })) - -vi.mock('react-native', () => ({ - Platform: { OS: 'ios' }, - Pressable: 'Pressable', - StyleSheet: { create: (styles: T) => styles, hairlineWidth: 1 }, - Text: 'Text', - View: 'View' -})) - -vi.mock('lucide-react-native', () => ({ - Check: 'Check', - Copy: 'Copy', - Pencil: 'Pencil', - Play: 'Play', - Trash2: 'Trash2' -})) - -vi.mock('expo-clipboard', () => clipboard) - -vi.mock('expo-haptics', () => ({ - ...haptics, - performAndroidHapticsAsync: vi.fn(() => Promise.resolve()), - AndroidHaptics: { Reject: 'reject' }, - NotificationFeedbackType: { Error: 'error', Success: 'success' } -})) - -vi.mock('../../components/MobileAgentIcon', () => ({ MobileAgentIcon: 'MobileAgentIcon' })) - -const COMMAND: TerminalQuickCommand = { - id: 'qc-1', - label: 'Run tests', - command: 'run the tests', - appendEnter: true -} - -// Require visible error feedback and haptics when clipboard writes reject; a failed write must never show Copied. -describe('the quick-command row when the pasteboard refuses the text', () => { - let renderer: ReactTestRenderer | null = null - - beforeEach(() => { - clipboard.setStringAsync.mockReset() - haptics.notificationAsync.mockReset() - haptics.notificationAsync.mockImplementation(() => Promise.resolve()) - }) - - afterEach(() => { - act(() => renderer?.unmount()) - renderer = null - }) - - // Find by every copy-state label so feedback transitions cannot make the control disappear from assertions. - const COPY_LABELS = new Set([ - `Copy ${COMMAND.label}`, - 'Copied', - "Couldn't copy", - 'Nothing to copy' - ]) - - function copyButton() { - const button = renderer!.root - .findAll((node) => node.props.accessibilityRole === 'button') - .find((node) => COPY_LABELS.has(String(node.props.accessibilityLabel))) - if (button === undefined) { - throw new Error('the row has no copy button') - } - return button - } - - function rowProps() { - return { - command: COMMAND, - first: true, - onLaunch: vi.fn(), - onEdit: vi.fn(), - onDelete: vi.fn(), - disabled: false - } - } - - it('emits nothing at all when the row is gone before the refusal arrives', async () => { - // Unmount before rejection; feedback without a surviving row would buzz with no explanation. - let refuse: ((error: Error) => void) | undefined - clipboard.setStringAsync.mockImplementation( - () => - new Promise((_resolve, reject) => { - refuse = reject - }) - ) - await act(async () => { - renderer = create(createElement(QuickCommandRow, rowProps())) - }) - await act(async () => { - copyButton().props.onPress() - }) - act(() => renderer?.unmount()) - renderer = null - await act(async () => { - refuse?.(new Error('pasteboard refused')) - }) - expect(haptics.notificationAsync).not.toHaveBeenCalled() - }) -}) diff --git a/mobile/src/terminal/quick-commands/mobile-quick-command-operations.ts b/mobile/src/terminal/quick-commands/mobile-quick-command-operations.ts index c019aa7e9c2..f3f9eee7fb8 100644 --- a/mobile/src/terminal/quick-commands/mobile-quick-command-operations.ts +++ b/mobile/src/terminal/quick-commands/mobile-quick-command-operations.ts @@ -2,13 +2,6 @@ import { bindDeferredRpcOperation, defineRpcOperation } from '../../transport/rp import { rpcResultVariant } from '../../transport/rpc/rpc-operation-result-reader' import '../terminal-reply-schema' import { terminalQuickCommandsSchema } from './mobile-quick-command-reply-schema' -import '../../session/agent-launch/mobile-agent-detection-reply-schema' -import '../../files/session-documents/mobile-markdown-tab-reply-schema' -import '../../transport/rpc/rpc-uninterpreted-reply-schemas' -import '../session/mobile-session-terminal-reply-schema' -import '../../worktree/session-worktree-record-reply-schema' -import '../../session/native-chat/composer/mobile-native-chat-skill-reply-schema' -import '../../files/workspace-file-paths-reply-schema' export const quickCommandsReader = rpcResultVariant( 'terminal-quick-commands', @@ -26,8 +19,6 @@ export const quickCommandsRead = bindDeferredRpcOperation( }) ) -import '../../session/tabs/mobile-session-tab-write-reply-schema' - export const quickCommandsWrite = bindDeferredRpcOperation( defineRpcOperation({ name: 'settings.quick-commands-write', diff --git a/mobile/src/terminal/quick-commands/mobile-quick-command-reply-schema.ts b/mobile/src/terminal/quick-commands/mobile-quick-command-reply-schema.ts index fb6a6ac66c1..2be3e0b35ca 100644 --- a/mobile/src/terminal/quick-commands/mobile-quick-command-reply-schema.ts +++ b/mobile/src/terminal/quick-commands/mobile-quick-command-reply-schema.ts @@ -1,5 +1,4 @@ import * as z from 'zod' -import '../../../../src/shared/zod-salvage' // Preserve null for unreadable canonical command lists so load/save cannot erase host commands with an invented empty list. export const terminalQuickCommandsSchema = z diff --git a/mobile/src/terminal/session/mobile-session-terminal-operations.ts b/mobile/src/terminal/session/mobile-session-terminal-operations.ts index 5de3473f24c..505d6058da8 100644 --- a/mobile/src/terminal/session/mobile-session-terminal-operations.ts +++ b/mobile/src/terminal/session/mobile-session-terminal-operations.ts @@ -2,13 +2,7 @@ import { bindDeferredRpcOperation, defineRpcOperation } from '../../transport/rp import { rpcResultVariant } from '../../transport/rpc/rpc-operation-result-reader' import { terminalComposerDraftSchema, terminalSendAcceptedSchema } from '../terminal-reply-schema' import { sessionTerminalInventorySchema } from './mobile-session-terminal-reply-schema' -import '../../session/agent-launch/mobile-agent-detection-reply-schema' -import '../../files/session-documents/mobile-markdown-tab-reply-schema' import { sessionWriteUnreadReplySchema } from '../../transport/rpc/rpc-uninterpreted-reply-schemas' -import '../../worktree/session-worktree-record-reply-schema' -import '../../session/native-chat/composer/mobile-native-chat-skill-reply-schema' -import '../quick-commands/mobile-quick-command-reply-schema' -import '../../files/workspace-file-paths-reply-schema' export const nativeChatTerminalDraftRead = bindDeferredRpcOperation( defineRpcOperation({ @@ -31,7 +25,6 @@ export const sessionTerminalListRead = bindDeferredRpcOperation( }) ) -import '../../session/tabs/mobile-session-tab-write-reply-schema' import '../quick-commands/mobile-quick-command-operations' // Keep chat writes distinct from query/accessory responders: losing a reply here means unknown delivery and forbids automatic retry. diff --git a/mobile/src/transport/rpc/rpc-uninterpreted-reply-schemas.ts b/mobile/src/transport/rpc/rpc-uninterpreted-reply-schemas.ts index e99fdbad5bb..87f8b84d347 100644 --- a/mobile/src/transport/rpc/rpc-uninterpreted-reply-schemas.ts +++ b/mobile/src/transport/rpc/rpc-uninterpreted-reply-schemas.ts @@ -1,5 +1,4 @@ import * as z from 'zod' -import '../../../../src/shared/zod-salvage' // Leave unread replies opaque; structured creates/probes require raw-envelope uncertainty checks at their callers. export const sessionLaunchUnreadReplySchema = z.unknown() diff --git a/mobile/src/transport/web-bundle/mobile-web-bundle-brotli-fetch.test.ts b/mobile/src/transport/web-bundle/mobile-web-bundle-brotli-fetch.test.ts index 2df9a40a4e7..6561607b409 100644 --- a/mobile/src/transport/web-bundle/mobile-web-bundle-brotli-fetch.test.ts +++ b/mobile/src/transport/web-bundle/mobile-web-bundle-brotli-fetch.test.ts @@ -56,7 +56,6 @@ function brotliHost() { totalBytes: assets.reduce((total, entry) => total + entry.byteLength, 0), assets } - const methods: string[] = [] const answer = (method: string, params: Record): unknown => { if (method === 'mobileWeb.bundle.manifest') { return { manifest, chunkBytes: RANGE_BYTES, rangeBytes: RANGE_BYTES } @@ -79,7 +78,6 @@ function brotliHost() { } const client: RpcClient = { sendRequest: vi.fn(async (method: string, params?: unknown): Promise => { - methods.push(method) const fields: Record = Object(params) return { id: 'rpc-1', ok: true, result: answer(method, fields), _meta: { runtimeId: 'r' } } }), @@ -92,7 +90,7 @@ function brotliHost() { notifyForeground: vi.fn(), close: vi.fn() } - return { client, methods } + return { client } } describe('fetchMobileWebBundle from a host that ships brotli copies', () => { @@ -107,10 +105,6 @@ describe('fetchMobileWebBundle from a host that ships brotli copies', () => { expect(new TextDecoder().decode(fetched.assets.get('assets/script.js'))).toBe(SCRIPT) expect(new TextDecoder().decode(fetched.assets.get('index.html'))).toBe(MARK) - expect(host.methods.filter((method) => method === 'mobileWeb.bundle.brotliRange')).toHaveLength( - 3 - ) - expect(host.methods.filter((method) => method === 'mobileWeb.bundle.range')).toHaveLength(1) // The 46-byte copy plus the 12-byte mark, not the 1,332 bytes they inflate to. expect(progress.at(-1)).toMatchObject({ receivedBytes: 58, totalBytes: 58 }) }) diff --git a/mobile/src/worktree/session-worktree-record-operations.ts b/mobile/src/worktree/session-worktree-record-operations.ts index 5931ca217e6..b2d75f24af1 100644 --- a/mobile/src/worktree/session-worktree-record-operations.ts +++ b/mobile/src/worktree/session-worktree-record-operations.ts @@ -2,13 +2,6 @@ import { bindDeferredRpcOperation, defineRpcOperation } from '../transport/rpc/r import { rpcResultVariant } from '../transport/rpc/rpc-operation-result-reader' import '../terminal/terminal-reply-schema' import { sessionWorktreeRecordSchema } from './session-worktree-record-reply-schema' -import '../session/agent-launch/mobile-agent-detection-reply-schema' -import '../files/session-documents/mobile-markdown-tab-reply-schema' -import '../transport/rpc/rpc-uninterpreted-reply-schemas' -import '../terminal/session/mobile-session-terminal-reply-schema' -import '../session/native-chat/composer/mobile-native-chat-skill-reply-schema' -import '../terminal/quick-commands/mobile-quick-command-reply-schema' -import '../files/workspace-file-paths-reply-schema' // Read the whole worktree for notes and live title; unlike mutation readers, absent records need no error or wrong-host fallback. export const sessionWorktreeRecordRead = bindDeferredRpcOperation( diff --git a/src/main/__mocks__/worktree-create-preparation.ts b/src/main/__mocks__/worktree-create-preparation.ts index 56ca76c48c4..56a77a58b19 100644 --- a/src/main/__mocks__/worktree-create-preparation.ts +++ b/src/main/__mocks__/worktree-create-preparation.ts @@ -34,14 +34,18 @@ const mocks: { export { mocks } -vi.mock('node:fs/promises', () => ({ mkdir: mocks.mkdir })) +vi.mock('node:fs/promises', async (importOriginal) => ({ + ...(await importOriginal>()), + mkdir: mocks.mkdir +})) vi.mock('../orcad/orcad-data-root-locality', () => ({ orcadDataRootIsOnLocalDisk: () => true })) vi.mock('../git/worktrees/catalog/worktree-scan-cache', async (importOriginal) => ({ ...(await importOriginal>()), listWorktreeGraph: mocks.listWorktreeGraph })) -vi.mock('../git/worktrees/creation/worktree-create-preparation', () => ({ +vi.mock('../git/worktrees/creation/worktree-create-preparation', async (importOriginal) => ({ + ...(await importOriginal>()), prepareWorktreeCreateCheckout: mocks.prepareCheckout, finalizePreparedWorktree: mocks.finalize, discardPreparedWorktree: mocks.discard, @@ -90,10 +94,14 @@ export const store = { getSettings: () => ({}) } as unknown as Store beforeEach(() => { mocks.mkdir.mockReset().mockResolvedValue(undefined) mocks.listWorktreeGraph.mockReset().mockResolvedValue([]) - mocks.prepareCheckout.mockReset().mockResolvedValue(undefined) + mocks.prepareCheckout + .mockReset() + .mockImplementation(async (repo, path, _base, reason, _options, _barrier, operation) => { + operation?.setDiscard((options) => mocks.discard(repo, path, options, reason, null)) + }) mocks.refreshTip.mockReset().mockResolvedValue(undefined) mocks.finalize.mockReset().mockResolvedValue({}) - mocks.discard.mockReset().mockResolvedValue(undefined) + mocks.discard.mockReset().mockResolvedValue('removed') mocks.unlock.mockReset().mockResolvedValue(undefined) mocks.getWorktreeOptions.mockReset().mockReturnValue({}) mocks.measureDivergence.mockReset().mockResolvedValue('within') diff --git a/src/main/claude/claude-child-work-roster-performance.test.ts b/src/main/claude/claude-child-work-roster-performance.test.ts deleted file mode 100644 index 36f68abfa97..00000000000 --- a/src/main/claude/claude-child-work-roster-performance.test.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { expect, it } from 'vitest' -import { ClaudeChildWorkDecoder } from './claude-child-work-decoder' -import { createAgentStatusStore } from '../../shared/agent-status/store/agent-status-store' -import { createAgentChildWorkAdmission } from '../../shared/agent-status/child-work/agent-status-child-work-admission' -import { reconcileAgentChildWorkEvidence } from '../../shared/agent-status/child-work/agent-status-child-work-reconciliation' -import { parent } from './claude-child-work-producer-harness.test-fixture' - -it('emits only new or changed roster facts at10 and100 live tasks', () => { - for (const count of [10, 100]) { - const decoder = new ClaudeChildWorkDecoder() - const store = createAgentStatusStore({ epoch: 'roster-perf', mode: 'authority' }) - store.applyMutation({ parent: { subject: parent } }) - let minted = 0 - const admission = createAgentChildWorkAdmission(store, { - mintChildWorkId: () => `child-${++minted}` - }) - let clock = 1_700_000_000_000 - let rosterEdges = 0 - let rosterWrites = 0 - const feed = (message: Record, rosterBound = 0) => { - decoder.observe({ type: 'system', ...message }) - const evidence = decoder.drain(++clock) - const before = store.getSnapshot().revision - reconcileAgentChildWorkEvidence({ store, admission, parent, provider: 'claude', evidence }) - const writes = store.getSnapshot().revision - before - if (message.subtype === 'background_tasks_changed') { - const live = evidence.filter((edge) => edge.type === 'live').length - expect(live).toBeLessThanOrEqual(rosterBound) - expect(writes).toBeLessThanOrEqual(rosterBound) - rosterEdges += live - rosterWrites += writes - } - } - const owner = { - task_id: 'owner', - task_type: 'local_agent', - tool_use_id: 'tool-owner', - is_backgrounded: true - } - feed({ subtype: 'task_started', ...owner }) - let shellOwner = 'owner' - const shell = (id: number) => ({ - task_id: `shell-${id}`, - task_type: 'local_bash', - description: `shell${id}`, - parent_task_id: shellOwner - }) - const live: number[] = [] - for (let id = 0; id < count; id++) { - live.push(id) - const roster = { subtype: 'background_tasks_changed', tasks: [owner, ...live.map(shell)] } - // Only one task is newly present; unchanged replacement rosters need no host writes. - feed(roster, 1) - feed({ - subtype: 'task_started', - ...shell(id), - tool_use_id: `tool-${id}`, - is_backgrounded: true - }) - feed(roster) - } - // The introductions above need at most one edge/write each, independent of full-roster size. - expect(rosterEdges).toBeLessThanOrEqual(count) - expect(rosterWrites).toBeLessThanOrEqual(count) - rosterEdges = 0 - rosterWrites = 0 - feed({ subtype: 'task_started', ...owner, task_id: 'owner-second', tool_use_id: 'tool-second' }) - shellOwner = 'owner-second' - // A real owner change invalidates exactly the affected children, then its duplicate invalidates none. - feed({ subtype: 'background_tasks_changed', tasks: live.map(shell) }, count) - feed({ subtype: 'background_tasks_changed', tasks: live.map(shell) }) - for (let id = 0; id < count; id++) { - feed({ - subtype: 'task_notification', - task_id: `shell-${id}`, - tool_use_id: `tool-${id}`, - status: 'completed' - }) - live.shift() - feed({ subtype: 'background_tasks_changed', tasks: [owner, ...live.map(shell)] }) - } - // N introductions require at most N live edges and N store writes, independent of roster size. - expect(rosterEdges).toBeLessThanOrEqual(count) - expect(rosterWrites).toBeLessThanOrEqual(count) - expect(store.getChildren(parent).filter((child) => child.kind === 'command')).toHaveLength( - count - ) - } -}) diff --git a/src/main/claude/structured/claude-conversation-title-owner.test.ts b/src/main/claude/structured/claude-conversation-title-owner.test.ts index 5a31653bbd5..5b7c3d8e9d1 100644 --- a/src/main/claude/structured/claude-conversation-title-owner.test.ts +++ b/src/main/claude/structured/claude-conversation-title-owner.test.ts @@ -71,27 +71,6 @@ it('reads only cached support and rejects a retired acquisition or changed accou } }) -it.each(['unknown', 'unsupported'] as const)( - 'keeps %s CLIs on the existing generator path', - async (support) => { - const cli = fakeClaude() - const adapter = await acquired(cli, { cliFlag: async () => support }) - try { - const record = agentSessionRecordFixture() - record.sessionId = 'session-1' - record.providerHandleChain[0]!.handle.nativeId = PROVIDER_SESSION_ID - const generate = vi.fn(async () => 'Do not use') - cli.connections[0]!.generateSessionTitle = generate - const owner = adapter.captureConversationTitleOwner(record)! - expect(await owner.generate('Repair login', () => true)).toBeNull() - expect(generate).not.toHaveBeenCalled() - } finally { - await adapter.closeAll() - cli.dispose() - } - } -) - it('retains retirement knowledge when the optional title method is missing', async () => { const cli = fakeClaude() const adapter = await acquired(cli) diff --git a/src/main/git/worktrees/creation/worktree-create-preparation-real-git.test.ts b/src/main/git/worktrees/creation/worktree-create-preparation-real-git.test.ts index 0d915631436..1489f753f31 100644 --- a/src/main/git/worktrees/creation/worktree-create-preparation-real-git.test.ts +++ b/src/main/git/worktrees/creation/worktree-create-preparation-real-git.test.ts @@ -560,7 +560,7 @@ describe('prepared worktree creation with real Git', () => { controller.abort() await expect( discardPreparedWorktree(repoPath, preparedPath, { signal: controller.signal }, lockReason) - ).resolves.toBeUndefined() + ).resolves.toBe('removed') expect(await listWorktrees(repoPath, { includeCreatePreparations: true })).toHaveLength(1) }) @@ -621,3 +621,65 @@ describe('prepared worktree creation with real Git', () => { ) }) }) + +it.each(['replacement', 'permission'])( + 'preserves the requested path when rollback loses %s authority', + async (kind) => { + const { repoPath, root } = await createRepo() + const prepared = join(root, 'prepared-rollback-authority') + const target = join(root, 'rollback-target') + const preserved = join(root, 'preserved-original') + const reason = createWorktreePreparationLockReason('rollback-authority') + await prepareWorktreeCreateCheckout(repoPath, prepared, 'main', reason) + const originalLock = git(prepared, ['rev-parse', '--git-path', 'locked']) + const failure = new Error('move rewrote pointers but rejected') + const run = gitRunner.gitExecFileAsync + let allowed = true + let replaced = false + vi.spyOn(gitRunner, 'gitExecFileAsync').mockImplementation(async (args, options) => { + if (args.includes('move')) { + await run(args, options) + if (kind === 'permission') { + allowed = false + } + throw failure + } + if ( + kind === 'replacement' && + args[0] === 'symbolic-ref' && + options.cwd === target && + !replaced + ) { + replaced = true + git(repoPath, ['worktree', 'move', '-f', '-f', target, preserved]) + git(repoPath, ['worktree', 'add', '--detach', target, 'HEAD']) + git(repoPath, ['worktree', 'lock', '--reason', reason, target]) + await writeFile(join(target, 'user.txt'), 'preserve replacement\n') + } + return run(args, options) + }) + try { + await expect( + finalizePreparedWorktree( + repoPath, + prepared, + target, + 'rollback-authority', + 'main', + false, + { canStart: () => allowed }, + reason + ) + ).rejects.toBe(failure) + expect(await readFile(join(target, 'version.txt'), 'utf8')).toBe('one\n') + if (kind === 'replacement') { + expect(replaced).toBe(true) + expect(await readFile(join(target, 'user.txt'), 'utf8')).toBe('preserve replacement\n') + expect(await readFile(join(preserved, 'version.txt'), 'utf8')).toBe('one\n') + } + expect(await readFile(originalLock, 'utf8')).toBe(`${reason}\n`) + } finally { + vi.restoreAllMocks() + } + } +) diff --git a/src/main/git/worktrees/creation/worktree-create-preparation.ts b/src/main/git/worktrees/creation/worktree-create-preparation.ts index 68c840bf54b..a4f51be50b6 100644 --- a/src/main/git/worktrees/creation/worktree-create-preparation.ts +++ b/src/main/git/worktrees/creation/worktree-create-preparation.ts @@ -1,3 +1,5 @@ +import { runStandalonePreparation } from './worktree-preparation-standalone' +import { performPreparedWorktreeFinalization } from './worktree-preparation-finalization-work' import { windowsLongPathGitArgs } from '../../../../shared/windows-long-path-git-args' import { checkoutWorkersGitArgs } from '../../command-runner/checkout-workers-git-args' import { resolveWorktreeAddBaseRef } from '../../../../shared/worktree/base-ref' @@ -11,28 +13,20 @@ import { resolveWorktreeAddTimeoutMs, WORKTREE_REMOVAL_REGISTRATION_TIMEOUT_MS } from '../worktree-operation-options' -import { - configurePushAutoSetupRemote, - persistWorktreeCreationBase, - resolveWorktreeAddBaseContext, - trackSameNameRemoteBase -} from './worktree-add' import { bumpWorktreeScanGeneration as notifyPreparedWorktreeMutation } from '../catalog/worktree-scan-cache' -import { gitCleanupOptions, removeFailedFinalization } from './worktree-preparation-discard' -import { hasWorktreeBaseCommitRef } from './worktree-base-ref-probe' import { - runStandalonePreparation, - type WorktreePreparationOperation -} from './worktree-preparation-operation' + gitCleanupOptions, + removeFailedFinalization, + reconcilePreparationLocation, + discardPreparedWorktree as discardOwnedPreparation +} from './worktree-preparation-discard' +import { hasWorktreeBaseCommitRef } from './worktree-base-ref-probe' +import { WorktreePreparationOperation } from './worktree-preparation-operation' import { gitExecFileAsync } from '../../command-runner/git-exec-file' import { runWithGitReadCacheInvalidation } from '../../source-control/git-read-cache-invalidation' -import { invalidateWslLinkedWorktreeGitRouting } from '../../command-runner/wsl-linked-worktree-git-routing' import { unlockWorktreePreparation, - unlockWorktreePreparationAtPath, - verifyWorktreePreparationLock, - verifyWorktreePreparationLockAtPath, - WorktreePreparationLockOwnershipError + verifyWorktreePreparationLockAtPath } from './worktree-preparation-lock' import { addLockedWorktreePreparation } from './worktree-preparation-add' @@ -139,6 +133,12 @@ export type FinalizedPreparedWorktree = AddWorktreeResult & { preparedHeadReset: boolean } +export class PreparedWorktreeFinalizationPendingError extends Error { + constructor(readonly originalError: unknown) { + super('The prepared checkout still has an unverified target writer.', { cause: originalError }) + } +} + export async function finalizePreparedWorktree( repoPath: string, preparedPath: string, @@ -147,149 +147,110 @@ export async function finalizePreparedWorktree( baseBranch: string, refreshLocalBaseRef = false, options: AddWorktreeOptions = {}, - expectedLockReason: string + expectedLockReason: string, + operation?: WorktreePreparationOperation ): Promise { - const finalizeGitOptions: AddWorktreeOptions = { - ...options, - timeout: options.timeout ?? resolveWorktreeAddTimeoutMs() + const owner = operation ?? new WorktreePreparationOperation(options) + let pendingTarget = false + const captured: { lockPath?: string; targetWriter: boolean } = { targetWriter: false } + if (!operation) { + owner.setDiscard((cleanupOptions) => + discardOwnedPreparation(repoPath, preparedPath, cleanupOptions, expectedLockReason) + ) } try { - return await runWithGitReadCacheInvalidation(async () => { - const lockPath = await verifyWorktreePreparationLock( + const result = await owner.supervise(options, (ownedOptions) => + performPreparedWorktreeFinalization( + repoPath, preparedPath, + worktreePath, + branch, + baseBranch, + refreshLocalBaseRef, + { ...options, ...ownedOptions }, expectedLockReason, - finalizeGitOptions + owner, + captured ) - const verifyOwnership = (): Promise => - verifyWorktreePreparationLockAtPath(lockPath, expectedLockReason, finalizeGitOptions.signal) - const [targetResult, preparedResult] = await Promise.allSettled([ - (async () => { - const baseContext = await resolveWorktreeAddBaseContext( - repoPath, - baseBranch, - refreshLocalBaseRef, - finalizeGitOptions, - branch - ) - const targetHead = - baseContext.effectiveBaseOid ?? - ( - await gitExecFileAsync( - ['rev-parse', '--verify', `${baseContext.effectiveBase}^{commit}`], - gitExecOptions(repoPath, finalizeGitOptions) - ) - ).stdout.trim() - return { baseContext, targetHead } - })(), - gitExecFileAsync( - ['rev-parse', '--verify', 'HEAD'], - gitExecOptions(preparedPath, finalizeGitOptions) - ) - ]) - // Settle both reads before failure cleanup can remove the prepared checkout. - if (targetResult.status === 'rejected') { - throw targetResult.reason - } - const { baseContext, targetHead } = targetResult.value - if (preparedResult.status === 'rejected') { - await baseContext.pendingLocalBaseRefRefresh - throw preparedResult.reason - } - const preparedHeadReset = preparedResult.value.stdout.trim() !== targetHead - if (preparedHeadReset) { - await verifyOwnership() - await gitExecFileAsync( - [ - ...(await checkoutWorkersGitArgs(preparedPath, finalizeGitOptions)), - ...windowsLongPathGitArgs(preparedPath), - 'reset', - '--hard', - targetHead - ], - gitExecOptions(preparedPath, finalizeGitOptions) - ) - } - - let moved = false - try { - try { - await verifyOwnership() - // Git >= 2.25 needs two force flags to move a locked preparation without losing its lock reason. - await gitExecFileAsync( - [ - ...windowsLongPathGitArgs(repoPath), - 'worktree', - 'move', - '-f', - '-f', - preparedPath, - worktreePath - ], - gitExecOptions(repoPath, finalizeGitOptions) - ) - moved = true - } finally { - // The move rewrites both `.git` markers, and a failure can have rewritten one. - invalidateWslLinkedWorktreeGitRouting(preparedPath) - invalidateWslLinkedWorktreeGitRouting(worktreePath) + ) + await owner.physicalSettlement() + owner.finishFinalization('disposed') + return result + } catch (error) { + const settled = await owner.waitForPhysicalSettlement() + if (captured.lockPath) { + owner.setDiscard(async (cleanupOptions) => { + if (!captured.lockPath) { + return 'revoked' } - await verifyOwnership() - await gitExecFileAsync( - [ - ...windowsLongPathGitArgs(worktreePath), - 'checkout', - '--no-track', - '-b', - branch, - targetHead - ], - gitExecOptions(worktreePath, finalizeGitOptions) - ) - await verifyOwnership() - await persistWorktreeCreationBase( + const location = await reconcilePreparationLocation( + captured.lockPath, + preparedPath, worktreePath, - branch, - baseContext.effectiveBase, - finalizeGitOptions - ) - await trackSameNameRemoteBase( - worktreePath, - branch, - baseBranch, - baseContext.effectiveBase, - finalizeGitOptions - ) - await configurePushAutoSetupRemote(worktreePath, finalizeGitOptions) - await unlockWorktreePreparationAtPath( - lockPath, expectedLockReason, - finalizeGitOptions.signal + cleanupOptions ) - } catch (error) { - if (!(error instanceof WorktreePreparationLockOwnershipError)) { - await removeFailedFinalization( + if (location === 'hidden') { + return discardOwnedPreparation( repoPath, - moved ? worktreePath : preparedPath, - branch, - moved, - finalizeGitOptions, - expectedLockReason + preparedPath, + cleanupOptions, + expectedLockReason, + captured.lockPath ) } - await baseContext.pendingLocalBaseRefRefresh - throw error + return location === 'target' || location === 'unknown' ? 'revoked' : location + }) + } + if (settled && captured.lockPath) { + const location = await reconcilePreparationLocation( + captured.lockPath, + preparedPath, + worktreePath, + expectedLockReason, + options + ) + if (location === 'target') { + let eligible = true + const rollback = owner.supervise( + { + ...options, + signal: undefined, + canStart: () => eligible && options.canStart?.() !== false + }, + (rollbackOptions) => + removeFailedFinalization( + repoPath, + worktreePath, + branch, + true, + rollbackOptions, + expectedLockReason, + captured.lockPath + ), + true + ) + void rollback.catch(() => {}) + pendingTarget = !(await owner.waitForPhysicalSettlement(() => { + eligible = false + })) + eligible = false + if (!pendingTarget && (await rollback.catch(() => false))) { + owner.finishFinalization('disposed') + } } - // Advisory refresh may settle after finalization; it does not determine checkout contents. - const localBaseRefRefresh = await baseContext.pendingLocalBaseRefRefresh - return { - preparedHeadReset, - ...(localBaseRefRefresh ? { localBaseRefRefresh } : {}), - ...(baseContext.localBaseRefUpdateSuggestion - ? { localBaseRefUpdateSuggestion: baseContext.localBaseRefUpdateSuggestion } - : {}) - } - }) + } else { + pendingTarget = captured.targetWriter + } + owner.finishFinalization(!settled || pendingTarget ? 'pending' : 'failed') + if (!operation) { + await owner.discard() + } + if (pendingTarget && operation) { + throw new PreparedWorktreeFinalizationPendingError(error) + } + throw error } finally { - notifyPreparedWorktreeMutation(repoPath) + owner.finishFinalization() } } diff --git a/src/main/git/worktrees/creation/worktree-preparation-add.ts b/src/main/git/worktrees/creation/worktree-preparation-add.ts index 41bd1315650..55c8f66e11b 100644 --- a/src/main/git/worktrees/creation/worktree-preparation-add.ts +++ b/src/main/git/worktrees/creation/worktree-preparation-add.ts @@ -1,3 +1,4 @@ +import { runStandalonePreparation } from './worktree-preparation-standalone' import { lstat } from 'node:fs/promises' import { isUnsupportedWorktreeAddLockReasonError } from '../../../../shared/git/worktrees/git-worktree-command-capabilities' import { resolveWorktreeHostPath } from '../../../../shared/git/metadata/git-metadata-path' @@ -11,11 +12,11 @@ import { WORKTREE_REMOVAL_REGISTRATION_TIMEOUT_MS, type GitWorktreeExecOptions } from '../worktree-operation-options' +import type { WorktreePreparationOperation } from './worktree-preparation-operation' import { - runStandalonePreparation, - type WorktreePreparationOperation -} from './worktree-preparation-operation' -import { discardPreparedWorktree } from './worktree-preparation-discard' + discardPreparedWorktree, + type PreparationRemovalOutcome +} from './worktree-preparation-discard' import { lockWorktreePreparation, verifyWorktreePreparationLock, @@ -39,6 +40,14 @@ async function isAbsent(worktreePath: string, options: GitWorktreeExecOptions): } } +/** The owner has fenced its raw work and no add was issued for this unique path. */ +export async function discardUnmaterializedPreparation( + path: string, + options: GitWorktreeExecOptions +): Promise { + return (await isAbsent(path, options)) ? 'removed' : 'revoked' +} + export async function addLockedWorktreePreparation( repoPath: string, worktreePath: string, @@ -61,32 +70,50 @@ export async function addLockedWorktreePreparation( ) ) } - const add = async (lockArgs: string[]): Promise => { - options.signal?.throwIfAborted() - try { - await gitExecFileAsync( - [ - ...windowsLongPathGitArgs(repoPath), - 'worktree', - 'add', - '--detach', - '--no-checkout', - ...lockArgs, - worktreePath, - baseRef - ], - gitExecOptions(repoPath, options) - ) - } finally { - invalidateWslLinkedWorktreeGitRouting(worktreePath) - } - } return withLocalGitCapabilityCacheForExecution( { cwd: repoPath, wslDistro: options.wslDistro, signal: options.signal }, async (capabilities) => { options.signal?.throwIfAborted() const initiallyAbsent = await isAbsent(worktreePath, options) options.signal?.throwIfAborted() + let issued = false + const add = async (lockArgs: string[]): Promise => { + options.signal?.throwIfAborted() + try { + await gitExecFileAsync( + [ + ...windowsLongPathGitArgs(repoPath), + 'worktree', + 'add', + '--detach', + '--no-checkout', + ...lockArgs, + worktreePath, + baseRef + ], + { + ...gitExecOptions(repoPath, options), + observeChildTermination: (terminated, writes) => { + if (writes) { + issued = true + operation.setDiscard((cleanupOptions) => + discardPreparedWorktree( + repoPath, + worktreePath, + cleanupOptions, + lockReason, + initiallyAbsent ? null : undefined + ) + ) + } + options.observeChildTermination?.(terminated, writes) + } + } + ) + } finally { + invalidateWslLinkedWorktreeGitRouting(worktreePath) + } + } return capabilities.runWithFallback( 'worktree-add-lock-reason', async () => { @@ -96,10 +123,13 @@ export async function addLockedWorktreePreparation( added = true const lockPath = await verifyWorktreePreparationLock(worktreePath, lockReason, options) operation.setDiscard((cleanupOptions) => - discardPreparedWorktree(repoPath, worktreePath, cleanupOptions, lockReason) + discardPreparedWorktree(repoPath, worktreePath, cleanupOptions, lockReason, lockPath) ) return lockPath } catch (error) { + if (!issued) { + throw error + } operation.setDiscard() // A canceled add can leave its marker; a pre-existing checkout is never ours to remove. if ( @@ -108,7 +138,13 @@ export async function addLockedWorktreePreparation( !(error instanceof WorktreePreparationLockOwnershipError) ) { operation.setDiscard((cleanupOptions) => - discardPreparedWorktree(repoPath, worktreePath, cleanupOptions, lockReason) + discardPreparedWorktree( + repoPath, + worktreePath, + cleanupOptions, + lockReason, + initiallyAbsent ? null : undefined + ) ) } throw error @@ -126,10 +162,13 @@ export async function addLockedWorktreePreparation( operation ) operation.setDiscard((cleanupOptions) => - discardPreparedWorktree(repoPath, worktreePath, cleanupOptions, lockReason) + discardPreparedWorktree(repoPath, worktreePath, cleanupOptions, lockReason, lockPath) ) return lockPath } catch (error) { + if (!issued) { + throw error + } operation.setDiscard() if ( added && diff --git a/src/main/git/worktrees/creation/worktree-preparation-discard-real-git.test.ts b/src/main/git/worktrees/creation/worktree-preparation-discard-real-git.test.ts index 73adf59e55b..dc6901098aa 100644 --- a/src/main/git/worktrees/creation/worktree-preparation-discard-real-git.test.ts +++ b/src/main/git/worktrees/creation/worktree-preparation-discard-real-git.test.ts @@ -56,7 +56,7 @@ it('removes only the owned registration after external deletion of its checkout' ['rev-parse', '--git-path', 'locked', '--git-common-dir'], ['worktree', 'remove', '--force', '--force', prepared] ]) - expect(spy.mock.calls[1]?.[1]).toEqual({ + expect(spy.mock.calls[1]?.[1]).toMatchObject({ cwd: repo, timeout: WORKTREE_REMOVAL_REGISTRATION_TIMEOUT_MS }) @@ -168,3 +168,42 @@ it.runIf(process.platform !== 'win32')('does not follow a symlink ownership mark expect(spy.mock.calls.some(([args]) => args.includes('remove'))).toBe(false) expect(await readFile(externalLock, 'utf8')).toBe(`${reason}\n`) }) + +it('preserves a replacement even when its ownership text was copied', async () => { + const { repo, prepared, lock, reason } = await fixture() + const replacement = join(dirname(repo), 'replacement') + await runner.gitExecFileAsync(['worktree', 'add', '--detach', replacement, 'HEAD'], { cwd: repo }) + await runner.gitExecFileAsync(['worktree', 'lock', '--reason', reason, replacement], { + cwd: repo + }) + const pointer = await readFile(join(replacement, '.git'), 'utf8') + await writeFile(join(prepared, '.git'), pointer) + await writeFile(join(prepared, 'user.txt'), 'preserve replacement\n') + await expect(performDiscardPreparedWorktree(repo, prepared, {}, reason, lock)).rejects.toThrow( + 'lock owner changed' + ) + expect(await readFile(join(prepared, 'user.txt'), 'utf8')).toBe('preserve replacement\n') + expect(await readFile(lock, 'utf8')).toBe(`${reason}\n`) +}) + +it('preserves a different missing-checkout registration with copied ownership text', async () => { + const { repo, prepared, lock, reason } = await fixture() + const preserved = join(dirname(repo), 'preserved-original') + await runner.gitExecFileAsync(['worktree', 'move', '-f', '-f', prepared, preserved], { + cwd: repo + }) + await runner.gitExecFileAsync( + ['worktree', 'add', '--detach', '--no-checkout', prepared, 'HEAD'], + { cwd: repo } + ) + await runner.gitExecFileAsync(['worktree', 'lock', '--reason', reason, prepared], { cwd: repo }) + const replacementLock = ( + await runner.gitExecFileAsync(['rev-parse', '--git-path', 'locked'], { cwd: prepared }) + ).stdout.trim() + await rm(prepared, { recursive: true }) + await expect(performDiscardPreparedWorktree(repo, prepared, {}, reason, lock)).rejects.toThrow( + 'lock owner changed' + ) + expect(await readFile(replacementLock, 'utf8')).toBe(`${reason}\n`) + expect(await readFile(lock, 'utf8')).toBe(`${reason}\n`) +}) diff --git a/src/main/git/worktrees/creation/worktree-preparation-discard.ts b/src/main/git/worktrees/creation/worktree-preparation-discard.ts index 4e60a2d22a5..0e750c75b17 100644 --- a/src/main/git/worktrees/creation/worktree-preparation-discard.ts +++ b/src/main/git/worktrees/creation/worktree-preparation-discard.ts @@ -1,9 +1,14 @@ import { bumpWorktreeScanGeneration } from '../catalog/worktree-scan-cache' import { runWithGitReadCacheInvalidation } from '../../source-control/git-read-cache-invalidation' -import { lstat } from 'node:fs/promises' -import { join } from 'node:path' +import { lstat, readFile, realpath } from 'node:fs/promises' +import { dirname, join } from 'node:path' import { waitForPromiseWithSignal } from '../../../../shared/abort-signal-reason' -import { resolveWorktreeHostPath } from '../../../../shared/git/metadata/git-metadata-path' +import { parseGitdirMarkerPayload } from '../../../../shared/git/metadata/gitdir-marker-payload' +import { canonicalWorktreePath } from '../catalog/worktree-path-comparison' +import { + resolveGitMetadataPath, + resolveWorktreeHostPath +} from '../../../../shared/git/metadata/git-metadata-path' import { findLinkedWorktreeGitDirectory } from '../../../../shared/git/worktrees/git-worktree-admin' import { windowsLongPathGitArgs } from '../../../../shared/windows-long-path-git-args' import { toHostFilesystemPath } from '../../../filesystem/host-tree-removal' @@ -16,6 +21,7 @@ import { type GitWorktreeExecOptions } from '../worktree-operation-options' import { + verifyOriginalPreparationDirectory, verifyWorktreePreparationLock, verifyWorktreePreparationLockAtPath, WorktreePreparationLockOwnershipError @@ -34,14 +40,23 @@ async function verifyDiscardPreparationOwner( repoPath: string, worktreePath: string, expectedLockReason: string, - options: GitExecOptionsForWorktree -): Promise { + options: GitExecOptionsForWorktree, + originalLockPath?: string | null +): Promise { try { - await verifyWorktreePreparationLock(worktreePath, expectedLockReason, options) - } catch (error) { - if (error instanceof WorktreePreparationLockOwnershipError) { - throw error + const gitDir = dirname( + await verifyWorktreePreparationLock(worktreePath, expectedLockReason, options) + ) + if (originalLockPath) { + await verifyOriginalPreparationDirectory(gitDir, originalLockPath) } + await verifyWorktreePreparationLockAtPath( + join(gitDir, 'locked'), + expectedLockReason, + options.signal + ) + return gitDir + } catch (error) { const hostPath = resolveWorktreeHostPath(worktreePath, options) const hostRepo = resolveWorktreeHostPath(repoPath, options) if (!hostPath || !hostRepo) { @@ -65,8 +80,17 @@ async function verifyDiscardPreparationOwner( } const gitDir = await findLinkedWorktreeGitDirectory(hostRepo, hostPath, { ...options, signal }) if (!gitDir) { + if ( + originalLockPath === null || + (originalLockPath && (await pathAbsent(dirname(originalLockPath)))) + ) { + return null + } throw new WorktreePreparationLockOwnershipError(error) } + if (originalLockPath) { + await verifyOriginalPreparationDirectory(gitDir, originalLockPath) + } const lockPath = toHostFilesystemPath(join(gitDir, 'locked')) const marker = await waitForPromiseWithSignal(lstat(lockPath), signal).catch( (failure: unknown) => { @@ -80,6 +104,87 @@ async function verifyDiscardPreparationOwner( verifyWorktreePreparationLockAtPath(lockPath, expectedLockReason, signal), signal ) + return gitDir + } +} + +export type PreparationRemovalOutcome = 'removed' | 'skipped' | 'ownership-lost' | 'revoked' + +async function pathAbsent(path: string, options: GitWorktreeExecOptions = {}): Promise { + const hostPath = resolveWorktreeHostPath(path, options) + if (!hostPath) { + throw new Error('Cannot resolve the prepared checkout path.') + } + return lstat(toHostFilesystemPath(hostPath)).then( + () => false, + (error: unknown) => { + if (getErrorCode(error) === 'ENOENT') { + return true + } + throw error + } + ) +} + +export type PreparationLocation = 'hidden' | 'target' | 'removed' | 'ownership-lost' | 'unknown' + +/** Both pointers and the original marker must agree before failed finalization can remove a path. */ +export async function reconcilePreparationLocation( + lockPath: string, + hiddenPath: string, + targetPath: string, + lockReason: string, + options: GitWorktreeExecOptions +): Promise { + const gitDir = dirname(lockPath) + const signal = AbortSignal.timeout(options.timeout ?? WORKTREE_REMOVAL_REGISTRATION_TIMEOUT_MS) + const read = (work: Promise): Promise => waitForPromiseWithSignal(work, signal) + try { + const [hiddenAbsent, targetAbsent, adminAbsent] = await read( + Promise.all([ + pathAbsent(hiddenPath, options), + pathAbsent(targetPath, options), + pathAbsent(gitDir) + ]) + ) + if (hiddenAbsent && targetAbsent && adminAbsent) { + return 'removed' + } + if (adminAbsent) { + return 'unknown' + } + await read(verifyWorktreePreparationLockAtPath(lockPath, lockReason, signal)) + const backlink = await read(readFile(join(gitDir, 'gitdir'), 'utf8')) + const gitFile = resolveGitMetadataPath(gitDir, backlink, options) + if (!gitFile) { + return 'unknown' + } + const path = dirname(gitFile) + const key = async (value: string): Promise => + canonicalWorktreePath(await read(realpath(toHostFilesystemPath(value))).catch(() => value)) + const hidden = resolveWorktreeHostPath(hiddenPath, options) + const target = resolveWorktreeHostPath(targetPath, options) + const location = + hidden && (await key(path)) === (await key(hidden)) + ? 'hidden' + : target && (await key(path)) === (await key(target)) + ? 'target' + : undefined + if (!location || (await key(gitFile)) !== (await key(join(path, '.git')))) { + return 'unknown' + } + const pointer = await read(readFile(toHostFilesystemPath(gitFile), 'utf8')) + const marker = parseGitdirMarkerPayload(pointer) + const pointedAdmin = marker && resolveGitMetadataPath(path, marker, options) + if (!pointedAdmin || (await key(pointedAdmin)) !== (await key(gitDir))) { + return 'unknown' + } + await read(verifyWorktreePreparationLockAtPath(lockPath, lockReason, signal)) + return location + } catch (error) { + return error instanceof WorktreePreparationLockOwnershipError && error.replaced + ? 'ownership-lost' + : 'unknown' } } @@ -87,23 +192,36 @@ export async function performDiscardPreparedWorktree( repoPath: string, worktreePath: string, options: GitWorktreeExecOptions, - expectedLockReason?: string -): Promise { + expectedLockReason?: string, + originalLockPath?: string | null +): Promise { + const writers: Promise[] = [] const cleanupGitOptions = { ...gitCleanupOptions(repoPath, options), - timeout: options.timeout ?? WORKTREE_REMOVAL_REGISTRATION_TIMEOUT_MS + timeout: options.timeout ?? WORKTREE_REMOVAL_REGISTRATION_TIMEOUT_MS, + observeChildTermination: (terminated: Promise, writes: boolean) => { + options.observeChildTermination?.(terminated, writes) + if (writes) { + writers.push(terminated) + } + } } try { + let gitDir: string | null = null if (expectedLockReason !== undefined) { - await verifyDiscardPreparationOwner( + gitDir = await verifyDiscardPreparationOwner( repoPath, worktreePath, expectedLockReason, - cleanupGitOptions + cleanupGitOptions, + originalLockPath ) + if (gitDir === null) { + return 'removed' + } } if (cleanupGitOptions.canStart?.() === false) { - return + return 'skipped' } // Double force requires a freshly verified ownership marker. await gitExecFileAsync( @@ -117,6 +235,11 @@ export async function performDiscardPreparedWorktree( ], cleanupGitOptions ) + await Promise.allSettled(writers) + if (!(await pathAbsent(worktreePath, options)) || (gitDir && !(await pathAbsent(gitDir)))) { + throw new Error('The prepared checkout or its registration remains after removal.') + } + return 'removed' } finally { invalidateWslLinkedWorktreeGitRouting(worktreePath) } @@ -128,8 +251,9 @@ export async function removeFailedFinalization( branch: string, moved: boolean, options: GitWorktreeExecOptions, - expectedLockReason?: string -): Promise { + expectedLockReason?: string, + originalLockPath?: string +): Promise { let branchAttached = false if (moved) { try { @@ -146,13 +270,14 @@ export async function removeFailedFinalization( repoPath, cleanupPath, options, - expectedLockReason + expectedLockReason, + originalLockPath ).then( - () => true, + (outcome) => outcome === 'removed', () => false ) if (!removed) { - return + return false } if (branchAttached) { await gitExecFileAsync( @@ -160,17 +285,25 @@ export async function removeFailedFinalization( gitCleanupOptions(repoPath, options) ).catch(() => {}) } + return true } export async function discardPreparedWorktree( repoPath: string, worktreePath: string, options: GitWorktreeExecOptions = {}, - expectedLockReason?: string -): Promise { + expectedLockReason?: string, + originalLockPath?: string | null +): Promise { try { - await runWithGitReadCacheInvalidation(() => - performDiscardPreparedWorktree(repoPath, worktreePath, options, expectedLockReason) + return await runWithGitReadCacheInvalidation(() => + performDiscardPreparedWorktree( + repoPath, + worktreePath, + options, + expectedLockReason, + originalLockPath + ) ) } finally { bumpWorktreeScanGeneration(repoPath) diff --git a/src/main/git/worktrees/creation/worktree-preparation-disposal.ts b/src/main/git/worktrees/creation/worktree-preparation-disposal.ts new file mode 100644 index 00000000000..ed4693a28c9 --- /dev/null +++ b/src/main/git/worktrees/creation/worktree-preparation-disposal.ts @@ -0,0 +1,210 @@ +import { sharedPromiseSettlementWaiters } from '../../../../shared/promise-settlement-waiters' +import { WORKTREE_REMOVAL_REGISTRATION_TIMEOUT_MS } from '../worktree-operation-options' +import type { PreparationRemovalOutcome } from './worktree-preparation-discard' + +export type SettledPreparationDiscard = { + status: PreparationRemovalOutcome | 'failed' + attempted: boolean + error?: unknown +} +export type PreparationDiscardResult = + | SettledPreparationDiscard + | { + status: 'pending' + settled: Promise + } + +export abstract class WorktreePreparationDisposal { + private discardAttempt?: Promise + private disposalState: + | 'owned' + | 'finalizing' + | 'pending' + | 'active' + | 'parked' + | 'terminal' + | 'released' = 'owned' + private attempts = 0 + private wake?: object + private disposalOwner?: { + current: () => boolean + before: () => Promise + schedule: (work: () => Promise) => Promise + disposed: () => void + } + + abstract physicalSettlement(): Promise + + async waitForPhysicalSettlement(onAbandon?: () => void): Promise { + return sharedPromiseSettlementWaiters(this.physicalSettlement()) + .wait({ + timeoutMs: WORKTREE_REMOVAL_REGISTRATION_TIMEOUT_MS, + onAbandon + }) + .then( + () => true, + () => false + ) + } + + protected abstract retire(): Promise + protected abstract physicalDiscard( + eligible: () => boolean, + before: () => Promise, + leaseRetirement: AbortSignal + ): Promise + protected abstract complete(): void + + protected beginFinalization(rollback: boolean): void { + if ( + !this.current() || + (this.disposalState !== 'owned' && !(rollback && this.disposalState === 'finalizing')) + ) { + throw new Error('The prepared checkout is no longer available for finalization.') + } + this.disposalState = 'finalizing' + } + + finishFinalization(outcome: 'disposed' | 'pending' | 'failed' = 'failed'): void { + if (outcome === 'disposed') { + this.disposalOwner?.disposed() + this.release() + } else if (this.disposalState === 'finalizing') { + if (outcome === 'pending') { + this.acceptDiscard({ + status: 'pending', + settled: this.physicalSettlement().then(() => ({ status: 'skipped', attempted: false })) + }) + } else { + this.disposalState = 'pending' + } + } + } + setDisposalOwner(owner: NonNullable): void { + this.disposalOwner = owner + } + + get needsDiscardRetry(): boolean { + return this.disposalState === 'pending' + } + + release(): void { + this.disposalState = 'released' + this.wake = undefined + this.complete() + } + + protected current(): boolean { + return this.disposalState !== 'released' && this.disposalOwner?.current() !== false + } + + discard(): Promise { + if ( + !this.current() || + this.disposalState === 'finalizing' || + this.disposalState === 'parked' || + this.disposalState === 'terminal' + ) { + return Promise.resolve() + } + if (this.discardAttempt) { + return this.discardAttempt + } + this.disposalState = 'active' + const run = async (): Promise => this.acceptDiscard(await this.discardOnce()) + const attempt = this.disposalOwner ? this.disposalOwner.schedule(run) : run() + this.discardAttempt = attempt + void attempt.then(() => { + if (this.discardAttempt === attempt) { + this.discardAttempt = undefined + } + }) + return attempt + } + + private acceptDiscard(result: PreparationDiscardResult): void { + if (!this.current()) { + return + } + if (result.status !== 'pending') { + this.finishDiscard(result, false) + return + } + const token = {} + this.wake = token + this.disposalState = 'parked' + void result.settled.then((settled) => { + if (!this.current() || this.disposalState !== 'parked' || this.wake !== token) { + return + } + this.wake = undefined + this.finishDiscard(settled, true) + }) + } + + private finishDiscard(result: SettledPreparationDiscard, wake: boolean): void { + if (!this.current()) { + return + } + if (result.attempted) { + this.attempts += 1 + } + if (result.status === 'removed' || result.status === 'ownership-lost') { + this.disposalOwner?.disposed() + this.release() + return + } + if (result.status === 'revoked' || this.attempts >= 3) { + this.disposalState = 'terminal' + console.warn( + '[worktree-create] prepared checkout remains; automatic cleanup stopped', + result.error + ) + return + } + this.disposalState = 'pending' + if (wake) { + void (this.discardAttempt ?? Promise.resolve()).then(() => { + if (this.current() && this.needsDiscardRetry) { + void this.discard() + } + }) + } + } + + private async discardOnce(): Promise { + const retirement = this.retire() + const retired = await sharedPromiseSettlementWaiters(retirement) + .wait({ + timeoutMs: WORKTREE_REMOVAL_REGISTRATION_TIMEOUT_MS + }) + .then( + () => true, + () => false + ) + if (!retired) { + return { + status: 'pending', + settled: retirement.then(() => ({ status: 'skipped', attempted: false })) + } + } + let eligible = true + const leaseRetirement = new AbortController() + const settled = this.physicalDiscard( + () => eligible && this.current(), + () => this.disposalOwner?.before() ?? Promise.resolve(true), + leaseRetirement.signal + ) + const result = await sharedPromiseSettlementWaiters(settled) + .wait({ + timeoutMs: WORKTREE_REMOVAL_REGISTRATION_TIMEOUT_MS, + onAbandon: () => { + eligible = false + leaseRetirement.abort() + } + }) + .catch(() => ({ status: 'pending' as const, settled })) + eligible = false + return result + } +} diff --git a/src/main/git/worktrees/creation/worktree-preparation-finalization-work.ts b/src/main/git/worktrees/creation/worktree-preparation-finalization-work.ts new file mode 100644 index 00000000000..25d8169354d --- /dev/null +++ b/src/main/git/worktrees/creation/worktree-preparation-finalization-work.ts @@ -0,0 +1,179 @@ +import { windowsLongPathGitArgs } from '../../../../shared/windows-long-path-git-args' +import { checkoutWorkersGitArgs } from '../../command-runner/checkout-workers-git-args' +import type { AddWorktreeOptions } from '../worktree-operation-options' +import { gitExecOptions, resolveWorktreeAddTimeoutMs } from '../worktree-operation-options' +import { + configurePushAutoSetupRemote, + persistWorktreeCreationBase, + resolveWorktreeAddBaseContext, + trackSameNameRemoteBase +} from './worktree-add' +import { bumpWorktreeScanGeneration as notifyPreparedWorktreeMutation } from '../catalog/worktree-scan-cache' +import type { WorktreePreparationOperation } from './worktree-preparation-operation' +import { gitExecFileAsync } from '../../command-runner/git-exec-file' +import { runWithGitReadCacheInvalidation } from '../../source-control/git-read-cache-invalidation' +import { invalidateWslLinkedWorktreeGitRouting } from '../../command-runner/wsl-linked-worktree-git-routing' +import { + unlockWorktreePreparationAtPath, + verifyWorktreePreparationLock, + verifyWorktreePreparationLockAtPath +} from './worktree-preparation-lock' +import type { FinalizedPreparedWorktree } from './worktree-create-preparation' + +export async function performPreparedWorktreeFinalization( + repoPath: string, + preparedPath: string, + worktreePath: string, + branch: string, + baseBranch: string, + refreshLocalBaseRef = false, + options: AddWorktreeOptions = {}, + expectedLockReason: string, + operation: WorktreePreparationOperation, + captured: { lockPath?: string; targetWriter: boolean } +): Promise { + const finalizeGitOptions: AddWorktreeOptions = { + ...options, + timeout: options.timeout ?? resolveWorktreeAddTimeoutMs() + } + try { + return await runWithGitReadCacheInvalidation(async () => { + const lockPath = await verifyWorktreePreparationLock( + preparedPath, + expectedLockReason, + finalizeGitOptions + ) + captured.lockPath = lockPath + const verifyOwnership = (): Promise => + verifyWorktreePreparationLockAtPath(lockPath, expectedLockReason, finalizeGitOptions.signal) + const [targetResult, preparedResult] = await Promise.allSettled([ + (async () => { + const baseContext = await resolveWorktreeAddBaseContext( + repoPath, + baseBranch, + refreshLocalBaseRef, + finalizeGitOptions, + branch + ) + if (baseContext.pendingLocalBaseRefRefresh) { + operation.trackWriter(baseContext.pendingLocalBaseRefRefresh) + } + const targetHead = + baseContext.effectiveBaseOid ?? + ( + await gitExecFileAsync( + ['rev-parse', '--verify', `${baseContext.effectiveBase}^{commit}`], + gitExecOptions(repoPath, finalizeGitOptions) + ) + ).stdout.trim() + return { baseContext, targetHead } + })(), + gitExecFileAsync( + ['rev-parse', '--verify', 'HEAD'], + gitExecOptions(preparedPath, finalizeGitOptions) + ) + ]) + // Settle both reads before failure cleanup can remove the prepared checkout. + if (targetResult.status === 'rejected') { + throw targetResult.reason + } + const { baseContext, targetHead } = targetResult.value + if (preparedResult.status === 'rejected') { + await baseContext.pendingLocalBaseRefRefresh + throw preparedResult.reason + } + const preparedHeadReset = preparedResult.value.stdout.trim() !== targetHead + if (preparedHeadReset) { + await verifyOwnership() + await gitExecFileAsync( + [ + ...(await checkoutWorkersGitArgs(preparedPath, finalizeGitOptions)), + ...windowsLongPathGitArgs(preparedPath), + 'reset', + '--hard', + targetHead + ], + gitExecOptions(preparedPath, finalizeGitOptions) + ) + } + + try { + try { + await verifyOwnership() + // Git >= 2.25 needs two force flags to move a locked preparation without losing its lock reason. + await gitExecFileAsync( + [ + ...windowsLongPathGitArgs(repoPath), + 'worktree', + 'move', + '-f', + '-f', + preparedPath, + worktreePath + ], + { + ...gitExecOptions(repoPath, finalizeGitOptions), + observeChildTermination: (terminated, writes) => { + if (writes) { + captured.targetWriter = true + } + finalizeGitOptions.observeChildTermination?.(terminated, writes) + } + } + ) + } finally { + // The move rewrites both `.git` markers, and a failure can have rewritten one. + invalidateWslLinkedWorktreeGitRouting(preparedPath) + invalidateWslLinkedWorktreeGitRouting(worktreePath) + } + await verifyOwnership() + await gitExecFileAsync( + [ + ...windowsLongPathGitArgs(worktreePath), + 'checkout', + '--no-track', + '-b', + branch, + targetHead + ], + gitExecOptions(worktreePath, finalizeGitOptions) + ) + await verifyOwnership() + await persistWorktreeCreationBase( + worktreePath, + branch, + baseContext.effectiveBase, + finalizeGitOptions + ) + await trackSameNameRemoteBase( + worktreePath, + branch, + baseBranch, + baseContext.effectiveBase, + finalizeGitOptions + ) + await configurePushAutoSetupRemote(worktreePath, finalizeGitOptions) + await unlockWorktreePreparationAtPath( + lockPath, + expectedLockReason, + finalizeGitOptions.signal, + operation + ) + } catch (error) { + await baseContext.pendingLocalBaseRefRefresh + throw error + } + // Advisory refresh may settle after finalization; it does not determine checkout contents. + const localBaseRefRefresh = await baseContext.pendingLocalBaseRefRefresh + return { + preparedHeadReset, + ...(localBaseRefRefresh ? { localBaseRefRefresh } : {}), + ...(baseContext.localBaseRefUpdateSuggestion + ? { localBaseRefUpdateSuggestion: baseContext.localBaseRefUpdateSuggestion } + : {}) + } + }) + } finally { + notifyPreparedWorktreeMutation(repoPath) + } +} diff --git a/src/main/git/worktrees/creation/worktree-preparation-lock.ts b/src/main/git/worktrees/creation/worktree-preparation-lock.ts index 4a161f93cfc..1650e2b742f 100644 --- a/src/main/git/worktrees/creation/worktree-preparation-lock.ts +++ b/src/main/git/worktrees/creation/worktree-preparation-lock.ts @@ -1,6 +1,7 @@ +import { canonicalWorktreePath } from '../catalog/worktree-path-comparison' import type { WorktreePreparationOperation } from './worktree-preparation-operation' -import { readFile, unlink, writeFile } from 'node:fs/promises' -import { posix, win32 } from 'node:path' +import { readFile, realpath, unlink, writeFile } from 'node:fs/promises' +import { dirname, posix, win32 } from 'node:path' import { isWindowsAbsolutePathLike } from '../../../../shared/cross-platform-path' import { resolveGitMetadataPath, @@ -15,7 +16,10 @@ import { } from '../worktree-operation-options' export class WorktreePreparationLockOwnershipError extends Error { - constructor(cause?: unknown) { + constructor( + cause?: unknown, + readonly replaced = false + ) { super('The prepared worktree lock owner changed', { cause }) } } @@ -106,10 +110,12 @@ export async function unlockWorktreePreparation( export async function unlockWorktreePreparationAtPath( lockPath: string, expectedLockReason: string, - signal?: AbortSignal + signal?: AbortSignal, + operation?: WorktreePreparationOperation ): Promise { await verifyWorktreePreparationLockAtPath(lockPath, expectedLockReason, signal) - await unlink(lockPath).catch((error: unknown) => { + const writing = unlink(lockPath) + await (operation ? operation.trackWriter(writing) : writing).catch((error: unknown) => { throw new WorktreePreparationLockOwnershipError(error) }) } @@ -133,7 +139,20 @@ export async function verifyWorktreePreparationLockAtPath( throw new WorktreePreparationLockOwnershipError(error) }) if (lockReason !== `${expectedLockReason}\n`) { - throw new WorktreePreparationLockOwnershipError() + throw new WorktreePreparationLockOwnershipError(undefined, true) } signal?.throwIfAborted() } + +export async function verifyOriginalPreparationDirectory( + gitDir: string, + originalLockPath: string +): Promise { + const [actual, original] = await Promise.all([ + realpath(gitDir), + realpath(dirname(originalLockPath)) + ]) + if (canonicalWorktreePath(actual) !== canonicalWorktreePath(original)) { + throw new WorktreePreparationLockOwnershipError(undefined, true) + } +} diff --git a/src/main/git/worktrees/creation/worktree-preparation-operation.ts b/src/main/git/worktrees/creation/worktree-preparation-operation.ts index 7fa082b60e4..f8a5f7d62d0 100644 --- a/src/main/git/worktrees/creation/worktree-preparation-operation.ts +++ b/src/main/git/worktrees/creation/worktree-preparation-operation.ts @@ -1,27 +1,20 @@ +import { + WorktreePreparationDisposal, + type SettledPreparationDiscard +} from './worktree-preparation-disposal' +import type { PreparationRemovalOutcome } from './worktree-preparation-discard' import { WorktreePreparationLockOwnershipError } from './worktree-preparation-lock' import { waitForPromiseWithSignal } from '../../../../shared/abort-signal-reason' -import { sharedPromiseSettlementWaiters } from '../../../../shared/promise-settlement-waiters' -import { GIT_READ_TIMEOUT_MS } from '../../../../shared/git/commands/git-command-timeout' import { getLocalRepoRefMaintenance } from '../../refs/maintenance/local-repo-ref-maintenance' import { - resolveWorktreeAddTimeoutMs, - WORKTREE_REMOVAL_REGISTRATION_TIMEOUT_MS, + WORKTREE_CREATE_PREPARATION_TTL_MS, + preparationWorkBudget, type GitWorktreeExecOptions } from '../worktree-operation-options' -export const WORKTREE_CREATE_PREPARATION_TTL_MS = 5 * 60_000 +export { WORKTREE_CREATE_PREPARATION_TTL_MS } from '../worktree-operation-options' -export function preparationWorkBudget(options: GitWorktreeExecOptions, refresh: boolean): number { - const checkout = resolveWorktreeAddTimeoutMs() - const read = options.timeout ?? GIT_READ_TIMEOUT_MS - // Include old-Git registration and direct-WSL read fallbacks, each with its own child budget. - return ( - WORKTREE_CREATE_PREPARATION_TTL_MS + - (refresh ? 9 * (options.timeout ?? checkout) : 6 * read + 7 * checkout) - ) -} - -export class WorktreePreparationOperation { +export class WorktreePreparationOperation extends WorktreePreparationDisposal { readonly controller = new AbortController() readonly signal: AbortSignal private readonly transferred = Promise.withResolvers() @@ -31,15 +24,17 @@ export class WorktreePreparationOperation { private timer?: NodeJS.Timeout private workUntil?: number private claimed = false - private retirement?: Promise - private discardAttempt?: Promise + private retirement?: Promise + private revoked: PreparationRemovalOutcome = 'revoked' + private authorityRevoked = false private maintenance?: { release: () => void; signal: AbortSignal; finished: boolean } - private discardCheckout?: (options: GitWorktreeExecOptions) => Promise + private discardCheckout?: (options: GitWorktreeExecOptions) => Promise constructor( private readonly options: GitWorktreeExecOptions, private readonly expired: () => void = () => {} ) { + super() this.signal = options.signal ? AbortSignal.any([options.signal, this.controller.signal]) : this.controller.signal @@ -66,8 +61,12 @@ export class WorktreePreparationOperation { this.signal.removeEventListener('abort', this.onAbort) } - setDiscard(discard?: (options: GitWorktreeExecOptions) => Promise): void { - this.discardCheckout = discard + setDiscard( + discard?: (options: GitWorktreeExecOptions) => Promise + ): void { + if (!this.authorityRevoked || !discard) { + this.discardCheckout = discard + } } get isClaimed(): boolean { @@ -84,7 +83,7 @@ export class WorktreePreparationOperation { return { ...this.options, signal: this.signal, - canStart: () => !this.signal.aborted && this.options.canStart?.() !== false, + canStart: () => this.current() && !this.signal.aborted && this.options.canStart?.() !== false, observeChildTermination: (terminated, writes) => { this.options.observeChildTermination?.(terminated, writes) this.observeChildTermination(terminated, writes) @@ -106,15 +105,22 @@ export class WorktreePreparationOperation { this.releaseMaintenanceIfSafe() } - private releaseMaintenanceIfSafe(): void { - const held = this.maintenance - if (held && (held.finished || held.signal.aborted) && this.writers.size === 0) { + private releaseMaintenanceIfSafe(held = this.maintenance): void { + if ( + held && + this.maintenance === held && + (held.finished || held.signal.aborted) && + this.writers.size === 0 + ) { held.release() this.maintenance = undefined } } - async withMaintenancePaused(run: () => Promise, signal = this.signal): Promise { + async withMaintenancePaused( + run: () => Promise, + signal: AbortSignal | undefined = this.signal + ): Promise { const acquiring = getLocalRepoRefMaintenance().pause('worktree-prepare') const release = await waitForPromiseWithSignal(acquiring, signal).catch((error: unknown) => { void acquiring.then( @@ -123,20 +129,28 @@ export class WorktreePreparationOperation { ) throw error }) + return this.runWithMaintenanceLease(run, release, signal) + } + + private async runWithMaintenanceLease( + run: () => Promise, + release: () => void, + signal: AbortSignal + ): Promise { if (signal.aborted) { release() signal.throwIfAborted() } const held = { release, signal, finished: false } this.maintenance = held - const onAbort = (): void => this.releaseMaintenanceIfSafe() + const onAbort = (): void => this.releaseMaintenanceIfSafe(held) signal.addEventListener('abort', onAbort, { once: true }) try { return await run() } finally { held.finished = true signal.removeEventListener('abort', onAbort) - this.releaseMaintenanceIfSafe() + this.releaseMaintenanceIfSafe(held) } } @@ -160,7 +174,9 @@ export class WorktreePreparationOperation { this.signal.throwIfAborted() } catch (error) { if (error instanceof WorktreePreparationLockOwnershipError) { + this.authorityRevoked = true this.setDiscard(undefined) + this.revoked = error.replaced ? 'ownership-lost' : 'revoked' } this.controller.abort(error) throw error @@ -192,107 +208,114 @@ export class WorktreePreparationOperation { this.timer.unref() } - retire(): Promise { - if (this.retirement) { - return this.retirement + supervise( + options: GitWorktreeExecOptions, + work: (options: GitWorktreeExecOptions) => Promise, + rollback = false + ): Promise { + if (!rollback) { + this.signal.throwIfAborted() } - this.controller.abort() - const proof = this.raw + this.complete() + this.beginFinalization(rollback) + this.retirement = undefined + let eligible = true + const result = Promise.resolve() + .then(() => + work({ + ...options, + canStart: () => eligible && this.current() && options.canStart?.() !== false, + observeChildTermination: (terminated, writes) => { + options.observeChildTermination?.(terminated, writes) + this.observeChildTermination(terminated, writes) + } + }) + ) + .catch((error: unknown) => { + if (error instanceof WorktreePreparationLockOwnershipError) { + this.authorityRevoked = true + this.setDiscard(undefined) + this.revoked = error.replaced ? 'ownership-lost' : 'revoked' + } + throw error + }) + .finally(() => { + eligible = false + }) + this.raw = result.then( + () => {}, + () => {} + ) + return result + } + + physicalSettlement(): Promise { + return this.raw .catch(() => {}) .then(async () => { await Promise.allSettled(this.writers) }) - this.retirement = sharedPromiseSettlementWaiters(proof) - .wait({ - timeoutMs: WORKTREE_REMOVAL_REGISTRATION_TIMEOUT_MS - }) - .then( - () => true, - () => false - ) + } + + retire(): Promise { + if (!this.retirement) { + this.controller.abort() + this.retirement = this.physicalSettlement() + } return this.retirement } - discard(): Promise { - if (!this.discardAttempt) { - this.discardAttempt = this.discardOnce() - void this.discardAttempt.catch(() => { - this.discardAttempt = undefined - }) - } - return this.discardAttempt - } - - private async discardOnce(): Promise { - if (!(await this.retire())) { - return - } + protected async physicalDiscard( + eligible: () => boolean, + before: () => Promise, + leaseRetirement: AbortSignal + ): Promise { const discard = this.discardCheckout if (!discard) { - return + return { status: this.revoked, attempted: false } } - let eligible = true - const cleanupController = new AbortController() - const cleanup = this.withMaintenancePaused( - () => - discard({ - ...this.options, - signal: undefined, - canStart: () => eligible, - observeChildTermination: this.observeChildTermination - }), - cleanupController.signal - ) - // A rejection is not physical completion; retries also require all writer receipts. - const settled = cleanup - .then( - () => ({ error: undefined }), - (error: unknown) => ({ error }) + let attempted = false + // Lease retirement cannot replace the original acquisition's physical settlement. + const acquiring = getLocalRepoRefMaintenance().pause('worktree-prepare') + const cleanup = acquiring.then((release) => + this.runWithMaintenanceLease( + async () => { + if (!eligible() || !(await before()) || !eligible()) { + return 'skipped' as const + } + return discard({ + ...this.options, + admissionTier: 'background', + signal: undefined, + canStart: eligible, + observeChildTermination: (terminated, writes) => { + if (writes) { + attempted = true + } + this.observeChildTermination(terminated, writes) + } + }) + }, + release, + leaseRetirement ) - .then(async (result) => { - await Promise.allSettled(this.writers) - return result + ) + const result = await cleanup.then( + (status): SettledPreparationDiscard => ({ status, attempted }), + (error: unknown): SettledPreparationDiscard => ({ + status: + !eligible() && !attempted + ? 'skipped' + : error instanceof WorktreePreparationLockOwnershipError + ? error.replaced + ? 'ownership-lost' + : 'revoked' + : 'failed', + attempted: attempted || eligible(), + error }) - try { - const result = await sharedPromiseSettlementWaiters(settled).wait({ - timeoutMs: WORKTREE_REMOVAL_REGISTRATION_TIMEOUT_MS, - onAbandon: () => { - eligible = false - cleanupController.abort() - } - }) - if (result.error !== undefined) { - throw result.error - } - } catch (error) { - if (!eligible) { - this.retirement = Promise.resolve(false) - return - } - throw error - } finally { - eligible = false - } - } -} - -export async function runStandalonePreparation( - options: GitWorktreeExecOptions, - work: (operation: WorktreePreparationOperation) => Promise -): Promise { - const operation = new WorktreePreparationOperation(options) - // A direct caller still owns its fetch barrier; only pool handoff supersedes it. - operation.claim(false) - let result!: T - try { - await operation.run(async () => { - result = await work(operation) - }) - return result - } catch (error) { - await operation.discard().catch(() => {}) - throw error - } finally { - operation.complete() + ) + await Promise.allSettled(this.writers) + return { ...result, attempted: result.attempted || attempted } } } diff --git a/src/main/git/worktrees/creation/worktree-preparation-standalone.ts b/src/main/git/worktrees/creation/worktree-preparation-standalone.ts new file mode 100644 index 00000000000..419b2ed855b --- /dev/null +++ b/src/main/git/worktrees/creation/worktree-preparation-standalone.ts @@ -0,0 +1,23 @@ +import type { GitWorktreeExecOptions } from '../worktree-operation-options' +import { WorktreePreparationOperation } from './worktree-preparation-operation' + +export async function runStandalonePreparation( + options: GitWorktreeExecOptions, + work: (operation: WorktreePreparationOperation) => Promise +): Promise { + const operation = new WorktreePreparationOperation(options) + // A direct caller still owns its fetch barrier; only pool handoff supersedes it. + operation.claim(false) + let result!: T + try { + await operation.run(async () => { + result = await work(operation) + }) + return result + } catch (error) { + await operation.discard().catch(() => {}) + throw error + } finally { + operation.complete() + } +} diff --git a/src/main/git/worktrees/movement/worktree-mutation-route-invalidation.test.ts b/src/main/git/worktrees/movement/worktree-mutation-route-invalidation.test.ts index e8016852f73..07505949215 100644 --- a/src/main/git/worktrees/movement/worktree-mutation-route-invalidation.test.ts +++ b/src/main/git/worktrees/movement/worktree-mutation-route-invalidation.test.ts @@ -1,3 +1,6 @@ +import { randomUUID } from 'node:crypto' +import { tmpdir } from 'node:os' +import { join } from 'node:path' // Worktree add/move/remove/rollback rewrite the `.git` marker the WSL Git route was derived from. import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' @@ -57,8 +60,8 @@ vi.mock('../catalog/worktree-scan-cache', () => ({ vi.mock('../creation/worktree-preparation-lock', async (importOriginal) => ({ ...(await importOriginal()), - lockWorktreePreparation: vi.fn(async () => '/owned-lock'), - verifyWorktreePreparationLock: vi.fn(async () => '/owned-lock'), + lockWorktreePreparation: vi.fn(async () => ownedLockPath), + verifyWorktreePreparationLock: vi.fn(async () => ownedLockPath), verifyWorktreePreparationLockAtPath: vi.fn(), unlockWorktreePreparationAtPath: vi.fn() })) @@ -77,6 +80,8 @@ import { usesHostGitForWslLinkedWorktree } from '../../command-runner/wsl-linked-worktree-git-routing' +const ownedLockPath = join(tmpdir(), `orca-route-invalidation-${randomUUID()}`, 'locked') + const REPO = String.raw`C:\repo` const LINKED = String.raw`C:\ws\linked` const MOVED = String.raw`C:\ws\moved` diff --git a/src/main/git/worktrees/worktree-operation-options.ts b/src/main/git/worktrees/worktree-operation-options.ts index 2f7fcf13486..66a1b90e6e0 100644 --- a/src/main/git/worktrees/worktree-operation-options.ts +++ b/src/main/git/worktrees/worktree-operation-options.ts @@ -1,3 +1,4 @@ +import { GIT_READ_TIMEOUT_MS } from '../../../shared/git/commands/git-command-timeout' import type { LocalBaseRefRefreshResult, LocalBaseRefUpdateSuggestion @@ -63,6 +64,18 @@ export const WORKTREE_REMOVAL_REGISTRATION_TIMEOUT_MS = 30_000 // A wedged shared scan would otherwise stall every later listing. export const WORKTREE_LIST_TIMEOUT_MS = 30_000 +export const WORKTREE_CREATE_PREPARATION_TTL_MS = 5 * 60_000 + +export function preparationWorkBudget(options: GitWorktreeExecOptions, refresh: boolean): number { + const checkout = resolveWorktreeAddTimeoutMs() + const read = options.timeout ?? GIT_READ_TIMEOUT_MS + // Include old-Git registration and direct-WSL read fallbacks, each with its own child budget. + return ( + WORKTREE_CREATE_PREPARATION_TTL_MS + + (refresh ? 9 * (options.timeout ?? checkout) : 6 * read + 7 * checkout) + ) +} + /** Clamp ORCA_WORKTREE_ADD_TIMEOUT_MS; warn for nonblank rejected/clamped values, not fractional truncation. */ export function resolveWorktreeAddTimeoutMs(env: NodeJS.ProcessEnv = process.env): number { const raw = env.ORCA_WORKTREE_ADD_TIMEOUT_MS?.trim() diff --git a/src/main/native-chat/structured-chat-naming-title.test.ts b/src/main/native-chat/structured-chat-naming-title.test.ts index c83dbaab30a..fbc58ba7566 100644 --- a/src/main/native-chat/structured-chat-naming-title.test.ts +++ b/src/main/native-chat/structured-chat-naming-title.test.ts @@ -117,18 +117,3 @@ it.each(['owner', 'same-text rename'] as const)( ) } ) - -it('uses current naming settings if they change while the title write is queued', async () => { - let eligible = true - const generate = vi.fn( - async (_record, _prompt, _current, automatic) => - automatic ? { name: 'CLI title', shouldApply: () => eligible } : { name: 'Configured title' } - ) - const state = rig(generate) - state.beforeWrite(async () => { - eligible = false - }) - state.start() - await state.done() - expect(state.record().conversationName).toBe('Configured title') -}) diff --git a/src/main/persistence/terminal-topology/persistence-floating-workspace-trust-load.test.ts b/src/main/persistence/terminal-topology/persistence-floating-workspace-trust-load.test.ts index 1f1485f1a2e..530e7c5a9b6 100644 --- a/src/main/persistence/terminal-topology/persistence-floating-workspace-trust-load.test.ts +++ b/src/main/persistence/terminal-topology/persistence-floating-workspace-trust-load.test.ts @@ -7,7 +7,6 @@ import { symlinkDirectorySync } from '../persistence-test-harness' import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest' -import { getFloatingWorkspaceFileRoots } from '../../ipc/floating-workspace-directory' import { rmSync, mkdtempSync, mkdirSync, realpathSync } from 'node:fs' import { join } from 'node:path' import { tmpdir } from 'node:os' @@ -92,27 +91,6 @@ describe('floating workspace trust on load', () => { }) }) - it('still loads a profile whose floating cwd is not a string', async () => { - writeDataFile({ - schemaVersion: 1, - repos: [], - worktreeMeta: {}, - settings: { - floatingTerminalCwd: 42, - floatingTerminalCwdMigratedToAppWorkspace: true - }, - ui: {}, - githubCache: { pr: {}, issue: {} }, - workspaceSession: {} - }) - - const store = await createStore() - - expect(store.getSettings().floatingTerminalCwd).toBe('~') - // File authorization reads the cwd on every check, so it must keep working for this profile. - expect(getFloatingWorkspaceFileRoots(store).exactRoots).toEqual([]) - }) - it('never re-points a trusted folder through a link on load', async () => { const trustedTarget = join(testState.dir, 'trusted-target') const trustedLink = join(testState.dir, 'trusted-link') diff --git a/src/main/runtime/orchestration/crew/crew-recipient-dispatches.ts b/src/main/runtime/orchestration/crew/crew-recipient-dispatches.ts index a0183f3e79b..16c9f212fd3 100644 --- a/src/main/runtime/orchestration/crew/crew-recipient-dispatches.ts +++ b/src/main/runtime/orchestration/crew/crew-recipient-dispatches.ts @@ -3,7 +3,7 @@ import { dispatchAssigneeCoordinatorKey, selectRunBoundDispatchRecipient } from '../../rpc/methods/orchestration/messaging/recipient-routing' -import { federatedControlMailRefusal } from '../../rpc/methods/orchestration/messaging/send-control-mail' +import { federatedControlMailRefusal } from '../legacy-remote-home/legacy-remote-home' import type { createLineageRunningSessionResolver } from '../addressing/session-lineage/structured-session-lineage' import type { DispatchInput } from './crew-recipient-owner-queries' import type { CrewRecipientTerminal } from './crew-recipient-inputs' diff --git a/src/main/runtime/orchestration/db/attach-orchestration-db-methods.ts b/src/main/runtime/orchestration/db/attach-orchestration-db-methods.ts index a8d353e63a1..7d5bc369062 100644 --- a/src/main/runtime/orchestration/db/attach-orchestration-db-methods.ts +++ b/src/main/runtime/orchestration/db/attach-orchestration-db-methods.ts @@ -7,17 +7,9 @@ import { attachDispatchContextStore } from './dispatch-context/dispatch-context- import { attachDispatchLookup } from './dispatch-context/dispatch-lookup' import { attachDispatchDepth } from './dispatch-depth' import { attachWorkerReportSettlement } from './dispatch-context/worker-report-settlement' -import { attachFederatedDispatchStore } from './federation/federated-dispatch-store' -import { attachFederatedDispatchObservationFence } from './federation/federated-dispatch-observation-fence' import { attachFederationRelayAck } from './federation/federation-relay-ack' -import { attachFederationRelayEnqueue } from './federation/federation-relay-enqueue' -import { attachFederationRelayImport } from './federation/federation-relay-import' -import { attachFederationRelayItem } from './federation/federation-relay-item' -import { attachRemoteDispatchAttachmentAuthority } from './federation/remote-dispatch-attachment-authority' -import { attachRemoteDispatchAttachmentCreate } from './federation/remote-dispatch-attachment-create' -import { attachRemoteDispatchAttachmentRelease } from './federation/remote-dispatch-attachment-release' -import { attachRemoteDispatchAttachmentStop } from './federation/remote-dispatch-attachment-stop' -import { attachRemoteQuestionStore } from './federation/remote-question-store' +import { attachLegacyRemoteDbMethods } from '../legacy-remote/legacy-remote-db-methods' +import { attachLegacyRemoteHomeDbMethods } from '../legacy-remote-home/legacy-remote-home-db-methods' import { attachPeerMailStore } from './federation/peer-mail-store' import { attachLegacyAskOperation } from './legacy/legacy-ask-operation' import { attachLegacyCompatibilityCandidates } from './legacy/legacy-compatibility-candidates' @@ -54,7 +46,6 @@ import { attachSchemaMigrate } from './schema/migrate' import { attachSchemaColumnProbes } from './schema/schema-column-probes' import { attachTaskStore } from './tasks/task-store' import { attachTaskStatusTransition } from './tasks/task-status-transition' -import { attachFederatedWorkerStartReconcile } from './worker-dispatch/federated-worker-start-reconcile' import { attachWorkerDispatchAbandon } from './worker-dispatch/worker-dispatch-abandon' import { attachWorkerDispatchAuthority } from './worker-dispatch/worker-dispatch-authority' import { attachWorkerDispatchOutcome } from './worker-dispatch/worker-dispatch-outcome' @@ -109,22 +100,13 @@ export function attachOrchestrationDbMethods(ctor: { prototype: object }): void attachWorkerDispatchStage(ctor) attachWorkerDispatchAuthority(ctor) attachWorkerDispatchOutcome(ctor) - attachFederatedWorkerStartReconcile(ctor) attachWorkerTerminalRecovery(ctor) attachWorkerDispatchStop(ctor) attachWorkerDispatchAbandon(ctor) - attachFederatedDispatchStore(ctor) - attachFederatedDispatchObservationFence(ctor) - attachRemoteDispatchAttachmentCreate(ctor) - attachRemoteDispatchAttachmentAuthority(ctor) - attachRemoteDispatchAttachmentRelease(ctor) - attachRemoteDispatchAttachmentStop(ctor) - attachFederationRelayEnqueue(ctor) + attachLegacyRemoteHomeDbMethods(ctor) + attachLegacyRemoteDbMethods(ctor) attachFederationRelayAck(ctor) - attachFederationRelayImport(ctor) - attachRemoteQuestionStore(ctor) attachPeerMailStore(ctor) - attachFederationRelayItem(ctor) attachWorkerTerminalResourceStore(ctor) attachWorkerTerminalTransfer(ctor) attachWorkerTerminalRelease(ctor) diff --git a/src/main/runtime/orchestration/db/federated-worker-report-outcome.test.ts b/src/main/runtime/orchestration/db/federated-worker-report-outcome.test.ts index 314c4d269e5..229fa21a593 100644 --- a/src/main/runtime/orchestration/db/federated-worker-report-outcome.test.ts +++ b/src/main/runtime/orchestration/db/federated-worker-report-outcome.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { parseFederatedWorkerReportOutcome } from './federated-worker-report-outcome' +import { parseFederatedWorkerReportOutcome } from '../legacy-remote/federated-worker-report-outcome' describe('federated-worker-report-outcome', () => { it('reads succeeded or failed from a nested report payload', () => { diff --git a/src/main/runtime/orchestration/db/federation/federation-relay-ack.ts b/src/main/runtime/orchestration/db/federation/federation-relay-ack.ts index 9029bbc7c3a..53ee477953d 100644 --- a/src/main/runtime/orchestration/db/federation/federation-relay-ack.ts +++ b/src/main/runtime/orchestration/db/federation/federation-relay-ack.ts @@ -1,36 +1,7 @@ -import type { - WorkerReportOutcome, - FederationRelayDirection, - FederationRelayItemRow -} from '../orchestration-records' -import { OrchestrationError } from '../../orchestration-error' -import { ORCHESTRATION_FEDERATION_LIFECYCLE_SETTLEMENT_PROTOCOL_VERSION } from '../../../../../shared/orchestration/orchestration-runtime-capabilities' -import { parseFederatedWorkerReportOutcome } from '../federated-worker-report-outcome' +import type { FederationRelayDirection, FederationRelayItemRow } from '../orchestration-records' +import type { FederationRelayAcknowledgment } from '../../legacy-remote/legacy-remote-db-methods' import type { OrchestrationDb } from '../orchestration-db' -export function listFederationRelay( - this: OrchestrationDb, - params: { - dispatchId: string - direction: FederationRelayDirection - afterSequence: number - limit?: number - } -): FederationRelayItemRow[] { - return this.db - .prepare( - `SELECT * FROM federation_relay_items - WHERE dispatch_id = ? AND direction = ? AND sequence > ? - ORDER BY sequence LIMIT ?` - ) - .all( - params.dispatchId, - params.direction, - params.afterSequence, - Math.min(Math.max(params.limit ?? 50, 1), 50) - ) as FederationRelayItemRow[] -} - export function listPendingFederationRelay( this: OrchestrationDb, dispatchId: string, @@ -48,78 +19,11 @@ export function listPendingFederationRelay( export function acknowledgeFederationRelay( this: OrchestrationDb, - params: { - dispatchId: string - direction: FederationRelayDirection - throughSequence: number - settleRemoteReports?: { sequence: number; outcome?: WorkerReportOutcome }[] - // Only the home's acceptance proves settlement; arm after it, never at queue time. - armAutoRelease?: boolean - } + params: FederationRelayAcknowledgment ): void { this.db.exec('BEGIN IMMEDIATE') try { - const settledReports = params.settleRemoteReports ?? [] - for (const settledReport of settledReports) { - const report = this.getFederationRelayItem( - params.dispatchId, - params.direction, - settledReport.sequence - ) - if ( - params.direction !== 'to_home' || - settledReport.sequence > params.throughSequence || - report?.kind !== 'worker_done' || - (settledReport.outcome !== undefined && - parseFederatedWorkerReportOutcome(report.payload) !== settledReport.outcome) - ) { - throw new OrchestrationError( - 'request_mismatch', - `Federation acknowledgment for ${params.dispatchId} does not match its queued worker_done.` - ) - } - } - const attachment = this.getRemoteDispatchAttachment(params.dispatchId) - if ( - params.direction === 'to_home' && - attachment !== undefined && - attachment.protocol_version >= ORCHESTRATION_FEDERATION_LIFECYCLE_SETTLEMENT_PROTOCOL_VERSION - ) { - const acknowledgedReports = this.db - .prepare( - `SELECT sequence FROM federation_relay_items - WHERE dispatch_id = ? AND direction = 'to_home' AND kind = 'worker_done' - AND acked_at IS NULL AND sequence <= ?` - ) - .all(params.dispatchId, params.throughSequence) as { sequence: number }[] - const settledSequences = new Set(settledReports.map((report) => report.sequence)) - if (acknowledgedReports.some((report) => !settledSequences.has(report.sequence))) { - throw new OrchestrationError( - 'request_mismatch', - `Federation acknowledgment for ${params.dispatchId} omits a worker_done settlement.` - ) - } - } - const terminalOutcomes = new Set( - settledReports.flatMap((report) => (report.outcome ? [report.outcome] : [])) - ) - if (terminalOutcomes.size > 1) { - throw new OrchestrationError( - 'request_mismatch', - `Federation acknowledgment for ${params.dispatchId} contains conflicting settlements.` - ) - } - const terminalOutcome = settledReports.find((report) => report.outcome)?.outcome - if (terminalOutcome) { - this.settleRemoteAttachmentInRelayTransaction( - params.dispatchId, - terminalOutcome, - 'worker_report_settled' - ) - if (params.armAutoRelease) { - this.armWorkerTerminalAutoReleaseStatement(params.dispatchId) - } - } + this.settleRemoteReportsInRelayAcknowledgment(params) this.db .prepare( `UPDATE federation_relay_items SET acked_at = COALESCE(acked_at, datetime('now')) @@ -133,93 +37,14 @@ export function acknowledgeFederationRelay( } } -export function setFederatedHomeImportSequence( - this: OrchestrationDb, - dispatchId: string, - sequence: number -): void { - this.db - .prepare( - `UPDATE federated_dispatches - SET to_home_imported_sequence = ?, updated_at = datetime('now') - WHERE dispatch_id = ? AND to_home_imported_sequence < ?` - ) - .run(sequence, dispatchId, sequence) -} - -export function recordFederatedHomeAcknowledgment( - this: OrchestrationDb, - params: { - dispatchId: string - remoteRuntimeEpoch: string - sequence: number - } -): void { - const federated = this.getFederatedDispatch(params.dispatchId) - if ( - !federated || - !Number.isInteger(params.sequence) || - params.sequence < 0 || - params.sequence > federated.to_home_imported_sequence - ) { - throw new OrchestrationError( - 'request_mismatch', - `Federation acknowledgment for ${params.dispatchId} exceeds imported relay state.` - ) - } - this.db - .prepare( - `UPDATE federated_dispatches - SET remote_runtime_epoch = ?, - to_home_acknowledged_sequence = CASE - WHEN remote_runtime_epoch = ? - THEN MAX(to_home_acknowledged_sequence, ?) - ELSE ? - END, - updated_at = datetime('now') - WHERE dispatch_id = ?` - ) - .run( - params.remoteRuntimeEpoch, - params.remoteRuntimeEpoch, - params.sequence, - params.sequence, - params.dispatchId - ) -} - -/** A worker_done queued for the Run home that it has not acknowledged. */ -export function hasPendingFederatedWorkerReport( - this: OrchestrationDb, - dispatchId: string -): boolean { - return ( - this.db - .prepare( - `SELECT 1 FROM federation_relay_items - WHERE dispatch_id = ? AND direction = 'to_home' AND kind = 'worker_done' - AND acked_at IS NULL LIMIT 1` - ) - .get(dispatchId) !== undefined - ) -} - export type FederationRelayAckMethods = { - listFederationRelay: typeof listFederationRelay listPendingFederationRelay: typeof listPendingFederationRelay acknowledgeFederationRelay: typeof acknowledgeFederationRelay - setFederatedHomeImportSequence: typeof setFederatedHomeImportSequence - recordFederatedHomeAcknowledgment: typeof recordFederatedHomeAcknowledgment - hasPendingFederatedWorkerReport: typeof hasPendingFederatedWorkerReport } export function attachFederationRelayAck(ctor: { prototype: object }): void { Object.assign(ctor.prototype, { - listFederationRelay, listPendingFederationRelay, - acknowledgeFederationRelay, - setFederatedHomeImportSequence, - recordFederatedHomeAcknowledgment, - hasPendingFederatedWorkerReport + acknowledgeFederationRelay }) } diff --git a/src/main/runtime/orchestration/db/orchestration-db-methods.ts b/src/main/runtime/orchestration/db/orchestration-db-methods.ts index 824b031a2ee..0e06a05191d 100644 --- a/src/main/runtime/orchestration/db/orchestration-db-methods.ts +++ b/src/main/runtime/orchestration/db/orchestration-db-methods.ts @@ -6,17 +6,9 @@ import type { DispatchContextStoreMethods } from './dispatch-context/dispatch-co import type { DispatchLookupMethods } from './dispatch-context/dispatch-lookup' import type { DispatchDepthMethods } from './dispatch-depth' import type { WorkerReportSettlementMethods } from './dispatch-context/worker-report-settlement' -import type { FederatedDispatchStoreMethods } from './federation/federated-dispatch-store' -import type { FederatedDispatchObservationFenceMethods } from './federation/federated-dispatch-observation-fence' import type { FederationRelayAckMethods } from './federation/federation-relay-ack' -import type { FederationRelayEnqueueMethods } from './federation/federation-relay-enqueue' -import type { FederationRelayImportMethods } from './federation/federation-relay-import' -import type { FederationRelayItemMethods } from './federation/federation-relay-item' -import type { RemoteDispatchAttachmentAuthorityMethods } from './federation/remote-dispatch-attachment-authority' -import type { RemoteDispatchAttachmentCreateMethods } from './federation/remote-dispatch-attachment-create' -import type { RemoteDispatchAttachmentReleaseMethods } from './federation/remote-dispatch-attachment-release' -import type { RemoteDispatchAttachmentStopMethods } from './federation/remote-dispatch-attachment-stop' -import type { RemoteQuestionStoreMethods } from './federation/remote-question-store' +import type { LegacyRemoteDbMethods } from '../legacy-remote/legacy-remote-db-methods' +import type { LegacyRemoteHomeDbMethods } from '../legacy-remote-home/legacy-remote-home-db-methods' import type { PeerMailStoreMethods } from './federation/peer-mail-store' import type { LegacyAskOperationMethods } from './legacy/legacy-ask-operation' import type { LegacyCompatibilityCandidatesMethods } from './legacy/legacy-compatibility-candidates' @@ -52,7 +44,6 @@ import type { SchemaMigrateMethods } from './schema/migrate' import type { SchemaColumnProbesMethods } from './schema/schema-column-probes' import type { TaskStoreMethods } from './tasks/task-store' import type { TaskStatusTransitionMethods } from './tasks/task-status-transition' -import type { FederatedWorkerStartReconcileMethods } from './worker-dispatch/federated-worker-start-reconcile' import type { WorkerDispatchAbandonMethods } from './worker-dispatch/worker-dispatch-abandon' import type { WorkerDispatchAuthorityMethods } from './worker-dispatch/worker-dispatch-authority' import type { WorkerDispatchOutcomeMethods } from './worker-dispatch/worker-dispatch-outcome' @@ -106,22 +97,13 @@ export type OrchestrationDbMethods = AttemptObservationStoreMethods & WorkerDispatchStageMethods & WorkerDispatchAuthorityMethods & WorkerDispatchOutcomeMethods & - FederatedWorkerStartReconcileMethods & WorkerTerminalRecoveryMethods & WorkerDispatchStopMethods & WorkerDispatchAbandonMethods & - FederatedDispatchStoreMethods & - FederatedDispatchObservationFenceMethods & - RemoteDispatchAttachmentCreateMethods & - RemoteDispatchAttachmentAuthorityMethods & - RemoteDispatchAttachmentReleaseMethods & - RemoteDispatchAttachmentStopMethods & - FederationRelayEnqueueMethods & + LegacyRemoteHomeDbMethods & + LegacyRemoteDbMethods & FederationRelayAckMethods & - FederationRelayImportMethods & - RemoteQuestionStoreMethods & PeerMailStoreMethods & - FederationRelayItemMethods & StructuredMailSendStoreMethods & WorkerTerminalResourceStoreMethods & WorkerTerminalTransferMethods & diff --git a/src/main/runtime/orchestration/db/schema/federated-home-run-migration.test.ts b/src/main/runtime/orchestration/db/schema/federated-home-run-migration.test.ts index addc3ca0f9a..7446896e749 100644 --- a/src/main/runtime/orchestration/db/schema/federated-home-run-migration.test.ts +++ b/src/main/runtime/orchestration/db/schema/federated-home-run-migration.test.ts @@ -4,7 +4,7 @@ import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it } from 'vitest' import { OrchestrationDb } from '../orchestration-db' import { SCHEMA_VERSION, federatedStubHomeRunId } from '../contract-constants' -import { importFederatedControlMessage } from '../../federation/relay/federation-control-message' +import { importFederatedControlMessage } from '../../legacy-remote/federation-control-message' describe('federated home Run migration', () => { let db: OrchestrationDb diff --git a/src/main/runtime/orchestration/db/worker-terminal/worker-terminal-auto-release.ts b/src/main/runtime/orchestration/db/worker-terminal/worker-terminal-auto-release.ts index 40173d37937..fc6dcdb86c3 100644 --- a/src/main/runtime/orchestration/db/worker-terminal/worker-terminal-auto-release.ts +++ b/src/main/runtime/orchestration/db/worker-terminal/worker-terminal-auto-release.ts @@ -174,72 +174,6 @@ export function admitWorkerChatReleaseClose( return changes > 0 } -/** Only for a host that cannot release on its own; arms once, so a retain or release before settlement still wins. */ -export function armFederatedHomeAutoRelease( - this: OrchestrationDb, - dispatchId: string, - nowMs = Date.now() -): void { - const { changes } = this.db - .prepare( - `UPDATE federated_dispatches - SET home_auto_release_at = ?, home_auto_release_state = 'armed', updated_at = datetime('now') - WHERE dispatch_id = ? AND home_auto_release_state IS NULL` - ) - .run(toSqliteUtcTimestamp(nowMs + WORKER_TERMINAL_AUTO_RELEASE_GRACE_MS), dispatchId) - if (changes > 0) { - this.workerTerminalAutoReleaseListener?.() - } -} - -/** A retain, an explicit release or the host's answer to an attempt ends the home deadline for good. */ -export function endFederatedHomeAutoRelease(this: OrchestrationDb, dispatchId: string): void { - this.db - .prepare( - `UPDATE federated_dispatches - SET home_auto_release_at = NULL, home_auto_release_state = 'ended', updated_at = datetime('now') - WHERE dispatch_id = ? AND home_auto_release_state IS NOT 'ended'` - ) - .run(dispatchId) -} - -/** Claiming postpones the deadline instead of hiding it, so an attempt cut short by a crash or failure runs again. */ -export function claimDueFederatedHomeAutoReleases(this: OrchestrationDb, nowMs: number): string[] { - if (this.workerAutoReleaseEnabled?.() === false) { - return [] - } - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the SELECT names exactly this one column. - const due = this.db - .prepare( - `SELECT dispatch_id FROM federated_dispatches - WHERE home_auto_release_state = 'armed' AND home_auto_release_at <= ?` - ) - .all(toSqliteUtcTimestamp(nowMs)) as { dispatch_id: string }[] - const claim = this.db.prepare( - `UPDATE federated_dispatches - SET home_auto_release_at = ?, updated_at = datetime('now') - WHERE dispatch_id = ? AND home_auto_release_state = 'armed' AND home_auto_release_at <= ?` - ) - const retryAt = toSqliteUtcTimestamp(nowMs + WORKER_TERMINAL_AUTO_RELEASE_GRACE_MS) - return due.flatMap(({ dispatch_id }) => - claim.run(retryAt, dispatch_id, toSqliteUtcTimestamp(nowMs)).changes > 0 ? [dispatch_id] : [] - ) -} - -export function isFederatedHomeAutoReleaseArmed( - this: OrchestrationDb, - dispatchId: string -): boolean { - return ( - this.db - .prepare( - `SELECT 1 FROM federated_dispatches - WHERE dispatch_id = ? AND home_auto_release_state = 'armed'` - ) - .get(dispatchId) !== undefined - ) -} - export function nextWorkerTerminalAutoReleaseAtMs(this: OrchestrationDb): number | null { // Off: nothing is due, so no timer runs until the setting turns back on. if (this.workerAutoReleaseEnabled?.() === false) { @@ -276,10 +210,6 @@ export type WorkerTerminalAutoReleaseMethods = { claimDueWorkerTerminalAutoReleases: typeof claimDueWorkerTerminalAutoReleases admitWorkerChatReleaseClose: typeof admitWorkerChatReleaseClose nextWorkerTerminalAutoReleaseAtMs: typeof nextWorkerTerminalAutoReleaseAtMs - armFederatedHomeAutoRelease: typeof armFederatedHomeAutoRelease - endFederatedHomeAutoRelease: typeof endFederatedHomeAutoRelease - claimDueFederatedHomeAutoReleases: typeof claimDueFederatedHomeAutoReleases - isFederatedHomeAutoReleaseArmed: typeof isFederatedHomeAutoReleaseArmed } export function attachWorkerTerminalAutoRelease(ctor: { prototype: object }): void { @@ -291,10 +221,6 @@ export function attachWorkerTerminalAutoRelease(ctor: { prototype: object }): vo deferWorkerTerminalAutoRelease, claimDueWorkerTerminalAutoReleases, admitWorkerChatReleaseClose, - nextWorkerTerminalAutoReleaseAtMs, - armFederatedHomeAutoRelease, - endFederatedHomeAutoRelease, - claimDueFederatedHomeAutoReleases, - isFederatedHomeAutoReleaseArmed + nextWorkerTerminalAutoReleaseAtMs }) } diff --git a/src/main/runtime/orchestration/federation/relay/federation-relay-prefix.ts b/src/main/runtime/orchestration/federation/relay/federation-relay-prefix.ts index 8de849f6d82..f3023c17c13 100644 --- a/src/main/runtime/orchestration/federation/relay/federation-relay-prefix.ts +++ b/src/main/runtime/orchestration/federation/relay/federation-relay-prefix.ts @@ -1,7 +1,7 @@ import type { RuntimeRequestPreparation } from '../../../../../shared/runtime-rpc-envelope' import { REMOTE_RUNTIME_MAX_INBOUND_REQUEST_JSON_BYTES } from '../../../../../shared/remote-runtime/remote-runtime-memory-limits' import { OrchestrationError } from '../../orchestration-error' -import type { federationRelayWireItem } from './federation-relay-wire' +import type { federationRelayWireItem } from '../../legacy-remote/legacy-remote' /** Fit only this already-selected page, using the actual sending socket's complete serializer. */ export function federationRelayPrefix( diff --git a/src/main/runtime/orchestration/federation/runtime-orchestration-federation.ts b/src/main/runtime/orchestration/federation/runtime-orchestration-federation.ts index f22d5f315ea..8dfcbf50083 100644 --- a/src/main/runtime/orchestration/federation/runtime-orchestration-federation.ts +++ b/src/main/runtime/orchestration/federation/runtime-orchestration-federation.ts @@ -19,16 +19,16 @@ import type { import { OrchestrationError } from '../orchestration-error' import { clearFederationAckCheckpoints, - releaseFederationAckCheckpoint -} from './synchronization/federation-ack-checkpoints' -import { syncFederatedDispatch } from './synchronization/federation-sync' + releaseFederationAckCheckpoint, + syncFederatedDispatch, + FederationAcknowledgmentRecovery +} from '../legacy-remote-home/legacy-remote-home' import type { OrchestrationDb } from '../db/orchestration-db' import type { FederationRuntime } from './federation-runtime' import { FederationRelayScheduler, type FederationRelayTickOutcome } from './relay/federation-relay-scheduler' -import { FederationAcknowledgmentRecovery } from './relay/federation-acknowledgment-recovery' export class RuntimeOrchestrationFederation { private readonly relays = new FederationRelayScheduler((dispatchId) => this.relayTick(dispatchId)) diff --git a/src/main/runtime/orchestration/federation/synchronization/federation-ack-checkpoints.test.ts b/src/main/runtime/orchestration/federation/synchronization/federation-ack-checkpoints.test.ts index 1a0a797b607..950c34586cd 100644 --- a/src/main/runtime/orchestration/federation/synchronization/federation-ack-checkpoints.test.ts +++ b/src/main/runtime/orchestration/federation/synchronization/federation-ack-checkpoints.test.ts @@ -6,7 +6,7 @@ import { getFederationAckedThrough, recordFederationAckCheckpoint, type FederationAckIdentity -} from './federation-ack-checkpoints' +} from '../../legacy-remote-home/federation-ack-checkpoints' describe('federation acknowledgment checkpoints', () => { it('matches checkpoints only to their exact remote identity and never moves backward', () => { diff --git a/src/main/runtime/orchestration/federation/synchronization/federation-sync-capability.test.ts b/src/main/runtime/orchestration/federation/synchronization/federation-sync-capability.test.ts index c5c70557a30..d43957bdd3c 100644 --- a/src/main/runtime/orchestration/federation/synchronization/federation-sync-capability.test.ts +++ b/src/main/runtime/orchestration/federation/synchronization/federation-sync-capability.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest' import { ORCHESTRATION_FEDERATION_RELEASE_ARCHIVE_RUNTIME_CAPABILITY } from '../../../../../shared/orchestration/orchestration-runtime-capabilities' import { createIdleSyncHarness } from './federation-sync-test-harness' -import { armHomeAutoReleaseForOlderHost } from './federation-sync-capability' +import { armHomeAutoReleaseForOlderHost } from '../../legacy-remote-home/federation-sync-capability' function releasableTerminalWorker() { const harness = createIdleSyncHarness() diff --git a/src/main/runtime/orchestration/legacy-remote-entry-points.test.ts b/src/main/runtime/orchestration/legacy-remote-entry-points.test.ts new file mode 100644 index 00000000000..82e347aef52 --- /dev/null +++ b/src/main/runtime/orchestration/legacy-remote-entry-points.test.ts @@ -0,0 +1,89 @@ +import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs' +import { dirname, join, relative, resolve, sep } from 'node:path' +import { describe, expect, it } from 'vitest' + +const SRC = resolve(import.meta.dirname, '../../..') +// Each folder has one entry module, plus a DB-only one so the DB layer never loads rpc code. +// The two folders are one frozen unit and may import each other directly. +const DB_LAYER = 'main/runtime/orchestration/db/' +const LEGACY_ENTRIES_BY_FOLDER = { + 'main/runtime/orchestration/legacy-remote/': { + entry: 'main/runtime/orchestration/legacy-remote/legacy-remote.ts', + dbEntry: 'main/runtime/orchestration/legacy-remote/legacy-remote-db-methods.ts' + }, + 'main/runtime/orchestration/legacy-remote-home/': { + entry: 'main/runtime/orchestration/legacy-remote-home/legacy-remote-home.ts', + dbEntry: 'main/runtime/orchestration/legacy-remote-home/legacy-remote-home-db-methods.ts' + } +} +// Legacy starts load the worker list, so it bypasses the entry module to stay out of an import cycle. +const DIRECT_IMPORTS = new Set([ + 'main/runtime/rpc/methods/orchestration/worker/worker-list-projection.ts -> main/runtime/orchestration/legacy-remote-home/federated-fleet-snapshot.ts' +]) +const IMPORT_SPECIFIER = + /(?:from\s+|import\s*\(\s*|import\s+|require\(\s*)['"](\.{1,2}\/[^'"]+)['"]/g + +function productionSources(dir: string, out: string[] = []): string[] { + for (const entry of readdirSync(dir, { withFileTypes: true })) { + const path = join(dir, entry.name) + if (entry.isDirectory()) { + if (entry.name !== 'node_modules') { + productionSources(path, out) + } + } else if ( + /\.tsx?$/.test(entry.name) && + !/\.(test|spec)\.|test-support|harness/.test(entry.name) + ) { + out.push(path) + } + } + return out +} + +function srcPath(file: string): string { + return relative(SRC, file).split(sep).join('/') +} + +function resolveSpecifier(fromFile: string, specifier: string): string | undefined { + const base = resolve(dirname(fromFile), specifier) + return [base, `${base}.ts`, `${base}.tsx`, join(base, 'index.ts')].find( + (candidate) => existsSync(candidate) && statSync(candidate).isFile() + ) +} + +describe('legacy remote-attachment folders', () => { + it('are imported from outside only through their entry module', () => { + const violations: string[] = [] + const entryImporters = new Set() + for (const file of productionSources(SRC)) { + const from = srcPath(file) + for (const match of readFileSync(file, 'utf8').matchAll(IMPORT_SPECIFIER)) { + const target = resolveSpecifier(file, match[1]) + if (!target) { + continue + } + const to = srcPath(target) + for (const [folder, { entry, dbEntry }] of Object.entries(LEGACY_ENTRIES_BY_FOLDER)) { + if ( + to.startsWith(folder) && + !Object.keys(LEGACY_ENTRIES_BY_FOLDER).some((f) => from.startsWith(f)) + ) { + if (to === entry || (to === dbEntry && from.startsWith(DB_LAYER))) { + entryImporters.add(`${from} -> ${to}`) + } else if (!DIRECT_IMPORTS.has(`${from} -> ${to}`)) { + violations.push(`${from} -> ${to}`) + } + } + } + } + } + expect(violations).toEqual([]) + // The capability branch on each side: legacy worker starts and the legacy federation methods. + expect(entryImporters).toContain( + 'main/runtime/rpc/methods/orchestration/worker/workers.ts -> main/runtime/orchestration/legacy-remote-home/legacy-remote-home.ts' + ) + expect(entryImporters).toContain( + 'main/runtime/rpc/methods/orchestration/federation/federation-methods.ts -> main/runtime/orchestration/legacy-remote/legacy-remote.ts' + ) + }) +}) diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federated-attach-receipt.ts b/src/main/runtime/orchestration/legacy-remote-home/federated-attach-receipt.ts similarity index 92% rename from src/main/runtime/rpc/methods/orchestration/federation/federated-attach-receipt.ts rename to src/main/runtime/orchestration/legacy-remote-home/federated-attach-receipt.ts index 6fac7950954..69767a4c3b9 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federated-attach-receipt.ts +++ b/src/main/runtime/orchestration/legacy-remote-home/federated-attach-receipt.ts @@ -1,4 +1,4 @@ -import type { OrchestrationWorkerLaunchReceipt } from '../worker/worker-launch-preferences' +import type { OrchestrationWorkerLaunchReceipt } from '../../rpc/methods/orchestration/worker/worker-launch-preferences' export type RemoteFederatedWorkerStartReceipt = { dispatchId: string diff --git a/src/main/runtime/orchestration/db/federation/federated-dispatch-store.ts b/src/main/runtime/orchestration/legacy-remote-home/federated-dispatch-store.ts similarity index 71% rename from src/main/runtime/orchestration/db/federation/federated-dispatch-store.ts rename to src/main/runtime/orchestration/legacy-remote-home/federated-dispatch-store.ts index 4a0bf9c11f4..f2cf2a85589 100644 --- a/src/main/runtime/orchestration/db/federation/federated-dispatch-store.ts +++ b/src/main/runtime/orchestration/legacy-remote-home/federated-dispatch-store.ts @@ -1,6 +1,6 @@ -import type { FederatedDispatchRow } from '../orchestration-records' -import { OrchestrationError } from '../../orchestration-error' -import type { OrchestrationDb } from '../orchestration-db' +import type { FederatedDispatchRow } from '../db/orchestration-records' +import { OrchestrationError } from '../orchestration-error' +import type { OrchestrationDb } from '../db/orchestration-db' export function getFederatedDispatch( this: OrchestrationDb, @@ -125,6 +125,61 @@ export function updateFederatedDispatchRuntimeEpoch( .run(remoteRuntimeEpoch, dispatchId, remoteRuntimeEpoch) } +export function setFederatedHomeImportSequence( + this: OrchestrationDb, + dispatchId: string, + sequence: number +): void { + this.db + .prepare( + `UPDATE federated_dispatches + SET to_home_imported_sequence = ?, updated_at = datetime('now') + WHERE dispatch_id = ? AND to_home_imported_sequence < ?` + ) + .run(sequence, dispatchId, sequence) +} + +export function recordFederatedHomeAcknowledgment( + this: OrchestrationDb, + params: { + dispatchId: string + remoteRuntimeEpoch: string + sequence: number + } +): void { + const federated = this.getFederatedDispatch(params.dispatchId) + if ( + !federated || + !Number.isInteger(params.sequence) || + params.sequence < 0 || + params.sequence > federated.to_home_imported_sequence + ) { + throw new OrchestrationError( + 'request_mismatch', + `Federation acknowledgment for ${params.dispatchId} exceeds imported relay state.` + ) + } + this.db + .prepare( + `UPDATE federated_dispatches + SET remote_runtime_epoch = ?, + to_home_acknowledged_sequence = CASE + WHEN remote_runtime_epoch = ? + THEN MAX(to_home_acknowledged_sequence, ?) + ELSE ? + END, + updated_at = datetime('now') + WHERE dispatch_id = ?` + ) + .run( + params.remoteRuntimeEpoch, + params.remoteRuntimeEpoch, + params.sequence, + params.sequence, + params.dispatchId + ) +} + export type FederatedDispatchStoreMethods = { getFederatedDispatch: typeof getFederatedDispatch listFederatedDispatchesByIds: typeof listFederatedDispatchesByIds @@ -133,6 +188,8 @@ export type FederatedDispatchStoreMethods = { isFederatedDispatchRelayEligible: typeof isFederatedDispatchRelayEligible updateFederatedDispatchResources: typeof updateFederatedDispatchResources updateFederatedDispatchRuntimeEpoch: typeof updateFederatedDispatchRuntimeEpoch + setFederatedHomeImportSequence: typeof setFederatedHomeImportSequence + recordFederatedHomeAcknowledgment: typeof recordFederatedHomeAcknowledgment } export function attachFederatedDispatchStore(ctor: { prototype: object }): void { @@ -143,6 +200,8 @@ export function attachFederatedDispatchStore(ctor: { prototype: object }): void findNextTerminalFederatedDispatchPendingAcknowledgment, isFederatedDispatchRelayEligible, updateFederatedDispatchResources, - updateFederatedDispatchRuntimeEpoch + updateFederatedDispatchRuntimeEpoch, + setFederatedHomeImportSequence, + recordFederatedHomeAcknowledgment }) } diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federated-fleet-host-groups.ts b/src/main/runtime/orchestration/legacy-remote-home/federated-fleet-host-groups.ts similarity index 77% rename from src/main/runtime/rpc/methods/orchestration/federation/federated-fleet-host-groups.ts rename to src/main/runtime/orchestration/legacy-remote-home/federated-fleet-host-groups.ts index 445e6d80293..f2ebbb2145e 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federated-fleet-host-groups.ts +++ b/src/main/runtime/orchestration/legacy-remote-home/federated-fleet-host-groups.ts @@ -1,7 +1,7 @@ -import { ORCHESTRATION_FLEET_PAGE_MAX } from '../../../../../../shared/orchestration/fleet/orchestration-fleet-projection' -import type { OrchestrationDb } from '../../../../orchestration/db/orchestration-db' -import type { FederatedDispatchRow } from '../../../../orchestration/db/orchestration-records' -import type { OrcaRuntimeService } from '../../../../orca-runtime' +import { ORCHESTRATION_FLEET_PAGE_MAX } from '../../../../shared/orchestration/fleet/orchestration-fleet-projection' +import type { OrchestrationDb } from '../db/orchestration-db' +import type { FederatedDispatchRow } from '../db/orchestration-records' +import type { OrcaRuntimeService } from '../../orca-runtime' type HostGroup = { environmentId: string diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federated-fleet-snapshot.ts b/src/main/runtime/orchestration/legacy-remote-home/federated-fleet-snapshot.ts similarity index 91% rename from src/main/runtime/rpc/methods/orchestration/federation/federated-fleet-snapshot.ts rename to src/main/runtime/orchestration/legacy-remote-home/federated-fleet-snapshot.ts index 409fe4ff625..c8e71b5e7ad 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federated-fleet-snapshot.ts +++ b/src/main/runtime/orchestration/legacy-remote-home/federated-fleet-snapshot.ts @@ -1,18 +1,18 @@ import { groupFederatedDispatches } from './federated-fleet-host-groups' -import { mapWithConcurrency } from '../../../../../../shared/map-with-concurrency' -import { ORCHESTRATION_FEDERATION_FLEET_SNAPSHOT_RUNTIME_CAPABILITY } from '../../../../../../shared/orchestration/orchestration-runtime-capabilities' +import { mapWithConcurrency } from '../../../../shared/map-with-concurrency' +import { ORCHESTRATION_FEDERATION_FLEET_SNAPSHOT_RUNTIME_CAPABILITY } from '../../../../shared/orchestration/orchestration-runtime-capabilities' import { refreshOrchestrationFleetLivenessAttention, type FleetDurableWorker, type OrchestrationFleetPage -} from '../../../../../../shared/orchestration/fleet/orchestration-fleet-projection' -import { projectFleetNextAction } from '../../../../../../shared/orchestration/fleet/orchestration-fleet-worker-projection' -import { getOrchestrationPeerCapabilityCache } from '../../../../orchestration/federation/orchestration-peer-capability-cache' -import { liveFederatedHomeAutoReleaseAt } from '../../../../orchestration/terminal-authority/release/worker-terminal-ownership' -import type { OrchestrationDb } from '../../../../orchestration/db/orchestration-db' -import { OrchestrationError } from '../../../../orchestration/orchestration-error' -import type { OrcaRuntimeService } from '../../../../orca-runtime' -import { resolvePinnedFederatedServer } from '../worker/pinned-federated-server' +} from '../../../../shared/orchestration/fleet/orchestration-fleet-projection' +import { projectFleetNextAction } from '../../../../shared/orchestration/fleet/orchestration-fleet-worker-projection' +import { getOrchestrationPeerCapabilityCache } from '../federation/orchestration-peer-capability-cache' +import { liveFederatedHomeAutoReleaseAt } from '../terminal-authority/release/worker-terminal-ownership' +import type { OrchestrationDb } from '../db/orchestration-db' +import { OrchestrationError } from '../orchestration-error' +import type { OrcaRuntimeService } from '../../orca-runtime' +import { resolvePinnedFederatedServer } from '../../rpc/methods/orchestration/worker/pinned-federated-server' import { applyConfirmedFederatedReleaseHomeProjection } from './federated-worker-release' const FLEET_HOST_CONCURRENCY = 4 diff --git a/src/main/runtime/orchestration/legacy-remote-home/federated-home-auto-release-store.ts b/src/main/runtime/orchestration/legacy-remote-home/federated-home-auto-release-store.ts new file mode 100644 index 00000000000..208131ecbbc --- /dev/null +++ b/src/main/runtime/orchestration/legacy-remote-home/federated-home-auto-release-store.ts @@ -0,0 +1,85 @@ +import type { OrchestrationDb } from '../db/orchestration-db' +import { toSqliteUtcTimestamp } from '../db/utc-timestamp' +import { WORKER_TERMINAL_AUTO_RELEASE_GRACE_MS } from '../db/worker-terminal/worker-terminal-auto-release' + +/** Only for a host that cannot release on its own; arms once, so a retain or release before settlement still wins. */ +export function armFederatedHomeAutoRelease( + this: OrchestrationDb, + dispatchId: string, + nowMs = Date.now() +): void { + const { changes } = this.db + .prepare( + `UPDATE federated_dispatches + SET home_auto_release_at = ?, home_auto_release_state = 'armed', updated_at = datetime('now') + WHERE dispatch_id = ? AND home_auto_release_state IS NULL` + ) + .run(toSqliteUtcTimestamp(nowMs + WORKER_TERMINAL_AUTO_RELEASE_GRACE_MS), dispatchId) + if (changes > 0) { + this.workerTerminalAutoReleaseListener?.() + } +} + +/** A retain, an explicit release or the host's answer to an attempt ends the home deadline for good. */ +export function endFederatedHomeAutoRelease(this: OrchestrationDb, dispatchId: string): void { + this.db + .prepare( + `UPDATE federated_dispatches + SET home_auto_release_at = NULL, home_auto_release_state = 'ended', updated_at = datetime('now') + WHERE dispatch_id = ? AND home_auto_release_state IS NOT 'ended'` + ) + .run(dispatchId) +} + +/** Claiming postpones the deadline instead of hiding it, so an attempt cut short by a crash or failure runs again. */ +export function claimDueFederatedHomeAutoReleases(this: OrchestrationDb, nowMs: number): string[] { + if (this.workerAutoReleaseEnabled?.() === false) { + return [] + } + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the SELECT names exactly this one column. + const due = this.db + .prepare( + `SELECT dispatch_id FROM federated_dispatches + WHERE home_auto_release_state = 'armed' AND home_auto_release_at <= ?` + ) + .all(toSqliteUtcTimestamp(nowMs)) as { dispatch_id: string }[] + const claim = this.db.prepare( + `UPDATE federated_dispatches + SET home_auto_release_at = ?, updated_at = datetime('now') + WHERE dispatch_id = ? AND home_auto_release_state = 'armed' AND home_auto_release_at <= ?` + ) + const retryAt = toSqliteUtcTimestamp(nowMs + WORKER_TERMINAL_AUTO_RELEASE_GRACE_MS) + return due.flatMap(({ dispatch_id }) => + claim.run(retryAt, dispatch_id, toSqliteUtcTimestamp(nowMs)).changes > 0 ? [dispatch_id] : [] + ) +} + +export function isFederatedHomeAutoReleaseArmed( + this: OrchestrationDb, + dispatchId: string +): boolean { + return ( + this.db + .prepare( + `SELECT 1 FROM federated_dispatches + WHERE dispatch_id = ? AND home_auto_release_state = 'armed'` + ) + .get(dispatchId) !== undefined + ) +} + +export type FederatedHomeAutoReleaseStoreMethods = { + armFederatedHomeAutoRelease: typeof armFederatedHomeAutoRelease + endFederatedHomeAutoRelease: typeof endFederatedHomeAutoRelease + claimDueFederatedHomeAutoReleases: typeof claimDueFederatedHomeAutoReleases + isFederatedHomeAutoReleaseArmed: typeof isFederatedHomeAutoReleaseArmed +} + +export function attachFederatedHomeAutoReleaseStore(ctor: { prototype: object }): void { + Object.assign(ctor.prototype, { + armFederatedHomeAutoRelease, + endFederatedHomeAutoRelease, + claimDueFederatedHomeAutoReleases, + isFederatedHomeAutoReleaseArmed + }) +} diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-child-parent.ts b/src/main/runtime/orchestration/legacy-remote-home/federated-worker-child-parent.ts similarity index 73% rename from src/main/runtime/rpc/methods/orchestration/federation/federated-worker-child-parent.ts rename to src/main/runtime/orchestration/legacy-remote-home/federated-worker-child-parent.ts index 8c90bf47eac..e0249544e10 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-child-parent.ts +++ b/src/main/runtime/orchestration/legacy-remote-home/federated-worker-child-parent.ts @@ -1,11 +1,11 @@ -import type { OrcaRuntimeService } from '../../../../orca-runtime' -import type { OrchestrationSessionCaller } from '../../../../orchestration/addressing/orchestration-caller-identity' -import { OrchestrationError } from '../../../../orchestration/orchestration-error' -import { readCallerStoreInstallationId } from '../../../../hosts/platform-probe/host-descriptor' -import { getCanonicalUserDataPath } from '../../../../../persistence/loading-store/user-data-path' -import type { CrossStoreParentRef } from '../../../../../../shared/worktree/lineage-types' -import { supportsCrossStoreLineage } from '../../../../../../shared/worktree-runtime-capabilities' -import { resolveDispatchCallerWorktreeId } from '../orchestration-caller-workspace' +import type { OrcaRuntimeService } from '../../orca-runtime' +import type { OrchestrationSessionCaller } from '../addressing/orchestration-caller-identity' +import { OrchestrationError } from '../orchestration-error' +import { readCallerStoreInstallationId } from '../../hosts/platform-probe/host-descriptor' +import { getCanonicalUserDataPath } from '../../../persistence/loading-store/user-data-path' +import type { CrossStoreParentRef } from '../../../../shared/worktree/lineage-types' +import { supportsCrossStoreLineage } from '../../../../shared/worktree-runtime-capabilities' +import { resolveDispatchCallerWorktreeId } from '../../rpc/methods/orchestration/orchestration-caller-workspace' /** * `--on --worktree new-child`: the server's new worktree nests under the coordinator's diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-home-auto-release.ts b/src/main/runtime/orchestration/legacy-remote-home/federated-worker-home-auto-release.ts similarity index 80% rename from src/main/runtime/rpc/methods/orchestration/federation/federated-worker-home-auto-release.ts rename to src/main/runtime/orchestration/legacy-remote-home/federated-worker-home-auto-release.ts index 622685198eb..db9125181dc 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-home-auto-release.ts +++ b/src/main/runtime/orchestration/legacy-remote-home/federated-worker-home-auto-release.ts @@ -1,5 +1,5 @@ -import type { WorkerTerminalReleaseRuntime } from '../../../../orchestration/terminal-authority/release/worker-terminal-release-runtime' -import { resolvePinnedFederatedServer } from '../worker/worker-observation' +import type { WorkerTerminalReleaseRuntime } from '../terminal-authority/release/worker-terminal-release-runtime' +import { resolvePinnedFederatedServer } from '../../rpc/methods/orchestration/worker/pinned-federated-server' import { releaseFederatedWorker } from './federated-worker-release' /** The home's deadline for a host that did not arm its own; the host's takeover and ownership checks still refuse it. */ diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-read.ts b/src/main/runtime/orchestration/legacy-remote-home/federated-worker-read.ts similarity index 82% rename from src/main/runtime/rpc/methods/orchestration/federation/federated-worker-read.ts rename to src/main/runtime/orchestration/legacy-remote-home/federated-worker-read.ts index 87700f6a9c2..1cf73b35ea8 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-read.ts +++ b/src/main/runtime/orchestration/legacy-remote-home/federated-worker-read.ts @@ -1,15 +1,15 @@ import type { ORCHESTRATION_WORKER_READ_SOURCES, OrchestrationWorkerReadResult -} from '../../../../../../shared/orchestration/workers/orchestration-worker-output' -import { ORCHESTRATION_FEDERATION_STRUCTURED_READ_RUNTIME_CAPABILITY } from '../../../../../../shared/orchestration/orchestration-runtime-capabilities' -import type { OrchestrationDb } from '../../../../orchestration/db/orchestration-db' -import { OrchestrationError } from '../../../../orchestration/orchestration-error' -import { getOrchestrationPeerCapabilityCache } from '../../../../orchestration/federation/orchestration-peer-capability-cache' -import type { FederatedDispatchRow } from '../../../../orchestration/db/orchestration-records' -import type { OrcaRuntimeService } from '../../../../orca-runtime' -import { readLegacyFederatedTerminal } from '../worker/worker-legacy-federated-read' -import type { resolvePinnedFederatedServer } from '../worker/worker-observation' +} from '../../../../shared/orchestration/workers/orchestration-worker-output' +import { ORCHESTRATION_FEDERATION_STRUCTURED_READ_RUNTIME_CAPABILITY } from '../../../../shared/orchestration/orchestration-runtime-capabilities' +import type { OrchestrationDb } from '../db/orchestration-db' +import { OrchestrationError } from '../orchestration-error' +import { getOrchestrationPeerCapabilityCache } from '../federation/orchestration-peer-capability-cache' +import type { FederatedDispatchRow } from '../db/orchestration-records' +import type { OrcaRuntimeService } from '../../orca-runtime' +import { readLegacyFederatedTerminal } from './worker-legacy-federated-read' +import type { resolvePinnedFederatedServer } from '../../rpc/methods/orchestration/worker/pinned-federated-server' export async function readFederatedWorkerOutput(args: { runtime: OrcaRuntimeService diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-ready-record.ts b/src/main/runtime/orchestration/legacy-remote-home/federated-worker-ready-record.ts similarity index 90% rename from src/main/runtime/rpc/methods/orchestration/federation/federated-worker-ready-record.ts rename to src/main/runtime/orchestration/legacy-remote-home/federated-worker-ready-record.ts index 812a59d67c5..1a66e784843 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-ready-record.ts +++ b/src/main/runtime/orchestration/legacy-remote-home/federated-worker-ready-record.ts @@ -1,4 +1,4 @@ -import type { OrchestrationDb } from '../../../../orchestration/db/orchestration-db' +import type { OrchestrationDb } from '../db/orchestration-db' import type { ReadyRemoteFederatedWorkerStartReceipt } from './federated-attach-receipt' /** Records where a ready remote worker lives and that the server accepted its input. */ diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-release.ts b/src/main/runtime/orchestration/legacy-remote-home/federated-worker-release.ts similarity index 90% rename from src/main/runtime/rpc/methods/orchestration/federation/federated-worker-release.ts rename to src/main/runtime/orchestration/legacy-remote-home/federated-worker-release.ts index 8d53875ad06..a9965dfafba 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-release.ts +++ b/src/main/runtime/orchestration/legacy-remote-home/federated-worker-release.ts @@ -1,17 +1,17 @@ import { ORCHESTRATION_FEDERATION_RELEASE_ARCHIVE_RUNTIME_CAPABILITY, ORCHESTRATION_WORKER_AUTO_RELEASE_RUNTIME_CAPABILITY -} from '../../../../../../shared/orchestration/orchestration-runtime-capabilities' -import type { RuntimeStatus } from '../../../../../../shared/runtime-session-contracts' +} from '../../../../shared/orchestration/orchestration-runtime-capabilities' +import type { RuntimeStatus } from '../../../../shared/runtime-session-contracts' import { z } from 'zod' -import { getOrchestrationPeerCapabilityCache } from '../../../../orchestration/federation/orchestration-peer-capability-cache' -import { OrchestrationError } from '../../../../orchestration/orchestration-error' -import type { OrchestrationDb } from '../../../../orchestration/db/orchestration-db' -import type { FederatedDispatchRow } from '../../../../orchestration/db/orchestration-records' -import type { WorkerTerminalReleaseRuntime } from '../../../../orchestration/terminal-authority/release/worker-terminal-release-runtime' -import type { WorkerReleaseReceipt } from '../worker/worker-release-completion' -import { releaseUnknownRecovery } from '../worker/worker-release-unknown-recovery' -import type { resolvePinnedFederatedServer } from '../worker/worker-observation' +import { getOrchestrationPeerCapabilityCache } from '../federation/orchestration-peer-capability-cache' +import { OrchestrationError } from '../orchestration-error' +import type { OrchestrationDb } from '../db/orchestration-db' +import type { FederatedDispatchRow } from '../db/orchestration-records' +import type { WorkerTerminalReleaseRuntime } from '../terminal-authority/release/worker-terminal-release-runtime' +import type { WorkerReleaseReceipt } from '../../rpc/methods/orchestration/worker/worker-release-completion' +import { releaseUnknownRecovery } from '../../rpc/methods/orchestration/worker/worker-release-unknown-recovery' +import type { resolvePinnedFederatedServer } from '../../rpc/methods/orchestration/worker/pinned-federated-server' type RemoteReleaseReceipt = Omit & { archive?: WorkerReleaseReceipt['archive'] diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-show.ts b/src/main/runtime/orchestration/legacy-remote-home/federated-worker-show.ts similarity index 87% rename from src/main/runtime/rpc/methods/orchestration/federation/federated-worker-show.ts rename to src/main/runtime/orchestration/legacy-remote-home/federated-worker-show.ts index 69f5a61421b..b8e9b89d78d 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-show.ts +++ b/src/main/runtime/orchestration/legacy-remote-home/federated-worker-show.ts @@ -1,20 +1,17 @@ -import type { OrchestrationFleetWorker } from '../../../../../../shared/orchestration/fleet/orchestration-fleet-projection' -import type { OrchestrationDb } from '../../../../orchestration/db/orchestration-db' -import { exposeDispatchContext } from '../worker/dispatch-context-exposure' -import { OrchestrationError } from '../../../../orchestration/orchestration-error' -import { liveFederatedHomeAutoReleaseAt } from '../../../../orchestration/terminal-authority/release/worker-terminal-ownership' -import type { - DispatchContextRow, - FederatedDispatchRow -} from '../../../../orchestration/db/orchestration-records' -import type { OrcaRuntimeService } from '../../../../orca-runtime' +import type { OrchestrationFleetWorker } from '../../../../shared/orchestration/fleet/orchestration-fleet-projection' +import type { OrchestrationDb } from '../db/orchestration-db' +import { exposeDispatchContext } from '../../rpc/methods/orchestration/worker/dispatch-context-exposure' +import { OrchestrationError } from '../orchestration-error' +import { liveFederatedHomeAutoReleaseAt } from '../terminal-authority/release/worker-terminal-ownership' +import type { DispatchContextRow, FederatedDispatchRow } from '../db/orchestration-records' +import type { OrcaRuntimeService } from '../../orca-runtime' import { callFederatedWorkerShow, exposeFederatedWorkerObservation, exposeWorker, - projectFleetWorkerPage, - resolvePinnedFederatedServer -} from '../worker/worker-observation' + projectFleetWorkerPage +} from '../../rpc/methods/orchestration/worker/worker-observation' +import { resolvePinnedFederatedServer } from '../../rpc/methods/orchestration/worker/pinned-federated-server' import { applyFederatedFleetObservations } from './federated-fleet-snapshot' import { applyConfirmedFederatedReleaseHomeProjection } from './federated-worker-release' diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-start-receipts.ts b/src/main/runtime/orchestration/legacy-remote-home/federated-worker-start-receipts.ts similarity index 93% rename from src/main/runtime/rpc/methods/orchestration/federation/federated-worker-start-receipts.ts rename to src/main/runtime/orchestration/legacy-remote-home/federated-worker-start-receipts.ts index 692caf380f6..da38e2ab909 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-start-receipts.ts +++ b/src/main/runtime/orchestration/legacy-remote-home/federated-worker-start-receipts.ts @@ -1,4 +1,4 @@ -import type { OrchestrationWorkerLaunchReceipt } from '../worker/worker-launch-preferences' +import type { OrchestrationWorkerLaunchReceipt } from '../../rpc/methods/orchestration/worker/worker-launch-preferences' export function isKnownRemoteStartFailure(code: string): boolean { return [ diff --git a/src/main/runtime/orchestration/db/worker-dispatch/federated-worker-start-reconcile.ts b/src/main/runtime/orchestration/legacy-remote-home/federated-worker-start-reconcile.ts similarity index 94% rename from src/main/runtime/orchestration/db/worker-dispatch/federated-worker-start-reconcile.ts rename to src/main/runtime/orchestration/legacy-remote-home/federated-worker-start-reconcile.ts index 157f21e3845..63d117468c9 100644 --- a/src/main/runtime/orchestration/db/worker-dispatch/federated-worker-start-reconcile.ts +++ b/src/main/runtime/orchestration/legacy-remote-home/federated-worker-start-reconcile.ts @@ -1,13 +1,13 @@ -import type { WorkerDispatchRow } from '../orchestration-records' -import { OrchestrationError } from '../../orchestration-error' -import type { OrchestrationDb } from '../orchestration-db' -import { reconcileTaskAfterDispatchInterruption } from '../dispatch-context/task-dispatch-reconciliation' +import type { WorkerDispatchRow } from '../db/orchestration-records' +import { OrchestrationError } from '../orchestration-error' +import type { OrchestrationDb } from '../db/orchestration-db' +import { reconcileTaskAfterDispatchInterruption } from '../db/dispatch-context/task-dispatch-reconciliation' import { beginLifecycleWriteTransaction, commitLifecycleWriteTransaction, rollbackLifecycleWriteTransaction, transitionLifecycleWithDb -} from '../lifecycle-transition' +} from '../db/lifecycle-transition' export function reconcileFederatedWorkerStart( this: OrchestrationDb, diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-start-request.ts b/src/main/runtime/orchestration/legacy-remote-home/federated-worker-start-request.ts similarity index 54% rename from src/main/runtime/rpc/methods/orchestration/federation/federated-worker-start-request.ts rename to src/main/runtime/orchestration/legacy-remote-home/federated-worker-start-request.ts index fe511658ee6..21dd2d80613 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-start-request.ts +++ b/src/main/runtime/orchestration/legacy-remote-home/federated-worker-start-request.ts @@ -1,8 +1,8 @@ -import type { OrchestrationSessionCaller } from '../../../../orchestration/addressing/orchestration-caller-identity' -import type { OrcaRuntimeService } from '../../../../orca-runtime' -import type { OrchestrationDb } from '../../../../orchestration/db/orchestration-db' -import type { WorkerStartInput } from '../worker/worker-start-schema' -import type { WorkerStartMutation } from '../worker/worker-start-mutation' +import type { OrchestrationSessionCaller } from '../addressing/orchestration-caller-identity' +import type { OrcaRuntimeService } from '../../orca-runtime' +import type { OrchestrationDb } from '../db/orchestration-db' +import type { WorkerStartInput } from '../../rpc/methods/orchestration/worker/worker-start-schema' +import type { WorkerStartMutation } from '../../rpc/methods/orchestration/worker/worker-start-mutation' export type FederatedWorkerStartRequest = { params: WorkerStartInput diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-start.ts b/src/main/runtime/orchestration/legacy-remote-home/federated-worker-start.ts similarity index 90% rename from src/main/runtime/rpc/methods/orchestration/federation/federated-worker-start.ts rename to src/main/runtime/orchestration/legacy-remote-home/federated-worker-start.ts index 2d97909ae01..9e5d31b50ef 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-start.ts +++ b/src/main/runtime/orchestration/legacy-remote-home/federated-worker-start.ts @@ -1,6 +1,6 @@ import type { FederatedWorkerStartRequest } from './federated-worker-start-request' -import { isTuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent-config' -import type { RuntimeStatus } from '../../../../../../shared/runtime-session-contracts' +import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' +import type { RuntimeStatus } from '../../../../shared/runtime-session-contracts' import { ORCHESTRATION_CONTRACT_RUNTIME_CAPABILITY, ORCHESTRATION_FEDERATION_CONTROL_MAIL_PROTOCOL_VERSION, @@ -9,37 +9,37 @@ import { ORCHESTRATION_FEDERATION_LIFECYCLE_SETTLEMENT_RUNTIME_CAPABILITY, ORCHESTRATION_FEDERATION_RUNTIME_CAPABILITY, ORCHESTRATION_WORKER_TURN_STOP_REPORTS_RUNTIME_CAPABILITY -} from '../../../../../../shared/orchestration/orchestration-runtime-capabilities' -import { orchestrationMigrationData } from '../../../../../../shared/orchestration/orchestration-rpc-contract' -import { OrchestrationError } from '../../../../orchestration/orchestration-error' +} from '../../../../shared/orchestration/orchestration-runtime-capabilities' +import { orchestrationMigrationData } from '../../../../shared/orchestration/orchestration-rpc-contract' +import { OrchestrationError } from '../orchestration-error' import { assertWorkerLaunchPreferencesRuntimeSupported, assertWorkerLaunchPreferencesCreateTerminal, createPendingWorkerLaunchReceipt, resolveFederatedWorkerLaunchReceipt -} from '../worker/worker-launch-preferences' -import { validateFederatedWorkerStartPlacement } from '../worker/worker-start-validation' -import { resolveFederatedWorkerStartBudgets } from '../worker/worker-start-budgets' -import { resolveDispatchCreator } from '../runs/dispatch-creator' +} from '../../rpc/methods/orchestration/worker/worker-launch-preferences' +import { validateFederatedWorkerStartPlacement } from '../../rpc/methods/orchestration/worker/worker-start-validation' +import { resolveFederatedWorkerStartBudgets } from '../../rpc/methods/orchestration/worker/worker-start-budgets' +import { resolveDispatchCreator } from '../../rpc/methods/orchestration/runs/dispatch-creator' import { isReadyRemoteFederatedWorkerStartReceipt, parseRemoteFederatedWorkerStartReceipt } from './federated-attach-receipt' -import { isWorkerStartTimeoutWithinTimerLimit } from '../../../../../../shared/orchestration/orchestration-timing-budgets' +import { isWorkerStartTimeoutWithinTimerLimit } from '../../../../shared/orchestration/orchestration-timing-budgets' import { federatedFailedReceipt, federatedUnknownReceipt, isKnownRemoteStartFailure } from './federated-worker-start-receipts' -import { releaseRetriedWorkerTerminal } from '../worker/retried-worker-terminal-release' -import { withWorkerStartNext } from '../receipt-next' +import { releaseRetriedWorkerTerminal } from '../../rpc/methods/orchestration/worker/retried-worker-terminal-release' +import { withWorkerStartNext } from '../../rpc/methods/orchestration/receipt-next' import { recordReadyFederatedDispatch } from './federated-worker-ready-record' import { resolveFederatedChildParent } from './federated-worker-child-parent' -import { prepareWorkerStartCard } from '../../../../orchestration/workers/launch/worker-start-card' +import { prepareWorkerStartCard } from '../workers/launch/worker-start-card' import { recordWorkerLaunchObservation, workerLaunchAgent -} from '../../../../orchestration/workers/launch/worker-launch-observation' +} from '../workers/launch/worker-launch-observation' export async function startFederatedWorker(args: FederatedWorkerStartRequest): Promise { const { params, runtime, db, task, orchestrationMutation } = args diff --git a/src/main/runtime/orchestration/federation/synchronization/federation-ack-checkpoints.ts b/src/main/runtime/orchestration/legacy-remote-home/federation-ack-checkpoints.ts similarity index 100% rename from src/main/runtime/orchestration/federation/synchronization/federation-ack-checkpoints.ts rename to src/main/runtime/orchestration/legacy-remote-home/federation-ack-checkpoints.ts diff --git a/src/main/runtime/orchestration/federation/relay/federation-acknowledgment-recovery.ts b/src/main/runtime/orchestration/legacy-remote-home/federation-acknowledgment-recovery.ts similarity index 97% rename from src/main/runtime/orchestration/federation/relay/federation-acknowledgment-recovery.ts rename to src/main/runtime/orchestration/legacy-remote-home/federation-acknowledgment-recovery.ts index cbc5b5b3e03..5ea1b77a324 100644 --- a/src/main/runtime/orchestration/federation/relay/federation-acknowledgment-recovery.ts +++ b/src/main/runtime/orchestration/legacy-remote-home/federation-acknowledgment-recovery.ts @@ -1,4 +1,4 @@ -import { federationRelayRetryDelayMs } from './federation-relay-scheduler' +import { federationRelayRetryDelayMs } from '../federation/relay/federation-relay-scheduler' type PendingAcknowledgmentRow = { dispatchId: string; rowId: number } diff --git a/src/main/runtime/orchestration/db/federation/federation-relay-import.ts b/src/main/runtime/orchestration/legacy-remote-home/federation-relay-import.ts similarity index 96% rename from src/main/runtime/orchestration/db/federation/federation-relay-import.ts rename to src/main/runtime/orchestration/legacy-remote-home/federation-relay-import.ts index c90f6d718e3..4fc44d31b5f 100644 --- a/src/main/runtime/orchestration/db/federation/federation-relay-import.ts +++ b/src/main/runtime/orchestration/legacy-remote-home/federation-relay-import.ts @@ -4,9 +4,9 @@ import type { MessageRow, WorkerReportOutcome, WorkerReportSettlement -} from '../orchestration-records' -import { OrchestrationError } from '../../orchestration-error' -import type { OrchestrationDb } from '../orchestration-db' +} from '../db/orchestration-records' +import { OrchestrationError } from '../orchestration-error' +import type { OrchestrationDb } from '../db/orchestration-db' export function importFederatedRelayItem( this: OrchestrationDb, diff --git a/src/main/runtime/orchestration/federation/synchronization/federation-sync-capability.ts b/src/main/runtime/orchestration/legacy-remote-home/federation-sync-capability.ts similarity index 79% rename from src/main/runtime/orchestration/federation/synchronization/federation-sync-capability.ts rename to src/main/runtime/orchestration/legacy-remote-home/federation-sync-capability.ts index efc383fa472..8d5778da911 100644 --- a/src/main/runtime/orchestration/federation/synchronization/federation-sync-capability.ts +++ b/src/main/runtime/orchestration/legacy-remote-home/federation-sync-capability.ts @@ -1,17 +1,17 @@ -import type { RuntimeStatus } from '../../../../../shared/runtime-session-contracts' -import '../../../../../shared/protocol-version' +import type { RuntimeStatus } from '../../../../shared/runtime-session-contracts' +import '../../../../shared/protocol-version' import { ORCHESTRATION_FEDERATION_LIFECYCLE_SETTLEMENT_PROTOCOL_VERSION, ORCHESTRATION_FEDERATION_LIFECYCLE_SETTLEMENT_RUNTIME_CAPABILITY, ORCHESTRATION_FEDERATION_RELEASE_ARCHIVE_RUNTIME_CAPABILITY, ORCHESTRATION_WORKER_AUTO_RELEASE_RUNTIME_CAPABILITY -} from '../../../../../shared/orchestration/orchestration-runtime-capabilities' -import type { RuntimeCapability } from '../../../../../shared/protocol-version' -import { STRUCTURED_WORKER_HANDLE_PREFIX } from '../../../../../shared/orchestration/workers/structured-worker-handle' -import type { FederationRuntime } from '../federation-runtime' -import type { FederatedDispatchRow } from '../../db/orchestration-records' -import { getOrchestrationPeerCapabilityCache } from '../orchestration-peer-capability-cache' -import { WORKER_RELEASABLE_STATES } from '../../terminal-authority/release/worker-terminal-ownership' +} from '../../../../shared/orchestration/orchestration-runtime-capabilities' +import type { RuntimeCapability } from '../../../../shared/protocol-version' +import { STRUCTURED_WORKER_HANDLE_PREFIX } from '../../../../shared/orchestration/workers/structured-worker-handle' +import type { FederationRuntime } from '../federation/federation-runtime' +import type { FederatedDispatchRow } from '../db/orchestration-records' +import { getOrchestrationPeerCapabilityCache } from '../federation/orchestration-peer-capability-cache' +import { WORKER_RELEASABLE_STATES } from '../terminal-authority/release/worker-terminal-ownership' export async function resolveFederatedLifecycleSettlementCapability( runtime: FederationRuntime, diff --git a/src/main/runtime/orchestration/federation/synchronization/federation-sync-message.ts b/src/main/runtime/orchestration/legacy-remote-home/federation-sync-message.ts similarity index 94% rename from src/main/runtime/orchestration/federation/synchronization/federation-sync-message.ts rename to src/main/runtime/orchestration/legacy-remote-home/federation-sync-message.ts index a23a0686e70..27966b13842 100644 --- a/src/main/runtime/orchestration/federation/synchronization/federation-sync-message.ts +++ b/src/main/runtime/orchestration/legacy-remote-home/federation-sync-message.ts @@ -4,9 +4,9 @@ import { type MessagePriority, type MessageType, type WorkerReportOutcome -} from '../../db/orchestration-records' -import { OrchestrationError } from '../../orchestration-error' -import { parseFederatedWorkerReportPayload } from '../relay/federation-worker-report-payload' +} from '../db/orchestration-records' +import { OrchestrationError } from '../orchestration-error' +import { parseFederatedWorkerReportPayload } from './federation-worker-report-payload' export type RelayedMessage = { from: string diff --git a/src/main/runtime/orchestration/federation/synchronization/federation-sync.ts b/src/main/runtime/orchestration/legacy-remote-home/federation-sync.ts similarity index 93% rename from src/main/runtime/orchestration/federation/synchronization/federation-sync.ts rename to src/main/runtime/orchestration/legacy-remote-home/federation-sync.ts index ad2b28c2113..7fdcb78c919 100644 --- a/src/main/runtime/orchestration/federation/synchronization/federation-sync.ts +++ b/src/main/runtime/orchestration/legacy-remote-home/federation-sync.ts @@ -1,21 +1,21 @@ -import { federationRelayPrefix } from '../relay/federation-relay-prefix' -import { federationRelayWireItem } from '../relay/federation-relay-wire' -import type { FederationRuntime } from '../federation-runtime' -import type { FederatedLifecycleSettlement } from '../federation-lifecycle-settlement' -import '../../../../../shared/protocol-version' -import { ORCHESTRATION_FEDERATION_LIFECYCLE_SETTLEMENT_PROTOCOL_VERSION } from '../../../../../shared/orchestration/orchestration-runtime-capabilities' -import { OrchestrationError } from '../../orchestration-error' +import { federationRelayPrefix } from '../federation/relay/federation-relay-prefix' +import { federationRelayWireItem } from '../legacy-remote/federation-relay-wire' +import type { FederationRuntime } from '../federation/federation-runtime' +import type { FederatedLifecycleSettlement } from '../legacy-remote/federation-lifecycle-settlement' +import '../../../../shared/protocol-version' +import { ORCHESTRATION_FEDERATION_LIFECYCLE_SETTLEMENT_PROTOCOL_VERSION } from '../../../../shared/orchestration/orchestration-runtime-capabilities' +import { OrchestrationError } from '../orchestration-error' import { acquireFederationAckLease, getFederationAckedThrough, recordFederationAckCheckpoint } from './federation-ack-checkpoints' -import { bindCoordinatorMutationPayload } from '../../workers/reports/dispatch-message-binding' +import { bindCoordinatorMutationPayload } from '../workers/reports/dispatch-message-binding' import { armHomeAutoReleaseForOlderHost, resolveFederatedLifecycleSettlementCapability } from './federation-sync-capability' -import { getOrchestrationPeerCapabilityCache } from '../orchestration-peer-capability-cache' +import { getOrchestrationPeerCapabilityCache } from '../federation/orchestration-peer-capability-cache' import { parseFederatedLifecycle, parseRelayedMessage, diff --git a/src/main/runtime/orchestration/federation/relay/federation-worker-report-payload.ts b/src/main/runtime/orchestration/legacy-remote-home/federation-worker-report-payload.ts similarity index 89% rename from src/main/runtime/orchestration/federation/relay/federation-worker-report-payload.ts rename to src/main/runtime/orchestration/legacy-remote-home/federation-worker-report-payload.ts index 2a05d293471..6ace3b99041 100644 --- a/src/main/runtime/orchestration/federation/relay/federation-worker-report-payload.ts +++ b/src/main/runtime/orchestration/legacy-remote-home/federation-worker-report-payload.ts @@ -1,5 +1,5 @@ -import type { WorkerReportOutcome } from '../../db/orchestration-records' -import { OrchestrationError } from '../../orchestration-error' +import type { WorkerReportOutcome } from '../db/orchestration-records' +import { OrchestrationError } from '../orchestration-error' export function parseFederatedWorkerReportPayload(payload: string | null): { taskId: string diff --git a/src/main/runtime/orchestration/legacy-remote-home/legacy-remote-home-db-methods.ts b/src/main/runtime/orchestration/legacy-remote-home/legacy-remote-home-db-methods.ts new file mode 100644 index 00000000000..048054b8fea --- /dev/null +++ b/src/main/runtime/orchestration/legacy-remote-home/legacy-remote-home-db-methods.ts @@ -0,0 +1,21 @@ +// The DB layer's only way into this folder; keep it free of rpc and runtime imports. +import { attachFederatedDispatchStore } from './federated-dispatch-store' +import type { FederatedDispatchStoreMethods } from './federated-dispatch-store' +import { attachFederatedHomeAutoReleaseStore } from './federated-home-auto-release-store' +import type { FederatedHomeAutoReleaseStoreMethods } from './federated-home-auto-release-store' +import { attachFederatedWorkerStartReconcile } from './federated-worker-start-reconcile' +import type { FederatedWorkerStartReconcileMethods } from './federated-worker-start-reconcile' +import { attachFederationRelayImport } from './federation-relay-import' +import type { FederationRelayImportMethods } from './federation-relay-import' + +export type LegacyRemoteHomeDbMethods = FederatedWorkerStartReconcileMethods & + FederatedDispatchStoreMethods & + FederationRelayImportMethods & + FederatedHomeAutoReleaseStoreMethods + +export function attachLegacyRemoteHomeDbMethods(ctor: { prototype: object }): void { + attachFederatedWorkerStartReconcile(ctor) + attachFederatedDispatchStore(ctor) + attachFederationRelayImport(ctor) + attachFederatedHomeAutoReleaseStore(ctor) +} diff --git a/src/main/runtime/orchestration/legacy-remote-home/legacy-remote-home.ts b/src/main/runtime/orchestration/legacy-remote-home/legacy-remote-home.ts new file mode 100644 index 00000000000..3cfe495500f --- /dev/null +++ b/src/main/runtime/orchestration/legacy-remote-home/legacy-remote-home.ts @@ -0,0 +1,18 @@ +// Run-home half of today's remote attachments (`worker-start --on` drives a worker on a paired Orca). +// Frozen: bug fixes only. Code outside this folder imports it only through this module, +// except the DB layer (legacy-remote-home-db-methods.ts) and worker-list-projection.ts, which +// legacy starts load, so it imports federated-fleet-snapshot.ts directly to avoid an import cycle. +/** The one place a worker start leaves the local path: `worker-start --on `. */ +export { startFederatedWorker } from './federated-worker-start' + +export { releaseFederatedWorkerAtHomeDeadline } from './federated-worker-home-auto-release' +export { readFederatedWorkerOutput } from './federated-worker-read' +export { releaseFederatedWorker, retainFederatedWorker } from './federated-worker-release' +export { showFederatedWorker } from './federated-worker-show' +export { + clearFederationAckCheckpoints, + releaseFederationAckCheckpoint +} from './federation-ack-checkpoints' +export { FederationAcknowledgmentRecovery } from './federation-acknowledgment-recovery' +export { syncFederatedDispatch } from './federation-sync' +export { federatedControlMailRefusal, sendFederatedControlMail } from './send-control-mail' diff --git a/src/main/runtime/rpc/methods/orchestration/messaging/send-control-mail.ts b/src/main/runtime/orchestration/legacy-remote-home/send-control-mail.ts similarity index 84% rename from src/main/runtime/rpc/methods/orchestration/messaging/send-control-mail.ts rename to src/main/runtime/orchestration/legacy-remote-home/send-control-mail.ts index 247d31b3568..ee07baa780d 100644 --- a/src/main/runtime/rpc/methods/orchestration/messaging/send-control-mail.ts +++ b/src/main/runtime/orchestration/legacy-remote-home/send-control-mail.ts @@ -1,15 +1,12 @@ -import type { - MessagePriority, - MessageType -} from '../../../../orchestration/db/orchestration-records' -import type { OrchestrationDb } from '../../../../orchestration/db/orchestration-db' -import type { OrcaRuntimeService } from '../../../../orca-runtime' -import { OrchestrationError } from '../../../../orchestration/orchestration-error' -import { encodeFederatedControlMessage } from '../../../../orchestration/federation/relay/federation-control-message' -import { ORCHESTRATION_FEDERATION_CONTROL_MAIL_PROTOCOL_VERSION } from '../../../../../../shared/orchestration/orchestration-runtime-capabilities' -import { recordReceiptBeforeNudge } from './mutation-replay-nudge' -import type { SendParams } from './send-params' -import type { SendRecipientWarning } from './recipient-routing' +import type { MessagePriority, MessageType } from '../db/orchestration-records' +import type { OrchestrationDb } from '../db/orchestration-db' +import type { OrcaRuntimeService } from '../../orca-runtime' +import { OrchestrationError } from '../orchestration-error' +import { encodeFederatedControlMessage } from '../legacy-remote/federation-control-message' +import { ORCHESTRATION_FEDERATION_CONTROL_MAIL_PROTOCOL_VERSION } from '../../../../shared/orchestration/orchestration-runtime-capabilities' +import { recordReceiptBeforeNudge } from '../../rpc/methods/orchestration/messaging/mutation-replay-nudge' +import type { SendParams } from '../../rpc/methods/orchestration/messaging/send-params' +import type { SendRecipientWarning } from '../../rpc/methods/orchestration/messaging/recipient-routing' import type { z } from 'zod' type SendParamsInput = z.infer diff --git a/src/main/runtime/rpc/methods/orchestration/worker/worker-legacy-federated-read.ts b/src/main/runtime/orchestration/legacy-remote-home/worker-legacy-federated-read.ts similarity index 87% rename from src/main/runtime/rpc/methods/orchestration/worker/worker-legacy-federated-read.ts rename to src/main/runtime/orchestration/legacy-remote-home/worker-legacy-federated-read.ts index b472f0af417..05c44fc1633 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/worker-legacy-federated-read.ts +++ b/src/main/runtime/orchestration/legacy-remote-home/worker-legacy-federated-read.ts @@ -1,12 +1,12 @@ -import type { ORCHESTRATION_WORKER_READ_SOURCES } from '../../../../../../shared/orchestration/workers/orchestration-worker-output' -import type { RuntimeTerminalRead } from '../../../../../../shared/runtime-terminal-contracts' -import { OrchestrationError } from '../../../../orchestration/orchestration-error' +import type { ORCHESTRATION_WORKER_READ_SOURCES } from '../../../../shared/orchestration/workers/orchestration-worker-output' +import type { RuntimeTerminalRead } from '../../../../shared/runtime-terminal-contracts' +import { OrchestrationError } from '../orchestration-error' import { createWorkerOutputSourceIdentity, decodeWorkerOutputCursor, encodeWorkerOutputCursor -} from '../../../../orchestration/workers/transcripts/worker-output-cursor' -import type { resolvePinnedFederatedServer } from './worker-observation' +} from '../workers/transcripts/worker-output-cursor' +import type { resolvePinnedFederatedServer } from '../../rpc/methods/orchestration/worker/pinned-federated-server' // Old peers expose only terminal reads; retain fences and cursor scope instead of silently degrading transcript cursors. export async function readLegacyFederatedTerminal(args: { diff --git a/src/main/runtime/rpc/methods/orchestration/messaging/ask-remote.ts b/src/main/runtime/orchestration/legacy-remote/ask-remote.ts similarity index 78% rename from src/main/runtime/rpc/methods/orchestration/messaging/ask-remote.ts rename to src/main/runtime/orchestration/legacy-remote/ask-remote.ts index f400a60ff99..b18edd2e418 100644 --- a/src/main/runtime/rpc/methods/orchestration/messaging/ask-remote.ts +++ b/src/main/runtime/orchestration/legacy-remote/ask-remote.ts @@ -1,14 +1,14 @@ import type { z } from 'zod' -import type { OrcaRuntimeService } from '../../../../orca-runtime' -import type { WorkerDispatchState } from '../../../../orchestration/db/orchestration-records' -import { OrchestrationError } from '../../../../orchestration/orchestration-error' -import { clampOrchestrationAskTimeoutMs } from '../../../../../../shared/orchestration/mailbox/orchestration-ask-timeout' -import type { AskParams } from '../../../../../../shared/rpc-contract/orchestration-params' -import { assertWorkerCanReport } from '../../../../orchestration/workers/reports/worker-report-admission' +import type { OrcaRuntimeService } from '../../orca-runtime' +import type { WorkerDispatchState } from '../db/orchestration-records' +import { OrchestrationError } from '../orchestration-error' +import { clampOrchestrationAskTimeoutMs } from '../../../../shared/orchestration/mailbox/orchestration-ask-timeout' +import type { AskParams } from '../../../../shared/rpc-contract/orchestration-params' +import { assertWorkerCanReport } from '../workers/reports/worker-report-admission' import { askedQuestionReceipt, waitForQuestionAnswer -} from '../../../../orchestration/mailbox/questions/question-answer-delivery' +} from '../mailbox/questions/question-answer-delivery' export async function askRemoteRunHome(args: { params: z.infer diff --git a/src/main/runtime/orchestration/db/federation/federated-dispatch-observation-fence.ts b/src/main/runtime/orchestration/legacy-remote/federated-dispatch-observation-fence.ts similarity index 97% rename from src/main/runtime/orchestration/db/federation/federated-dispatch-observation-fence.ts rename to src/main/runtime/orchestration/legacy-remote/federated-dispatch-observation-fence.ts index 4bb532cc0d1..ba73af37928 100644 --- a/src/main/runtime/orchestration/db/federation/federated-dispatch-observation-fence.ts +++ b/src/main/runtime/orchestration/legacy-remote/federated-dispatch-observation-fence.ts @@ -1,9 +1,9 @@ -import type { OrchestrationDb } from '../orchestration-db' +import type { OrchestrationDb } from '../db/orchestration-db' import { beginLifecycleWriteTransaction, commitLifecycleWriteTransaction, rollbackLifecycleWriteTransaction -} from '../lifecycle-transition' +} from '../db/lifecycle-transition' export type FederatedDispatchObservationFence = { dispatch_id: string diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-agent-launch.ts b/src/main/runtime/orchestration/legacy-remote/federated-worker-agent-launch.ts similarity index 86% rename from src/main/runtime/rpc/methods/orchestration/federation/federated-worker-agent-launch.ts rename to src/main/runtime/orchestration/legacy-remote/federated-worker-agent-launch.ts index 060cb204d08..3699d1ade1d 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-agent-launch.ts +++ b/src/main/runtime/orchestration/legacy-remote/federated-worker-agent-launch.ts @@ -1,22 +1,22 @@ -import type { RuntimeTerminalCreate } from '../../../../../../shared/runtime-terminal-create-contract' +import type { RuntimeTerminalCreate } from '../../../../shared/runtime-terminal-create-contract' /** Execute terminalOnly on the receiving host with federation's agent-first worktree/background-terminal factories. The dispatch brief is delivered later. */ -import type { AgentLaunchPreferences } from '../../../../../../shared/agent-session/agent-session-host-authority' -import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' -import { executeAgentLaunch } from '../../../../../agent-launch/agent-launch-executor' -import type { OrcaRuntimeService } from '../../../../orca-runtime' -import type { OrchestrationDb } from '../../../../orchestration/db/orchestration-db' -import { resolveUnattendedSetupDecision } from '../../../../../workspace-hooks/effective-hook-config' -import { WORKER_START_VOCABULARY } from '../structured-workers/orchestration-worker-start-mode' -import type { WorkerSetupReceipt } from '../worker/worker-topology' -import { resolveWorkerWorktreeName } from '../worker/worker-worktree-creation' +import type { AgentLaunchPreferences } from '../../../../shared/agent-session/agent-session-host-authority' +import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' +import { executeAgentLaunch } from '../../../agent-launch/agent-launch-executor' +import type { OrcaRuntimeService } from '../../orca-runtime' +import type { OrchestrationDb } from '../db/orchestration-db' +import { resolveUnattendedSetupDecision } from '../../../workspace-hooks/effective-hook-config' +import { WORKER_START_VOCABULARY } from '../../rpc/methods/orchestration/structured-workers/orchestration-worker-start-mode' +import type { WorkerSetupReceipt } from '../../rpc/methods/orchestration/worker/worker-topology' +import { resolveWorkerWorktreeName } from '../../rpc/methods/orchestration/worker/worker-worktree-creation' import { appendFederationSetupEffect, appendFederationTerminalEffects, type FederationEffect } from './federation-effects' -import type { FederationAttachStartInput } from '../../../../../../shared/rpc-contract/orchestration-federation-start-params' -import type { Worktree } from '../../../../../../shared/worktree/types' +import type { FederationAttachStartInput } from '../../../../shared/rpc-contract/orchestration-federation-start-params' +import type { Worktree } from '../../../../shared/worktree/types' const TERMINAL_ONLY_MESSAGE = 'A federated worker starts a terminal agent only.' diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-release-host.ts b/src/main/runtime/orchestration/legacy-remote/federated-worker-release-host.ts similarity index 90% rename from src/main/runtime/rpc/methods/orchestration/federation/federated-worker-release-host.ts rename to src/main/runtime/orchestration/legacy-remote/federated-worker-release-host.ts index 00b409bcdb7..1739ab48fcd 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-release-host.ts +++ b/src/main/runtime/orchestration/legacy-remote/federated-worker-release-host.ts @@ -1,29 +1,29 @@ -import { describeUnconfirmedAgentStop } from '../../../../../../shared/terminal/pty/lifecycle/pty-liveness-verdict' -import type { RemoteDispatchAttachmentRow } from '../../../../orchestration/db/orchestration-records' +import { describeUnconfirmedAgentStop } from '../../../../shared/terminal/pty/lifecycle/pty-liveness-verdict' +import type { RemoteDispatchAttachmentRow } from '../db/orchestration-records' import type { WorkerTerminalArchiveRow, WorkerTerminalResourceRow, WorkerTerminalRetainedReason -} from '../../../../orchestration/terminal-authority/release/worker-terminal-ownership' +} from '../terminal-authority/release/worker-terminal-ownership' import { captureWorkerOutputArchive, releaseCommitFieldsForCapturedArchive, releaseCommitFieldsForStoredArchive, summarizeWorkerOutputArchive -} from '../../../../orchestration/workers/archives/worker-output-archive' -import type { WorkerTerminalReleaseRuntime } from '../../../../orchestration/terminal-authority/release/worker-terminal-release-runtime' +} from '../workers/archives/worker-output-archive' +import type { WorkerTerminalReleaseRuntime } from '../terminal-authority/release/worker-terminal-release-runtime' import { readRemoteAttachmentArchive } from './remote-attachment-archive-read' -import { WorkerTerminalReleaseSingleFlight } from '../worker/worker-terminal-release-single-flight' -import { yieldAutoReleaseToWorkingAgent } from '../../../../orchestration/terminal-authority/release/worker-terminal-auto-release-working-yield' -import { archiveSummary } from '../worker/worker-terminal-resource-presentation' -import type { WorkerReleaseReceipt } from '../worker/worker-release-completion' -import { releaseUnknownRecovery } from '../worker/worker-release-unknown-recovery' -import { orchestrationTimestampToMs } from '../worker/worker-output' +import { WorkerTerminalReleaseSingleFlight } from '../../rpc/methods/orchestration/worker/worker-terminal-release-single-flight' +import { yieldAutoReleaseToWorkingAgent } from '../terminal-authority/release/worker-terminal-auto-release-working-yield' +import { archiveSummary } from '../../rpc/methods/orchestration/worker/worker-terminal-resource-presentation' +import type { WorkerReleaseReceipt } from '../../rpc/methods/orchestration/worker/worker-release-completion' +import { releaseUnknownRecovery } from '../../rpc/methods/orchestration/worker/worker-release-unknown-recovery' +import { orchestrationTimestampToMs } from '../../rpc/methods/orchestration/worker/worker-output' import type { inspectRemoteAttachment } from './federation-attachment-observation' import { classifyWorkerTerminalCloseError, TRANSIENT_WORKER_RELEASE_RECOVERY -} from '../worker/worker-release-close-error' +} from '../../rpc/methods/orchestration/worker/worker-release-close-error' type RemoteAttachmentReleaseArgs = { runtime: WorkerTerminalReleaseRuntime diff --git a/src/main/runtime/orchestration/db/federated-worker-report-outcome.ts b/src/main/runtime/orchestration/legacy-remote/federated-worker-report-outcome.ts similarity index 87% rename from src/main/runtime/orchestration/db/federated-worker-report-outcome.ts rename to src/main/runtime/orchestration/legacy-remote/federated-worker-report-outcome.ts index 41914694db0..7cf45cafb3e 100644 --- a/src/main/runtime/orchestration/db/federated-worker-report-outcome.ts +++ b/src/main/runtime/orchestration/legacy-remote/federated-worker-report-outcome.ts @@ -1,4 +1,4 @@ -import type { WorkerReportOutcome } from './orchestration-records' +import type { WorkerReportOutcome } from '../db/orchestration-records' export function parseFederatedWorkerReportOutcome( payload: string diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-stop-host.ts b/src/main/runtime/orchestration/legacy-remote/federated-worker-stop-host.ts similarity index 86% rename from src/main/runtime/rpc/methods/orchestration/federation/federated-worker-stop-host.ts rename to src/main/runtime/orchestration/legacy-remote/federated-worker-stop-host.ts index d73f42f565a..5ec5bfe4af0 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federated-worker-stop-host.ts +++ b/src/main/runtime/orchestration/legacy-remote/federated-worker-stop-host.ts @@ -1,7 +1,7 @@ -import type { OrcaRuntimeService } from '../../../../orca-runtime' -import type { WorkerStopReceipt } from '../../../../../../shared/orchestration/workers/orchestration-worker-stop-receipt' -import { archiveWorkerOutputBeforeStop } from '../worker/worker-stop-archive' -import { describeUnconfirmedAgentStop } from '../../../../../../shared/terminal/pty/lifecycle/pty-liveness-verdict' +import type { OrcaRuntimeService } from '../../orca-runtime' +import type { WorkerStopReceipt } from '../../../../shared/orchestration/workers/orchestration-worker-stop-receipt' +import { archiveWorkerOutputBeforeStop } from '../../rpc/methods/orchestration/worker/worker-stop-archive' +import { describeUnconfirmedAgentStop } from '../../../../shared/terminal/pty/lifecycle/pty-liveness-verdict' import { inspectRemoteAttachment } from './federation-attachment-observation' /** Close the exact attached worker this host runs for its home. */ diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federation-attachment-authority.ts b/src/main/runtime/orchestration/legacy-remote/federation-attachment-authority.ts similarity index 85% rename from src/main/runtime/rpc/methods/orchestration/federation/federation-attachment-authority.ts rename to src/main/runtime/orchestration/legacy-remote/federation-attachment-authority.ts index 28448ff5991..a91511e3e03 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federation-attachment-authority.ts +++ b/src/main/runtime/orchestration/legacy-remote/federation-attachment-authority.ts @@ -1,7 +1,7 @@ -import type { OrcaRuntimeService } from '../../../../orca-runtime' -import type { OrchestrationDb } from '../../../../orchestration/db/orchestration-db' +import type { OrcaRuntimeService } from '../../orca-runtime' +import type { OrchestrationDb } from '../db/orchestration-db' import type { FederationEffect } from './federation-effects' -import type { WorkerSetupReceipt } from '../worker/worker-topology' +import type { WorkerSetupReceipt } from '../../rpc/methods/orchestration/worker/worker-topology' export function prepareFederatedAttachmentAuthority(args: { runtime: OrcaRuntimeService diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federation-attachment-observation.ts b/src/main/runtime/orchestration/legacy-remote/federation-attachment-observation.ts similarity index 90% rename from src/main/runtime/rpc/methods/orchestration/federation/federation-attachment-observation.ts rename to src/main/runtime/orchestration/legacy-remote/federation-attachment-observation.ts index cddf8efcfa7..470c9b55df6 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federation-attachment-observation.ts +++ b/src/main/runtime/orchestration/legacy-remote/federation-attachment-observation.ts @@ -1,9 +1,9 @@ -import type { RuntimeTerminalInteractiveWait } from '../../../../../../shared/runtime-terminal-contracts' -import type { WorkerTerminalReleaseRuntime } from '../../../../orchestration/terminal-authority/release/worker-terminal-release-runtime' -import { OrchestrationError } from '../../../../orchestration/orchestration-error' -import { parseWorkerTerminalHostScope } from '../../../../../../shared/orchestration/workers/worker-terminal-host-scope' -import type { RemoteDispatchAttachmentRow } from '../../../../orchestration/db/orchestration-records' -import { orchestrationTimestampToMs } from '../worker/worker-output' +import type { RuntimeTerminalInteractiveWait } from '../../../../shared/runtime-terminal-contracts' +import type { WorkerTerminalReleaseRuntime } from '../terminal-authority/release/worker-terminal-release-runtime' +import { OrchestrationError } from '../orchestration-error' +import { parseWorkerTerminalHostScope } from '../../../../shared/orchestration/workers/worker-terminal-host-scope' +import type { RemoteDispatchAttachmentRow } from '../db/orchestration-records' +import { orchestrationTimestampToMs } from '../../rpc/methods/orchestration/worker/worker-output' export function requireHomeAttachment( runtime: WorkerTerminalReleaseRuntime, diff --git a/src/main/runtime/orchestration/federation/relay/federation-control-message.ts b/src/main/runtime/orchestration/legacy-remote/federation-control-message.ts similarity index 93% rename from src/main/runtime/orchestration/federation/relay/federation-control-message.ts rename to src/main/runtime/orchestration/legacy-remote/federation-control-message.ts index 204dafba2fa..62776c88775 100644 --- a/src/main/runtime/orchestration/federation/relay/federation-control-message.ts +++ b/src/main/runtime/orchestration/legacy-remote/federation-control-message.ts @@ -1,10 +1,6 @@ -import { - MESSAGE_TYPES, - type MessagePriority, - type MessageType -} from '../../db/orchestration-records' -import type { OrchestrationDb } from '../../db/orchestration-db' -import { OrchestrationError } from '../../orchestration-error' +import { MESSAGE_TYPES, type MessagePriority, type MessageType } from '../db/orchestration-records' +import type { OrchestrationDb } from '../db/orchestration-db' +import { OrchestrationError } from '../orchestration-error' const MESSAGE_TYPE_SET = new Set(MESSAGE_TYPES) diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federation-control.ts b/src/main/runtime/orchestration/legacy-remote/federation-control.ts similarity index 92% rename from src/main/runtime/rpc/methods/orchestration/federation/federation-control.ts rename to src/main/runtime/orchestration/legacy-remote/federation-control.ts index aa3430ec5bf..d1173a412e3 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federation-control.ts +++ b/src/main/runtime/orchestration/legacy-remote/federation-control.ts @@ -1,11 +1,11 @@ -import { OrchestrationError } from '../../../../orchestration/orchestration-error' -import type { RemoteDispatchAttachmentRow } from '../../../../orchestration/db/orchestration-records' -import { defineMethod } from '../../../core' -import { isUserKeptWorkerTerminalOwner } from '../../../../orchestration/db/worker-terminal/worker-terminal-user-keep' -import { mapWithConcurrency } from '../../../../../../shared/map-with-concurrency' -import { readExactWorkerOutput } from '../worker/worker-output' -import { exposeWorkerRetainReceipt } from '../worker/worker-terminal-resource-presentation' -import { withStoppedHelpers } from '../worker/worker-stop' +import { OrchestrationError } from '../orchestration-error' +import type { RemoteDispatchAttachmentRow } from '../db/orchestration-records' +import { defineMethod } from '../../rpc/core' +import { isUserKeptWorkerTerminalOwner } from '../db/worker-terminal/worker-terminal-user-keep' +import { mapWithConcurrency } from '../../../../shared/map-with-concurrency' +import { readExactWorkerOutput } from '../../rpc/methods/orchestration/worker/worker-output' +import { exposeWorkerRetainReceipt } from '../../rpc/methods/orchestration/worker/worker-terminal-resource-presentation' +import { withStoppedHelpers } from '../../rpc/methods/orchestration/worker/worker-stop' import { stopRemoteAttachment } from './federated-worker-stop-host' import { inspectRemoteAttachment, @@ -19,7 +19,7 @@ import { FederationFleetSnapshotParams, FederationOutputReadParams, FederationReadParams -} from '../../../../../../shared/rpc-contract/orchestration-federation-control-params' +} from '../../../../shared/rpc-contract/orchestration-federation-control-params' export const ORCHESTRATION_FEDERATION_CONTROL_METHODS = [ defineMethod({ diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federation-effects.ts b/src/main/runtime/orchestration/legacy-remote/federation-effects.ts similarity index 100% rename from src/main/runtime/rpc/methods/orchestration/federation/federation-effects.ts rename to src/main/runtime/orchestration/legacy-remote/federation-effects.ts diff --git a/src/main/runtime/orchestration/federation/federation-lifecycle-settlement.ts b/src/main/runtime/orchestration/legacy-remote/federation-lifecycle-settlement.ts similarity index 100% rename from src/main/runtime/orchestration/federation/federation-lifecycle-settlement.ts rename to src/main/runtime/orchestration/legacy-remote/federation-lifecycle-settlement.ts diff --git a/src/main/runtime/orchestration/db/federation/federation-relay-enqueue.ts b/src/main/runtime/orchestration/legacy-remote/federation-relay-enqueue.ts similarity index 95% rename from src/main/runtime/orchestration/db/federation/federation-relay-enqueue.ts rename to src/main/runtime/orchestration/legacy-remote/federation-relay-enqueue.ts index bee9edce5bc..e8cd0503d7c 100644 --- a/src/main/runtime/orchestration/db/federation/federation-relay-enqueue.ts +++ b/src/main/runtime/orchestration/legacy-remote/federation-relay-enqueue.ts @@ -1,16 +1,16 @@ -import { readAnswerSenderRelayReport } from '../../mailbox/senders/answer-sender-relay-report' +import { readAnswerSenderRelayReport } from '../mailbox/senders/answer-sender-relay-report' import type { WorkerReportOutcome, FederationRelayDirection, FederationRelayItemRow -} from '../orchestration-records' -import { OrchestrationError } from '../../orchestration-error' -import { generateId } from '../generated-id' -import type { OrchestrationDb } from '../orchestration-db' +} from '../db/orchestration-records' +import { OrchestrationError } from '../orchestration-error' +import { generateId } from '../db/generated-id' +import type { OrchestrationDb } from '../db/orchestration-db' import { isWorkerStateIn, SETTLEABLE_WORKER_STATES -} from '../../workers/reports/worker-report-admission' +} from '../workers/reports/worker-report-admission' export function enqueueFederationRelay( this: OrchestrationDb, diff --git a/src/main/runtime/orchestration/db/federation/federation-relay-item.ts b/src/main/runtime/orchestration/legacy-remote/federation-relay-item.ts similarity index 90% rename from src/main/runtime/orchestration/db/federation/federation-relay-item.ts rename to src/main/runtime/orchestration/legacy-remote/federation-relay-item.ts index cf731c719cb..3079962739d 100644 --- a/src/main/runtime/orchestration/db/federation/federation-relay-item.ts +++ b/src/main/runtime/orchestration/legacy-remote/federation-relay-item.ts @@ -2,13 +2,13 @@ import type { WorkerReportOutcome, FederationRelayDirection, FederationRelayItemRow -} from '../orchestration-records' -import { OrchestrationError } from '../../orchestration-error' -import type { OrchestrationDb } from '../orchestration-db' +} from '../db/orchestration-records' +import { OrchestrationError } from '../orchestration-error' +import type { OrchestrationDb } from '../db/orchestration-db' import { isWorkerStateIn, SETTLEABLE_WORKER_STATES -} from '../../workers/reports/worker-report-admission' +} from '../workers/reports/worker-report-admission' export function getFederationRelayItem( this: OrchestrationDb, diff --git a/src/main/runtime/orchestration/legacy-remote/federation-relay-report-acknowledgment.ts b/src/main/runtime/orchestration/legacy-remote/federation-relay-report-acknowledgment.ts new file mode 100644 index 00000000000..a737d7c8f26 --- /dev/null +++ b/src/main/runtime/orchestration/legacy-remote/federation-relay-report-acknowledgment.ts @@ -0,0 +1,139 @@ +import type { + WorkerReportOutcome, + FederationRelayDirection, + FederationRelayItemRow +} from '../db/orchestration-records' +import { OrchestrationError } from '../orchestration-error' +import type { OrchestrationDb } from '../db/orchestration-db' +import { ORCHESTRATION_FEDERATION_LIFECYCLE_SETTLEMENT_PROTOCOL_VERSION } from '../../../../shared/orchestration/orchestration-runtime-capabilities' +import { parseFederatedWorkerReportOutcome } from './federated-worker-report-outcome' + +export function listFederationRelay( + this: OrchestrationDb, + params: { + dispatchId: string + direction: FederationRelayDirection + afterSequence: number + limit?: number + } +): FederationRelayItemRow[] { + return this.db + .prepare( + `SELECT * FROM federation_relay_items + WHERE dispatch_id = ? AND direction = ? AND sequence > ? + ORDER BY sequence LIMIT ?` + ) + .all( + params.dispatchId, + params.direction, + params.afterSequence, + Math.min(Math.max(params.limit ?? 50, 1), 50) + ) as FederationRelayItemRow[] +} + +/** A worker_done queued for the Run home that it has not acknowledged. */ +export function hasPendingFederatedWorkerReport( + this: OrchestrationDb, + dispatchId: string +): boolean { + return ( + this.db + .prepare( + `SELECT 1 FROM federation_relay_items + WHERE dispatch_id = ? AND direction = 'to_home' AND kind = 'worker_done' + AND acked_at IS NULL LIMIT 1` + ) + .get(dispatchId) !== undefined + ) +} + +export type FederationRelayAcknowledgment = { + dispatchId: string + direction: FederationRelayDirection + throughSequence: number + settleRemoteReports?: { sequence: number; outcome?: WorkerReportOutcome }[] + // Only the home's acceptance proves settlement; arm after it, never at queue time. + armAutoRelease?: boolean +} + +/** Runs inside acknowledgeFederationRelay's transaction, before the items are marked acked. */ +export function settleRemoteReportsInRelayAcknowledgment( + this: OrchestrationDb, + params: FederationRelayAcknowledgment +): void { + const settledReports = params.settleRemoteReports ?? [] + for (const settledReport of settledReports) { + const report = this.getFederationRelayItem( + params.dispatchId, + params.direction, + settledReport.sequence + ) + if ( + params.direction !== 'to_home' || + settledReport.sequence > params.throughSequence || + report?.kind !== 'worker_done' || + (settledReport.outcome !== undefined && + parseFederatedWorkerReportOutcome(report.payload) !== settledReport.outcome) + ) { + throw new OrchestrationError( + 'request_mismatch', + `Federation acknowledgment for ${params.dispatchId} does not match its queued worker_done.` + ) + } + } + const attachment = this.getRemoteDispatchAttachment(params.dispatchId) + if ( + params.direction === 'to_home' && + attachment !== undefined && + attachment.protocol_version >= ORCHESTRATION_FEDERATION_LIFECYCLE_SETTLEMENT_PROTOCOL_VERSION + ) { + const acknowledgedReports = this.db + .prepare( + `SELECT sequence FROM federation_relay_items + WHERE dispatch_id = ? AND direction = 'to_home' AND kind = 'worker_done' + AND acked_at IS NULL AND sequence <= ?` + ) + .all(params.dispatchId, params.throughSequence) as { sequence: number }[] + const settledSequences = new Set(settledReports.map((report) => report.sequence)) + if (acknowledgedReports.some((report) => !settledSequences.has(report.sequence))) { + throw new OrchestrationError( + 'request_mismatch', + `Federation acknowledgment for ${params.dispatchId} omits a worker_done settlement.` + ) + } + } + const terminalOutcomes = new Set( + settledReports.flatMap((report) => (report.outcome ? [report.outcome] : [])) + ) + if (terminalOutcomes.size > 1) { + throw new OrchestrationError( + 'request_mismatch', + `Federation acknowledgment for ${params.dispatchId} contains conflicting settlements.` + ) + } + const terminalOutcome = settledReports.find((report) => report.outcome)?.outcome + if (terminalOutcome) { + this.settleRemoteAttachmentInRelayTransaction( + params.dispatchId, + terminalOutcome, + 'worker_report_settled' + ) + if (params.armAutoRelease) { + this.armWorkerTerminalAutoReleaseStatement(params.dispatchId) + } + } +} + +export type FederationRelayReportAcknowledgmentMethods = { + listFederationRelay: typeof listFederationRelay + hasPendingFederatedWorkerReport: typeof hasPendingFederatedWorkerReport + settleRemoteReportsInRelayAcknowledgment: typeof settleRemoteReportsInRelayAcknowledgment +} + +export function attachFederationRelayReportAcknowledgment(ctor: { prototype: object }): void { + Object.assign(ctor.prototype, { + listFederationRelay, + hasPendingFederatedWorkerReport, + settleRemoteReportsInRelayAcknowledgment + }) +} diff --git a/src/main/runtime/orchestration/federation/relay/federation-relay-wire.ts b/src/main/runtime/orchestration/legacy-remote/federation-relay-wire.ts similarity index 69% rename from src/main/runtime/orchestration/federation/relay/federation-relay-wire.ts rename to src/main/runtime/orchestration/legacy-remote/federation-relay-wire.ts index c4ce10c5bdb..a480a1ce455 100644 --- a/src/main/runtime/orchestration/federation/relay/federation-relay-wire.ts +++ b/src/main/runtime/orchestration/legacy-remote/federation-relay-wire.ts @@ -1,5 +1,5 @@ -import type { FederationRelayItemRow } from '../../db/orchestration-records' -import { readAnswerSenderRelayReport } from '../../mailbox/senders/answer-sender-relay-report' +import type { FederationRelayItemRow } from '../db/orchestration-records' +import { readAnswerSenderRelayReport } from '../mailbox/senders/answer-sender-relay-report' export function federationRelayWireItem(row: FederationRelayItemRow) { const answerSenderReport = readAnswerSenderRelayReport(row.answer_sender_report) diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federation-relay.ts b/src/main/runtime/orchestration/legacy-remote/federation-relay.ts similarity index 92% rename from src/main/runtime/rpc/methods/orchestration/federation/federation-relay.ts rename to src/main/runtime/orchestration/legacy-remote/federation-relay.ts index 9d64727eb92..2c75cbdfd71 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federation-relay.ts +++ b/src/main/runtime/orchestration/legacy-remote/federation-relay.ts @@ -1,19 +1,19 @@ -import { federationRelayWireItem } from '../../../../orchestration/federation/relay/federation-relay-wire' -import { ORCHESTRATION_FEDERATION_CONTROL_MAIL_PROTOCOL_VERSION } from '../../../../../../shared/orchestration/orchestration-runtime-capabilities' -import { deliverQuestionAnswer } from '../../../../orchestration/mailbox/questions/question-answer-delivery' -import { importFederatedControlMessage } from '../../../../orchestration/federation/relay/federation-control-message' -import { OrchestrationError } from '../../../../orchestration/orchestration-error' +import { federationRelayWireItem } from './federation-relay-wire' +import { ORCHESTRATION_FEDERATION_CONTROL_MAIL_PROTOCOL_VERSION } from '../../../../shared/orchestration/orchestration-runtime-capabilities' +import { deliverQuestionAnswer } from '../mailbox/questions/question-answer-delivery' +import { importFederatedControlMessage } from './federation-control-message' +import { OrchestrationError } from '../orchestration-error' import { areFederatedLifecycleSettlementsEqual, publishFederatedLifecycleSettlement, type FederatedLifecycleSettlement -} from '../../../../orchestration/federation/federation-lifecycle-settlement' -import { defineMethod, type RpcMethod } from '../../../core' +} from './federation-lifecycle-settlement' +import { defineMethod, type RpcMethod } from '../../rpc/core' import { FederationAckParams, FederationImportParams, FederationPullParams -} from '../../../../../../shared/rpc-contract/orchestration-federation-relay-params' +} from '../../../../shared/rpc-contract/orchestration-federation-relay-params' export const ORCHESTRATION_FEDERATION_RELAY_METHODS = [ defineMethod({ diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federation-setup.ts b/src/main/runtime/orchestration/legacy-remote/federation-setup.ts similarity index 92% rename from src/main/runtime/rpc/methods/orchestration/federation/federation-setup.ts rename to src/main/runtime/orchestration/legacy-remote/federation-setup.ts index b4dc2c5e86b..ddf87653e11 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federation-setup.ts +++ b/src/main/runtime/orchestration/legacy-remote/federation-setup.ts @@ -1,6 +1,9 @@ -import type { OrcaRuntimeService } from '../../../../orca-runtime' -import type { OrchestrationDb } from '../../../../orchestration/db/orchestration-db' -import { applyWaitForSetupOutcome, type WorkerSetupReceipt } from '../worker/worker-topology' +import type { OrcaRuntimeService } from '../../orca-runtime' +import type { OrchestrationDb } from '../db/orchestration-db' +import { + applyWaitForSetupOutcome, + type WorkerSetupReceipt +} from '../../rpc/methods/orchestration/worker/worker-topology' import { isFederationResidualEffect, type FederationEffect } from './federation-effects' type FederationSetupStageArgs = { diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federation-start-receipt.ts b/src/main/runtime/orchestration/legacy-remote/federation-start-receipt.ts similarity index 73% rename from src/main/runtime/rpc/methods/orchestration/federation/federation-start-receipt.ts rename to src/main/runtime/orchestration/legacy-remote/federation-start-receipt.ts index 096314727db..c0c00eef44e 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federation-start-receipt.ts +++ b/src/main/runtime/orchestration/legacy-remote/federation-start-receipt.ts @@ -1,8 +1,8 @@ -import { formatTerminalStartFailure } from '../../../../../../shared/terminal/pty/lifecycle/terminal-start-failure' -import type { OrchestrationDb } from '../../../../orchestration/db/orchestration-db' +import { formatTerminalStartFailure } from '../../../../shared/terminal/pty/lifecycle/terminal-start-failure' +import type { OrchestrationDb } from '../db/orchestration-db' import { isFederationEffectUnknown } from './federation-effects' -import type { WorkerSetupReceipt } from '../worker/worker-topology' -import type { OrchestrationWorkerLaunchReceipt } from '../worker/worker-launch-preferences' +import type { WorkerSetupReceipt } from '../../rpc/methods/orchestration/worker/worker-topology' +import type { OrchestrationWorkerLaunchReceipt } from '../../rpc/methods/orchestration/worker/worker-launch-preferences' export function failFederatedAttachmentWithReceipt(args: { db: OrchestrationDb diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federation.ts b/src/main/runtime/orchestration/legacy-remote/federation.ts similarity index 87% rename from src/main/runtime/rpc/methods/orchestration/federation/federation.ts rename to src/main/runtime/orchestration/legacy-remote/federation.ts index 995d88ddb8b..2359af094f3 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federation.ts +++ b/src/main/runtime/orchestration/legacy-remote/federation.ts @@ -1,32 +1,32 @@ -import type { RuntimeTerminalCreate } from '../../../../../../shared/runtime-terminal-create-contract' -import { waitForWorkerAgentReady } from '../../../../terminal/wait/launched-agent-composer-readiness' -import { describeTerminalWaitBlockedReason } from '../../../../../../shared/terminal/runtime-policy/terminal-wait-blocked-reason-legacy-alias' -import { buildDispatchPreamble } from '../../../../orchestration/workers/launch/worker-dispatch-preamble' -import { sendAgentTurn } from '../../../../orchestration/turn-delivery/send-agent-turn' -import { createWorkerBriefWriteGuard } from '../../../../terminal/wait/launched-agent-write-guard' -import { OrchestrationError } from '../../../../orchestration/orchestration-error' -import { defineMethod } from '../../../core' -import { assertOrchestrationWorktreeCreationSupported } from '../worker/folder-worktree-placement' +import type { RuntimeTerminalCreate } from '../../../../shared/runtime-terminal-create-contract' +import { waitForWorkerAgentReady } from '../../terminal/wait/launched-agent-composer-readiness' +import { describeTerminalWaitBlockedReason } from '../../../../shared/terminal/runtime-policy/terminal-wait-blocked-reason-legacy-alias' +import { buildDispatchPreamble } from '../workers/launch/worker-dispatch-preamble' +import { sendAgentTurn } from '../turn-delivery/send-agent-turn' +import { createWorkerBriefWriteGuard } from '../../terminal/wait/launched-agent-write-guard' +import { OrchestrationError } from '../orchestration-error' +import { defineMethod } from '../../rpc/core' +import { assertOrchestrationWorktreeCreationSupported } from '../../rpc/methods/orchestration/worker/folder-worktree-placement' import type { FederationEffect } from './federation-effects' import { launchFederatedWorkerAgent } from './federated-worker-agent-launch' -import type { WorkerSetupReceipt } from '../worker/worker-topology' +import type { WorkerSetupReceipt } from '../../rpc/methods/orchestration/worker/worker-topology' import { monitorFederatedSetup, persistFederatedReadinessStage, persistFederatedSetupSpawnFailure, persistFederatedSetupWaitOutcome } from './federation-setup' -import { FederationAttachStartParams } from '../../../../../../shared/rpc-contract/orchestration-federation-start-params' +import { FederationAttachStartParams } from '../../../../shared/rpc-contract/orchestration-federation-start-params' import { failFederatedAttachmentWithReceipt } from './federation-start-receipt' -import { prepareFederationWorkerLaunchOnHost } from '../worker/worker-opencode-model-preflight' +import { prepareFederationWorkerLaunchOnHost } from '../../rpc/methods/orchestration/worker/worker-opencode-model-preflight' import { isWorkerStartTimeoutWithinTimerLimit, resolveWorkerStartReadinessTimeoutMs -} from '../../../../../../shared/orchestration/orchestration-timing-budgets' -import { assertWorkerStartTaskSpecWithinPromptBudget } from '../worker/worker-start-prompt-budget' +} from '../../../../shared/orchestration/orchestration-timing-budgets' +import { assertWorkerStartTaskSpecWithinPromptBudget } from '../../rpc/methods/orchestration/worker/worker-start-prompt-budget' import { prepareFederatedAttachmentAuthority } from './federation-attachment-authority' -import { resolveRpcWorkspaceCreatorProvenance } from '../../../workspace-creator-context' -import { claimTerminalForRemoteAttach } from '../../../../orchestration/db/worker-dispatch/worker-terminal-claim' +import { resolveRpcWorkspaceCreatorProvenance } from '../../rpc/workspace-creator-context' +import { claimTerminalForRemoteAttach } from '../db/worker-dispatch/worker-terminal-claim' export const ORCHESTRATION_FEDERATION_ATTACH_METHODS = [ defineMethod({ diff --git a/src/main/runtime/orchestration/legacy-remote/legacy-remote-db-methods.ts b/src/main/runtime/orchestration/legacy-remote/legacy-remote-db-methods.ts new file mode 100644 index 00000000000..2eb2092a3df --- /dev/null +++ b/src/main/runtime/orchestration/legacy-remote/legacy-remote-db-methods.ts @@ -0,0 +1,43 @@ +// The DB layer's only way into this folder; keep it free of rpc and runtime imports. +import { attachFederatedDispatchObservationFence } from './federated-dispatch-observation-fence' +import type { FederatedDispatchObservationFenceMethods } from './federated-dispatch-observation-fence' +import { attachFederationRelayEnqueue } from './federation-relay-enqueue' +import type { FederationRelayEnqueueMethods } from './federation-relay-enqueue' +import { attachFederationRelayItem } from './federation-relay-item' +import type { FederationRelayItemMethods } from './federation-relay-item' +import { attachFederationRelayReportAcknowledgment } from './federation-relay-report-acknowledgment' +import type { FederationRelayReportAcknowledgmentMethods } from './federation-relay-report-acknowledgment' +import { attachRemoteDispatchAttachmentAuthority } from './remote-dispatch-attachment-authority' +import type { RemoteDispatchAttachmentAuthorityMethods } from './remote-dispatch-attachment-authority' +import { attachRemoteDispatchAttachmentCreate } from './remote-dispatch-attachment-create' +import type { RemoteDispatchAttachmentCreateMethods } from './remote-dispatch-attachment-create' +import { attachRemoteDispatchAttachmentRelease } from './remote-dispatch-attachment-release' +import type { RemoteDispatchAttachmentReleaseMethods } from './remote-dispatch-attachment-release' +import { attachRemoteDispatchAttachmentStop } from './remote-dispatch-attachment-stop' +import type { RemoteDispatchAttachmentStopMethods } from './remote-dispatch-attachment-stop' +import { attachRemoteQuestionStore } from './remote-question-store' +import type { RemoteQuestionStoreMethods } from './remote-question-store' + +export type { FederationRelayAcknowledgment } from './federation-relay-report-acknowledgment' + +export type LegacyRemoteDbMethods = FederatedDispatchObservationFenceMethods & + RemoteDispatchAttachmentCreateMethods & + RemoteDispatchAttachmentAuthorityMethods & + RemoteDispatchAttachmentReleaseMethods & + RemoteDispatchAttachmentStopMethods & + FederationRelayEnqueueMethods & + RemoteQuestionStoreMethods & + FederationRelayItemMethods & + FederationRelayReportAcknowledgmentMethods + +export function attachLegacyRemoteDbMethods(ctor: { prototype: object }): void { + attachFederatedDispatchObservationFence(ctor) + attachRemoteDispatchAttachmentCreate(ctor) + attachRemoteDispatchAttachmentAuthority(ctor) + attachRemoteDispatchAttachmentRelease(ctor) + attachRemoteDispatchAttachmentStop(ctor) + attachFederationRelayEnqueue(ctor) + attachRemoteQuestionStore(ctor) + attachFederationRelayItem(ctor) + attachFederationRelayReportAcknowledgment(ctor) +} diff --git a/src/main/runtime/orchestration/legacy-remote/legacy-remote.ts b/src/main/runtime/orchestration/legacy-remote/legacy-remote.ts new file mode 100644 index 00000000000..30084b63c4a --- /dev/null +++ b/src/main/runtime/orchestration/legacy-remote/legacy-remote.ts @@ -0,0 +1,14 @@ +// Worker-server half of today's remote attachments (a paired Orca drives a worker here). +// Frozen: bug fixes only. Code outside this folder imports it only through this module, +// except the DB layer, which uses legacy-remote-db-methods.ts. +/** The `orchestration.federation*` methods a paired Run home calls on this server. */ +export { ORCHESTRATION_FEDERATION_ATTACH_METHODS } from './federation' +export { ORCHESTRATION_FEDERATION_CONTROL_METHODS } from './federation-control' +export { ORCHESTRATION_FEDERATION_RELAY_METHODS } from './federation-relay' + +export { askRemoteRunHome } from './ask-remote' +export { releaseRemoteAttachment } from './federated-worker-release-host' +export { inspectRemoteAttachment } from './federation-attachment-observation' +export { federationRelayWireItem } from './federation-relay-wire' +export { replyToRemoteRunHome } from './reply-remote' +export { sendRemoteMessage } from './send-remote' diff --git a/src/main/runtime/rpc/methods/orchestration/federation/remote-attachment-archive-read.ts b/src/main/runtime/orchestration/legacy-remote/remote-attachment-archive-read.ts similarity index 75% rename from src/main/runtime/rpc/methods/orchestration/federation/remote-attachment-archive-read.ts rename to src/main/runtime/orchestration/legacy-remote/remote-attachment-archive-read.ts index 806c101f41c..f49421c3a87 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/remote-attachment-archive-read.ts +++ b/src/main/runtime/orchestration/legacy-remote/remote-attachment-archive-read.ts @@ -1,6 +1,6 @@ -import type { RemoteDispatchAttachmentRow } from '../../../../orchestration/db/orchestration-records' -import type { WorkerTerminalReleaseRuntime } from '../../../../orchestration/terminal-authority/release/worker-terminal-release-runtime' -import { readArchivedWorkerOutput } from '../worker/worker-archive-read' +import type { RemoteDispatchAttachmentRow } from '../db/orchestration-records' +import type { WorkerTerminalReleaseRuntime } from '../terminal-authority/release/worker-terminal-release-runtime' +import { readArchivedWorkerOutput } from '../../rpc/methods/orchestration/worker/worker-archive-read' export async function readRemoteAttachmentArchive(args: { runtime: WorkerTerminalReleaseRuntime diff --git a/src/main/runtime/orchestration/db/federation/remote-dispatch-attachment-authority.ts b/src/main/runtime/orchestration/legacy-remote/remote-dispatch-attachment-authority.ts similarity index 96% rename from src/main/runtime/orchestration/db/federation/remote-dispatch-attachment-authority.ts rename to src/main/runtime/orchestration/legacy-remote/remote-dispatch-attachment-authority.ts index 93bc2e6f86f..8fd661a579f 100644 --- a/src/main/runtime/orchestration/db/federation/remote-dispatch-attachment-authority.ts +++ b/src/main/runtime/orchestration/legacy-remote/remote-dispatch-attachment-authority.ts @@ -1,7 +1,7 @@ -import type { RemoteDispatchAttachmentRow } from '../orchestration-records' -import { OrchestrationError } from '../../orchestration-error' -import { isEquivalentPaneKey } from '../pane-key-match' -import type { OrchestrationDb } from '../orchestration-db' +import type { RemoteDispatchAttachmentRow } from '../db/orchestration-records' +import { OrchestrationError } from '../orchestration-error' +import { isEquivalentPaneKey } from '../db/pane-key-match' +import type { OrchestrationDb } from '../db/orchestration-db' export function prepareRemoteAttachmentAuthority( this: OrchestrationDb, diff --git a/src/main/runtime/orchestration/db/federation/remote-dispatch-attachment-create.ts b/src/main/runtime/orchestration/legacy-remote/remote-dispatch-attachment-create.ts similarity index 93% rename from src/main/runtime/orchestration/db/federation/remote-dispatch-attachment-create.ts rename to src/main/runtime/orchestration/legacy-remote/remote-dispatch-attachment-create.ts index c8c7a5a3ef6..4ba74d68966 100644 --- a/src/main/runtime/orchestration/db/federation/remote-dispatch-attachment-create.ts +++ b/src/main/runtime/orchestration/legacy-remote/remote-dispatch-attachment-create.ts @@ -1,10 +1,10 @@ -import type { WorkerDispatchState, RemoteDispatchAttachmentRow } from '../orchestration-records' -import { OrchestrationError } from '../../orchestration-error' -import { ensureMutationReceiptCapacity } from '../mutation-receipts/mutation-receipt-capacity' -import type { OrchestrationDb } from '../orchestration-db' -import { federatedStubHomeRunId } from '../contract-constants' -import { insertRemoteDispatchAttachmentRow } from '../dispatch-row-writer' -import { REMOTE_DISPATCH_ATTACHMENT_COLUMN_LIST } from '../row-column-lists' +import type { WorkerDispatchState, RemoteDispatchAttachmentRow } from '../db/orchestration-records' +import { OrchestrationError } from '../orchestration-error' +import { ensureMutationReceiptCapacity } from '../db/mutation-receipts/mutation-receipt-capacity' +import type { OrchestrationDb } from '../db/orchestration-db' +import { federatedStubHomeRunId } from '../db/contract-constants' +import { insertRemoteDispatchAttachmentRow } from '../db/dispatch-row-writer' +import { REMOTE_DISPATCH_ATTACHMENT_COLUMN_LIST } from '../db/row-column-lists' export function createRemoteDispatchAttachment( this: OrchestrationDb, diff --git a/src/main/runtime/orchestration/db/federation/remote-dispatch-attachment-release.ts b/src/main/runtime/orchestration/legacy-remote/remote-dispatch-attachment-release.ts similarity index 95% rename from src/main/runtime/orchestration/db/federation/remote-dispatch-attachment-release.ts rename to src/main/runtime/orchestration/legacy-remote/remote-dispatch-attachment-release.ts index d7e844a0336..829abe1736e 100644 --- a/src/main/runtime/orchestration/db/federation/remote-dispatch-attachment-release.ts +++ b/src/main/runtime/orchestration/legacy-remote/remote-dispatch-attachment-release.ts @@ -4,9 +4,9 @@ import { WORKER_TERMINAL_RELEASABLE_ROW_SQL, type WorkerTerminalResourceRow, type WorkerTerminalRetainedReason -} from '../../terminal-authority/release/worker-terminal-ownership' -import { OrchestrationError } from '../../orchestration-error' -import type { OrchestrationDb } from '../orchestration-db' +} from '../terminal-authority/release/worker-terminal-ownership' +import { OrchestrationError } from '../orchestration-error' +import type { OrchestrationDb } from '../db/orchestration-db' export function requestRemoteAttachmentTerminalRelease( this: OrchestrationDb, diff --git a/src/main/runtime/orchestration/db/federation/remote-dispatch-attachment-stop.ts b/src/main/runtime/orchestration/legacy-remote/remote-dispatch-attachment-stop.ts similarity index 87% rename from src/main/runtime/orchestration/db/federation/remote-dispatch-attachment-stop.ts rename to src/main/runtime/orchestration/legacy-remote/remote-dispatch-attachment-stop.ts index fd613bd45d4..cfd5f241deb 100644 --- a/src/main/runtime/orchestration/db/federation/remote-dispatch-attachment-stop.ts +++ b/src/main/runtime/orchestration/legacy-remote/remote-dispatch-attachment-stop.ts @@ -1,11 +1,14 @@ -import { parsePaneKey } from '../../../../../shared/workspace-layout/stable-pane-id' -import type { RemoteDispatchAttachmentRow } from '../orchestration-records' -import { OrchestrationError } from '../../orchestration-error' -import { paneKeyMatchSuffix, REMOTE_ATTACHMENT_PANE_KEY_MATCH_SUFFIX_SQL } from '../pane-key-match' -import type { OrchestrationDb } from '../orchestration-db' -import { potentiallyLiveRemoteAttachmentSql } from './remote-attachment-liveness' -import { REMOTE_DISPATCH_ATTACHMENT_COLUMN_LIST } from '../row-column-lists' -import { refuseStopWhileKeptOpen } from '../worker-terminal/worker-terminal-user-keep' +import { parsePaneKey } from '../../../../shared/workspace-layout/stable-pane-id' +import type { RemoteDispatchAttachmentRow } from '../db/orchestration-records' +import { OrchestrationError } from '../orchestration-error' +import { + paneKeyMatchSuffix, + REMOTE_ATTACHMENT_PANE_KEY_MATCH_SUFFIX_SQL +} from '../db/pane-key-match' +import type { OrchestrationDb } from '../db/orchestration-db' +import { potentiallyLiveRemoteAttachmentSql } from '../db/federation/remote-attachment-liveness' +import { REMOTE_DISPATCH_ATTACHMENT_COLUMN_LIST } from '../db/row-column-lists' +import { refuseStopWhileKeptOpen } from '../db/worker-terminal/worker-terminal-user-keep' export function beginRemoteAttachmentStop( this: OrchestrationDb, diff --git a/src/main/runtime/orchestration/db/federation/remote-question-store.ts b/src/main/runtime/orchestration/legacy-remote/remote-question-store.ts similarity index 96% rename from src/main/runtime/orchestration/db/federation/remote-question-store.ts rename to src/main/runtime/orchestration/legacy-remote/remote-question-store.ts index 6b94a89e88e..d3904c1382c 100644 --- a/src/main/runtime/orchestration/db/federation/remote-question-store.ts +++ b/src/main/runtime/orchestration/legacy-remote/remote-question-store.ts @@ -1,6 +1,6 @@ -import { importedAnswerSenderSnapshot } from '../../mailbox/senders/answer-sender-relay-report' -import { OrchestrationError } from '../../orchestration-error' -import type { OrchestrationDb } from '../orchestration-db' +import { importedAnswerSenderSnapshot } from '../mailbox/senders/answer-sender-relay-report' +import { OrchestrationError } from '../orchestration-error' +import type { OrchestrationDb } from '../db/orchestration-db' export function getRemoteQuestion( this: OrchestrationDb, diff --git a/src/main/runtime/rpc/methods/orchestration/messaging/reply-remote.ts b/src/main/runtime/orchestration/legacy-remote/reply-remote.ts similarity index 84% rename from src/main/runtime/rpc/methods/orchestration/messaging/reply-remote.ts rename to src/main/runtime/orchestration/legacy-remote/reply-remote.ts index 3c579ecd6f5..64de965a635 100644 --- a/src/main/runtime/rpc/methods/orchestration/messaging/reply-remote.ts +++ b/src/main/runtime/orchestration/legacy-remote/reply-remote.ts @@ -1,7 +1,7 @@ -import type { OrchestrationDb } from '../../../../orchestration/db/orchestration-db' -import type { MessageRow } from '../../../../orchestration/db/orchestration-records' -import type { OrcaRuntimeService } from '../../../../orca-runtime' -import { remoteRunHomeUnreachable } from '../routing' +import type { OrchestrationDb } from '../db/orchestration-db' +import type { MessageRow } from '../db/orchestration-records' +import type { OrcaRuntimeService } from '../../orca-runtime' +import { remoteRunHomeUnreachable } from '../../rpc/methods/orchestration/routing' import { sendRemoteMessage } from './send-remote' /** Reply to mirrored remote-Run mail only at its home, through this pane's own Dispatch link. */ diff --git a/src/main/runtime/rpc/methods/orchestration/messaging/send-remote.ts b/src/main/runtime/orchestration/legacy-remote/send-remote.ts similarity index 77% rename from src/main/runtime/rpc/methods/orchestration/messaging/send-remote.ts rename to src/main/runtime/orchestration/legacy-remote/send-remote.ts index 5b3c961fa88..7faa347787a 100644 --- a/src/main/runtime/rpc/methods/orchestration/messaging/send-remote.ts +++ b/src/main/runtime/orchestration/legacy-remote/send-remote.ts @@ -1,20 +1,17 @@ -import type { - MessageType, - WorkerDispatchState -} from '../../../../orchestration/db/orchestration-records' -import type { OrchestrationDb } from '../../../../orchestration/db/orchestration-db' +import type { MessageType, WorkerDispatchState } from '../db/orchestration-records' +import type { OrchestrationDb } from '../db/orchestration-db' -import type { OrcaRuntimeService } from '../../../../orca-runtime' -import { OrchestrationError } from '../../../../orchestration/orchestration-error' -import { waitForFederatedLifecycleSettlement } from '../../../../orchestration/federation/federation-lifecycle-settlement' -import { bindCoordinatorMutationPayload } from '../../../../orchestration/workers/reports/dispatch-message-binding' -import { ORCHESTRATION_FEDERATION_LIFECYCLE_SETTLEMENT_PROTOCOL_VERSION } from '../../../../../../shared/orchestration/orchestration-runtime-capabilities' +import type { OrcaRuntimeService } from '../../orca-runtime' +import { OrchestrationError } from '../orchestration-error' +import { waitForFederatedLifecycleSettlement } from './federation-lifecycle-settlement' +import { bindCoordinatorMutationPayload } from '../workers/reports/dispatch-message-binding' +import { ORCHESTRATION_FEDERATION_LIFECYCLE_SETTLEMENT_PROTOCOL_VERSION } from '../../../../shared/orchestration/orchestration-runtime-capabilities' import type { z } from 'zod' -import { parseRemoteWorkerPayload } from './message-payload' -import type { SendParams } from './send-params' -import { rejectFederatedExplicitTarget } from '../routing' -import { WORKER_DONE_RECORDED_NEXT } from '../receipt-next' -import { assertWorkerCanReport } from '../../../../orchestration/workers/reports/worker-report-admission' +import { parseRemoteWorkerPayload } from '../../rpc/methods/orchestration/messaging/message-payload' +import type { SendParams } from '../../rpc/methods/orchestration/messaging/send-params' +import { rejectFederatedExplicitTarget } from '../../rpc/methods/orchestration/routing' +import { WORKER_DONE_RECORDED_NEXT } from '../../rpc/methods/orchestration/receipt-next' +import { assertWorkerCanReport } from '../workers/reports/worker-report-admission' type SendParamsInput = z.infer diff --git a/src/main/runtime/orchestration/terminal-authority/release/worker-terminal-auto-release-scheduler.ts b/src/main/runtime/orchestration/terminal-authority/release/worker-terminal-auto-release-scheduler.ts index d6743a5ca51..7e8e25ced01 100644 --- a/src/main/runtime/orchestration/terminal-authority/release/worker-terminal-auto-release-scheduler.ts +++ b/src/main/runtime/orchestration/terminal-authority/release/worker-terminal-auto-release-scheduler.ts @@ -1,6 +1,6 @@ import type { WorkerTerminalReleaseRuntime } from './worker-terminal-release-runtime' import { reconcileRequestedWorkerTerminalReleases } from './worker-terminal-release-reconciliation' -import { releaseFederatedWorkerAtHomeDeadline } from '../../../rpc/methods/orchestration/federation/federated-worker-home-auto-release' +import { releaseFederatedWorkerAtHomeDeadline } from '../../legacy-remote-home/legacy-remote-home' const MAX_TIMER_DELAY_MS = 2_147_483_647 diff --git a/src/main/runtime/orchestration/terminal-authority/release/worker-terminal-release-reconciliation.ts b/src/main/runtime/orchestration/terminal-authority/release/worker-terminal-release-reconciliation.ts index e48729769c7..0d5555937df 100644 --- a/src/main/runtime/orchestration/terminal-authority/release/worker-terminal-release-reconciliation.ts +++ b/src/main/runtime/orchestration/terminal-authority/release/worker-terminal-release-reconciliation.ts @@ -1,6 +1,5 @@ import type { WorkerTerminalReleaseRuntime } from './worker-terminal-release-runtime' -import { inspectRemoteAttachment } from '../../../rpc/methods/orchestration/federation/federation-attachment-observation' -import { releaseRemoteAttachment } from '../../../rpc/methods/orchestration/federation/federated-worker-release-host' +import { inspectRemoteAttachment, releaseRemoteAttachment } from '../../legacy-remote/legacy-remote' import { completeWorkerTerminalRelease } from '../../../rpc/methods/orchestration/worker/worker-release-completion' export type WorkerTerminalReleaseReconciliationResult = { diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federated-attach-receipt.test.ts b/src/main/runtime/rpc/methods/orchestration/federation/federated-attach-receipt.test.ts index ee64d429046..4c6b8551cb8 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federated-attach-receipt.test.ts +++ b/src/main/runtime/rpc/methods/orchestration/federation/federated-attach-receipt.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { parseRemoteFederatedWorkerStartReceipt } from './federated-attach-receipt' +import { parseRemoteFederatedWorkerStartReceipt } from '../../../../orchestration/legacy-remote-home/federated-attach-receipt' describe('remote federated worker start receipt', () => { it.each([ diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federated-transport-safety.test.ts b/src/main/runtime/rpc/methods/orchestration/federation/federated-transport-safety.test.ts index f99dbeac8a9..571b6eb881d 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federated-transport-safety.test.ts +++ b/src/main/runtime/rpc/methods/orchestration/federation/federated-transport-safety.test.ts @@ -7,10 +7,10 @@ import { OrcaRuntimeService } from '../../../../orca-runtime' import type { FederatedDispatchRow } from '../../../../orchestration/db/orchestration-records' -import './federated-worker-read' -import { releaseFederatedWorker } from './federated-worker-release' +import '../../../../orchestration/legacy-remote-home/federated-worker-read' +import { releaseFederatedWorker } from '../../../../orchestration/legacy-remote-home/federated-worker-release' import '../worker/worker-observation' -import '../../../../orchestration/federation/synchronization/federation-sync' +import '../../../../orchestration/legacy-remote-home/federation-sync' import { ORCHESTRATION_WORKER_STOP_METHODS } from '../worker/worker-stop' const server = { diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federation-effects.test.ts b/src/main/runtime/rpc/methods/orchestration/federation/federation-effects.test.ts index 6dc7ee03dd3..c6897f7b696 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federation-effects.test.ts +++ b/src/main/runtime/rpc/methods/orchestration/federation/federation-effects.test.ts @@ -3,7 +3,7 @@ import { appendFederationSetupEffect, appendFederationTerminalEffects, type FederationEffect -} from './federation-effects' +} from '../../../../orchestration/legacy-remote/federation-effects' describe('orchestration federation effects', () => { it('uses exact terminal handles instead of display titles for setup identity', () => { diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federation-lifecycle-settlement.test.ts b/src/main/runtime/rpc/methods/orchestration/federation/federation-lifecycle-settlement.test.ts index dcefbdce963..9ffc18d5dd9 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federation-lifecycle-settlement.test.ts +++ b/src/main/runtime/rpc/methods/orchestration/federation/federation-lifecycle-settlement.test.ts @@ -12,7 +12,7 @@ import '../../../../orchestration/db/messages/mailbox-routing-page' import '../../../../orchestration/db/dispatch-row-writer' import '../../../../orchestration/db/attempt-outcome-projection' import type { OrchestrationEnvironmentTransport } from '../../../../orchestration/federation/environment-transport' -import '../../../../orchestration/federation/federation-lifecycle-settlement' +import '../../../../orchestration/legacy-remote/federation-lifecycle-settlement' import { RpcDispatcher } from '../../../dispatcher' import { ORCHESTRATION_METHODS } from '../orchestration' import { createFederationWorkerStartRequest as startRequest } from './federation-request.test-support' diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federation-methods.ts b/src/main/runtime/rpc/methods/orchestration/federation/federation-methods.ts index 39c02e08332..c0e0e2f50a8 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federation-methods.ts +++ b/src/main/runtime/rpc/methods/orchestration/federation/federation-methods.ts @@ -1,6 +1,8 @@ -import { ORCHESTRATION_FEDERATION_CONTROL_METHODS } from './federation-control' -import { ORCHESTRATION_FEDERATION_RELAY_METHODS } from './federation-relay' -import { ORCHESTRATION_FEDERATION_ATTACH_METHODS } from './federation' +import { + ORCHESTRATION_FEDERATION_ATTACH_METHODS, + ORCHESTRATION_FEDERATION_CONTROL_METHODS, + ORCHESTRATION_FEDERATION_RELAY_METHODS +} from '../../../../orchestration/legacy-remote/legacy-remote' import { ORCHESTRATION_PEER_MAIL_METHODS } from './peer-mail-methods' export const ORCHESTRATION_FEDERATION_METHODS = [ diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federation-setup.test.ts b/src/main/runtime/rpc/methods/orchestration/federation/federation-setup.test.ts index f89b2d9483d..a69ca2b2740 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federation-setup.test.ts +++ b/src/main/runtime/rpc/methods/orchestration/federation/federation-setup.test.ts @@ -6,7 +6,7 @@ import '../../../../orchestration/db/messages/mailbox-routing-page' import '../../../../orchestration/db/dispatch-row-writer' import '../../../../orchestration/db/attempt-outcome-projection' import { ORCHESTRATION_METHODS } from '../orchestration' -import { monitorFederatedSetup } from './federation-setup' +import { monitorFederatedSetup } from '../../../../orchestration/legacy-remote/federation-setup' describe('orchestration federated setup evidence', () => { const databases: OrchestrationDb[] = [] diff --git a/src/main/runtime/rpc/methods/orchestration/messaging/ask-methods.ts b/src/main/runtime/rpc/methods/orchestration/messaging/ask-methods.ts index 1f0ed7f5783..a235d63d89d 100644 --- a/src/main/runtime/rpc/methods/orchestration/messaging/ask-methods.ts +++ b/src/main/runtime/rpc/methods/orchestration/messaging/ask-methods.ts @@ -5,7 +5,7 @@ import { isGroupAddress } from '../../../../orchestration/addressing/groups/grou import { dispatchReportMailbox } from '../../../../orchestration/workers/reports/dispatch-report-mailbox' import { AskParams } from '../../../../../../shared/rpc-contract/orchestration-params' import { rejectFederatedExplicitTarget } from '../routing' -import { askRemoteRunHome } from './ask-remote' +import { askRemoteRunHome } from '../../../../orchestration/legacy-remote/legacy-remote' import { mailboxAddressOf, runCoordinatorKey diff --git a/src/main/runtime/rpc/methods/orchestration/messaging/check-worker-federated-attachment.test.ts b/src/main/runtime/rpc/methods/orchestration/messaging/check-worker-federated-attachment.test.ts index e23fbf55b72..8086a1cb488 100644 --- a/src/main/runtime/rpc/methods/orchestration/messaging/check-worker-federated-attachment.test.ts +++ b/src/main/runtime/rpc/methods/orchestration/messaging/check-worker-federated-attachment.test.ts @@ -13,7 +13,7 @@ import { OrcaRuntimeService } from '../../../../orca-runtime' import { encodeFederatedControlMessage, importFederatedControlMessage -} from '../../../../orchestration/federation/relay/federation-control-message' +} from '../../../../orchestration/legacy-remote/federation-control-message' const DISPATCH_ID = 'ctx_federated_worker_1' const WORKER_HANDLE = 'term_federated_worker' diff --git a/src/main/runtime/rpc/methods/orchestration/messaging/reply-method.ts b/src/main/runtime/rpc/methods/orchestration/messaging/reply-method.ts index f0ea51d87e7..df3cf80cacd 100644 --- a/src/main/runtime/rpc/methods/orchestration/messaging/reply-method.ts +++ b/src/main/runtime/rpc/methods/orchestration/messaging/reply-method.ts @@ -13,7 +13,7 @@ import { exposeMessage } from './mailbox-message-receipt' import { recordReceiptBeforeNudge, replayMutationNudge } from './mutation-replay-nudge' import { resolveReplyRecipient } from './recipient-routing' import { helperQuestionAnswerer } from './helper-question-answerer' -import { replyToRemoteRunHome } from './reply-remote' +import { replyToRemoteRunHome } from '../../../../orchestration/legacy-remote/legacy-remote' import { replyOverPeerMail } from './peer-mail-reply' import { withAnswerNext } from '../receipt-next' import { ReplyParams } from '../../../../../../shared/rpc-contract/orchestration-params' diff --git a/src/main/runtime/rpc/methods/orchestration/messaging/send-methods.ts b/src/main/runtime/rpc/methods/orchestration/messaging/send-methods.ts index 4c40eac6996..80e233bcbfa 100644 --- a/src/main/runtime/rpc/methods/orchestration/messaging/send-methods.ts +++ b/src/main/runtime/rpc/methods/orchestration/messaging/send-methods.ts @@ -23,11 +23,11 @@ import { } from '../../../orchestration-mutation-receipt' import { replayMutationNudge } from './mutation-replay-nudge' import { handBackReplayTargets } from '../../../../orchestration/db/messages/helper-mailbox-hand-back' -import { sendRemoteMessage } from './send-remote' +import { sendRemoteMessage } from '../../../../orchestration/legacy-remote/legacy-remote' import { mayNameSession } from './session-recipient' import { sendPointToPointMessage } from './send-point-to-point' import { sendGroupMessage } from './send-group' -import { sendFederatedControlMail } from './send-control-mail' +import { sendFederatedControlMail } from '../../../../orchestration/legacy-remote-home/legacy-remote-home' import { orchestrationCallerIdentity } from '../runs/run-scope' import { assertLifecycleCallerIsNotAnotherParty } from './lifecycle-caller-fence' import { planWorkerFollowUp, startWorkerFollowUp } from './worker-follow-up' diff --git a/src/main/runtime/rpc/methods/orchestration/runs/migration-behavior.test.ts b/src/main/runtime/rpc/methods/orchestration/runs/migration-behavior.test.ts index e8508c3ccdd..36b7801b97f 100644 --- a/src/main/runtime/rpc/methods/orchestration/runs/migration-behavior.test.ts +++ b/src/main/runtime/rpc/methods/orchestration/runs/migration-behavior.test.ts @@ -13,7 +13,7 @@ import '../../../../orchestration/db/attempt-outcome-projection' import { RpcDispatcher } from '../../../dispatcher' import { ORCHESTRATION_METHODS } from '../orchestration' -import { startFederatedWorker } from '../federation/federated-worker-start' +import { startFederatedWorker } from '../../../../orchestration/legacy-remote-home/federated-worker-start' import { createRootDispatch } from '../../../../orchestration/db/root-dispatch-test-fixture' describe('orchestration migration behavior', () => { diff --git a/src/main/runtime/rpc/methods/orchestration/worker/worker-control.ts b/src/main/runtime/rpc/methods/orchestration/worker/worker-control.ts index ee8849d323d..a9c1f2ec6a2 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/worker-control.ts +++ b/src/main/runtime/rpc/methods/orchestration/worker/worker-control.ts @@ -17,8 +17,10 @@ import { sessionIdFromStructuredWorkerIncarnation } from '../../../../orchestrat import { readExactWorkerOutput } from './worker-output' import { exposeWorkerTerminalResource } from './worker-terminal-resource-presentation' import { liveWorkerTerminalAutoReleaseAt } from '../../../../orchestration/terminal-authority/release/worker-terminal-ownership' -import { readFederatedWorkerOutput } from '../federation/federated-worker-read' -import { showFederatedWorker } from '../federation/federated-worker-show' +import { + readFederatedWorkerOutput, + showFederatedWorker +} from '../../../../orchestration/legacy-remote-home/legacy-remote-home' import { WorkerDispatchParams, WorkerReadParams diff --git a/src/main/runtime/rpc/methods/orchestration/worker/worker-list-projection.ts b/src/main/runtime/rpc/methods/orchestration/worker/worker-list-projection.ts index 7ec92f45a9d..df87127d9ca 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/worker-list-projection.ts +++ b/src/main/runtime/rpc/methods/orchestration/worker/worker-list-projection.ts @@ -14,7 +14,7 @@ import { createSessionWorkerLivenessReader } from '../../../../orchestration/wor import { applyFederatedFleetObservations, readFederatedFleetSnapshots -} from '../federation/federated-fleet-snapshot' +} from '../../../../orchestration/legacy-remote-home/federated-fleet-snapshot' import { ensureSessionWorkerRecords } from './session-worker-observation' export type WorkerListPageParams = { diff --git a/src/main/runtime/rpc/methods/orchestration/worker/worker-release.ts b/src/main/runtime/rpc/methods/orchestration/worker/worker-release.ts index d71b7813645..a26a092d09d 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/worker-release.ts +++ b/src/main/runtime/rpc/methods/orchestration/worker/worker-release.ts @@ -3,7 +3,7 @@ import { defineMethod } from '../../../core' import { releaseFederatedWorker, retainFederatedWorker -} from '../federation/federated-worker-release' +} from '../../../../orchestration/legacy-remote-home/legacy-remote-home' import { ORCHESTRATION_WORKER_LIST_METHOD } from './worker-list-method' import { resolvePinnedFederatedServer } from './worker-observation' import { archiveSummary, exposeWorkerRetainReceipt } from './worker-terminal-resource-presentation' diff --git a/src/main/runtime/rpc/methods/orchestration/worker/workers.ts b/src/main/runtime/rpc/methods/orchestration/worker/workers.ts index b5e1c0a2eea..0b8ae7266ae 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/workers.ts +++ b/src/main/runtime/rpc/methods/orchestration/worker/workers.ts @@ -2,7 +2,7 @@ import { stopHelperAfterStart } from './worker-stop' import { OrchestrationError } from '../../../../orchestration/orchestration-error' import type { z } from 'zod' import { defineMethod, type RpcContext } from '../../../core' -import { startFederatedWorker } from '../federation/federated-worker-start' +import { startFederatedWorker } from '../../../../orchestration/legacy-remote-home/legacy-remote-home' import { startLocalWorker } from './local-worker-start' import type { WorkerFollowUp } from './worker-follow-up-placement' import { withWorkerStartNext } from '../receipt-next' diff --git a/src/main/runtime/rpc/server/runtime-rpc-request-authorization.test.ts b/src/main/runtime/rpc/server/runtime-rpc-request-authorization.test.ts index 32883637bc4..2886782aae8 100644 --- a/src/main/runtime/rpc/server/runtime-rpc-request-authorization.test.ts +++ b/src/main/runtime/rpc/server/runtime-rpc-request-authorization.test.ts @@ -18,7 +18,7 @@ import { OrcaRuntimeRpcServer } from './runtime-rpc' import { DeviceRegistry } from './pairing/device-registry' import { sendRequest, withCurrentOrchestrationContract } from './runtime-rpc-test-harness' import { STATUS_METHODS } from '../methods/host-management/status' -import { ORCHESTRATION_FEDERATION_CONTROL_METHODS } from '../methods/orchestration/federation/federation-control' +import { ORCHESTRATION_FEDERATION_CONTROL_METHODS } from '../../orchestration/legacy-remote/federation-control' import { ORCHESTRATION_RESET_METHODS } from '../methods/orchestration/runs/reset-methods' import { SESSION_TAB_METHODS } from '../methods/session-tabs/session-tabs' import { FILE_MUTATION_METHODS } from '../methods/files/files-mutation-methods' diff --git a/src/main/workspaces/creation/preparation/worktree-create-preparation-cancellation.test.ts b/src/main/workspaces/creation/preparation/worktree-create-preparation-cancellation.test.ts index 3b1ca6f8849..47d75854e94 100644 --- a/src/main/workspaces/creation/preparation/worktree-create-preparation-cancellation.test.ts +++ b/src/main/workspaces/creation/preparation/worktree-create-preparation-cancellation.test.ts @@ -1,114 +1,31 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type * as WorktreeLogic from '../../../ipc/worktree-logic' -import type { Store } from '../../../persistence/loading-store/store' +import { + mocks, + repo, + store, + flushBackgroundWork +} from '../../../__mocks__/worktree-create-preparation' +import { describe, expect, it, vi } from 'vitest' import { WORKTREE_CREATE_PREPARATION_TTL_MS } from './worktree-create-preparation-pool' -import type { Repo } from '../../../../shared/repo-types' -import { resolveWorktreeAddBaseRef } from '../../../../shared/worktree/base-ref' - -const mocks = vi.hoisted(() => ({ - mkdir: vi.fn(), - listWorktreeGraph: vi.fn(), - prepareCheckout: vi.fn(), - finalize: vi.fn(), - discard: vi.fn(), - unlock: vi.fn(), - getWorktreeOptions: vi.fn(), - computeWorkspaceRoot: vi.fn(), - computeWorkspaceRootAsync: vi.fn(), - resolveBaseRef: vi.fn(), - measureDivergence: vi.fn() -})) - -vi.mock('node:fs/promises', () => ({ mkdir: mocks.mkdir })) - -vi.mock('../../../git/worktrees/catalog/worktree-scan-cache', async (importOriginal) => ({ - ...(await importOriginal>()), - listWorktreeGraph: mocks.listWorktreeGraph -})) -vi.mock('../../../git/worktrees/creation/worktree-create-preparation', () => ({ - prepareWorktreeCreateCheckout: mocks.prepareCheckout, - finalizePreparedWorktree: mocks.finalize, - discardPreparedWorktree: mocks.discard, - unlockPreparedWorktree: mocks.unlock -})) -vi.mock('../../../git/worktrees/creation/worktree-base-ref-probe', () => ({ - resolveLocalWorktreeBaseRef: mocks.resolveBaseRef -})) -vi.mock('../../../git/worktrees/creation/worktree-base-divergence', () => ({ - measureRetargetDivergence: mocks.measureDivergence -})) -vi.mock('../../execution-host/project-runtime-git-options', () => ({ - getLocalProjectWorktreeGitOptions: mocks.getWorktreeOptions, - getWorktreeMirrorDistro: () => undefined -})) -vi.mock('../../../ipc/worktree-logic', async (importOriginal) => ({ - isOrphanedWorktreeError: (await importOriginal()).isOrphanedWorktreeError, - computeWorkspaceRoot: mocks.computeWorkspaceRoot, - computeWorkspaceRootAsync: mocks.computeWorkspaceRootAsync, - getWorktreePathSettings: () => ({ - workspaceDir: process.platform === 'win32' ? 'C:\\workspace' : '/workspace', - nestWorkspaces: false - }) -})) import { - _resetWorktreeCreatePreparationsForTests, consumePreparedWorktreeCreate, prepareWorktreeCreateForRepo } from './worktree-create-preparation' -// Evictions and retries are fire-and-forget, so let them settle before asserting. -function flushBackgroundWork(ms = 0): Promise { - return new Promise((resolve) => setTimeout(resolve, ms)) -} - -const EXISTING_REFS = new Set([ - 'refs/heads/main', - 'refs/remotes/origin/main', - 'refs/remotes/origin/release' -]) -const repo = { id: 'repo-1', path: '/repo' } as Repo -const store = { getSettings: () => ({}) } as unknown as Store - -beforeEach(() => { - mocks.mkdir.mockReset().mockResolvedValue(undefined) - mocks.listWorktreeGraph.mockReset().mockResolvedValue([]) - mocks.prepareCheckout.mockReset().mockResolvedValue(undefined) - mocks.finalize.mockReset().mockResolvedValue({}) - mocks.discard.mockReset().mockResolvedValue(undefined) - mocks.unlock.mockReset().mockResolvedValue(undefined) - mocks.getWorktreeOptions.mockReset().mockReturnValue({}) - mocks.measureDivergence.mockReset().mockResolvedValue('within') - mocks.resolveBaseRef - .mockReset() - .mockImplementation((_repoPath: string, baseRef: string) => - resolveWorktreeAddBaseRef(baseRef, async (candidate) => EXISTING_REFS.has(candidate)) - ) - mocks.computeWorkspaceRoot.mockReset().mockImplementation(() => { - throw new Error('synchronous workspace-root lookup must not run on the main thread') - }) - mocks.computeWorkspaceRootAsync - .mockReset() - .mockImplementation(async (repoPath: string) => - process.platform === 'win32' && /^[A-Za-z]:[\\/]/.test(repoPath) - ? 'C:\\workspace' - : '/workspace' - ) -}) - -afterEach(async () => { - await _resetWorktreeCreatePreparationsForTests() -}) - describe('worktree create preparation cancellation', () => { it('cancels an evicted checkout and cleans up with the original options', async () => { let signal: AbortSignal | undefined - mocks.prepareCheckout.mockImplementationOnce((_repo, _path, _base, _lock, options) => { - signal = options.signal - return new Promise((_resolve, reject) => { - signal!.addEventListener('abort', () => reject(signal!.reason), { once: true }) - }) - }) + mocks.prepareCheckout.mockImplementationOnce( + (repoPath, path, _base, reason, options, _barrier, operation) => { + operation.setDiscard((cleanupOptions) => + mocks.discard(repoPath, path, cleanupOptions, reason, null) + ) + signal = options.signal + return new Promise((_resolve, reject) => { + signal!.addEventListener('abort', () => reject(signal!.reason), { once: true }) + }) + } + ) const obsolete = prepareWorktreeCreateForRepo(store, repo, 'origin/main') const settled = Promise.allSettled([obsolete]) await flushBackgroundWork() @@ -123,7 +40,8 @@ describe('worktree create preparation cancellation', () => { repo.path, obsoletePath, expect.objectContaining({ signal: undefined }), - expect.any(String) + expect.any(String), + null ) }) @@ -149,7 +67,26 @@ describe('worktree create preparation cancellation', () => { 'fulfilled', 'fulfilled' ]) - expect(mocks.prepareCheckout).toHaveBeenCalledTimes(3) + for (const base of ['one', 'two', 'three']) { + await expect( + consumePreparedWorktreeCreate({ + repoPath: repo.path, + workspaceRoot: '/workspace', + worktreePath: `/workspace/${base}`, + branch: base, + baseBranch: `origin/${base}` + }) + ).resolves.toMatchObject({ status: 'hit' }) + } + expect(mocks.prepareCheckout).not.toHaveBeenCalledWith( + repo.path, + expect.any(String), + 'refs/remotes/origin/main', + expect.any(String), + expect.anything(), + undefined, + expect.anything() + ) await flushBackgroundWork() expect(mocks.discard).not.toHaveBeenCalled() }) diff --git a/src/main/workspaces/creation/preparation/worktree-create-preparation-pool.ts b/src/main/workspaces/creation/preparation/worktree-create-preparation-pool.ts index 140d0ac33f0..c0570d5d264 100644 --- a/src/main/workspaces/creation/preparation/worktree-create-preparation-pool.ts +++ b/src/main/workspaces/creation/preparation/worktree-create-preparation-pool.ts @@ -1,3 +1,11 @@ +import { discardUnmaterializedPreparation } from '../../../git/worktrees/creation/worktree-preparation-add' +import { + cancelPreparationAdmissions, + waitForPreparationAdmission, + canPrepare, + selectPreparationVictim, + type StartPreparationArgs +} from './worktree-preparation-admission-intents' import { worktreePreparationGit } from '../../../git/worktrees/creation/worktree-create-git-executor' import { randomUUID } from 'node:crypto' import { mkdir } from 'node:fs/promises' @@ -8,10 +16,7 @@ import { createWorktreePreparationLockReason } from '../../../../shared/worktree/create-preparation' import type { AddWorktreeOptions } from '../../../git/worktrees/worktree-operation-options' -import { - prepareWorktreeCreateCheckout, - discardPreparedWorktree -} from '../../../git/worktrees/creation/worktree-create-preparation' +import { prepareWorktreeCreateCheckout } from '../../../git/worktrees/creation/worktree-create-preparation' import { queuePreparedWorktreeTipRefresh } from './worktree-preparation-refresh-queue' import { toHostFilesystemPath } from '../../../filesystem/host-tree-removal' import { createPreparationActivity } from './worktree-create-preparation-activity' @@ -35,12 +40,16 @@ import { import { discardPreparationEntry, preparationHostKey, + preparationCapacityUsed, + registerPreparationObligation, + retryPendingPreparationDiscards, resetPendingPreparationDiscardsForTests, trackPreparationDiscard } from './worktree-preparation-discard-retry' import { WorktreePreparationOperation } from '../../../git/worktrees/creation/worktree-preparation-operation' import { waitForPromiseWithSignal } from '../../../../shared/abort-signal-reason' +export type { StartPreparationArgs } from './worktree-preparation-admission-intents' export { WORKTREE_CREATE_PREPARATION_TTL_MS } from '../../../git/worktrees/creation/worktree-preparation-operation' export const WORKTREE_CREATE_PREPARATION_LIMIT = 3 @@ -63,30 +72,22 @@ export type PreparationEntry = { activity: PreparationActivity } -export type StartPreparationArgs = { - repoPath: string - workspaceRoot: string - baseBranch: string - canonicalBase: string - options: AddWorktreeOptions - beforeMaterialization?: Promise -} - const preparations = new Map() export function hasPendingPreparations(): boolean { return preparations.size > 0 || hasClaims() || hasPendingStalePreparationCleanup() } -function discardEntryInBackground(entry: PreparationEntry): void { - // Let test reset await background discards before clearing the registry. - trackPreparationDiscard(worktreePreparationGit.run(() => discardPreparationEntry(entry))) +function discardEntryInBackground(entry: PreparationEntry): Promise { + const work = worktreePreparationGit.run(() => discardPreparationEntry(entry)) + trackPreparationDiscard(work) + return work } -function evictEntry(entry: PreparationEntry): void { +function evictEntry(entry: PreparationEntry): Promise { preparations.delete(entry.key) entry.operation.controller.abort() - discardEntryInBackground(entry) + return discardEntryInBackground(entry) } function expireEntry(entry: PreparationEntry): void { @@ -97,6 +98,7 @@ function expireEntry(entry: PreparationEntry): void { /** A removed project has no create left to claim its armed checkouts. */ export function discardRepoPreparations(repoPathKey: string): void { + cancelPreparationAdmissions(repoPathKey) for (const entry of preparations.values()) { if (entry.repoPathKey === repoPathKey) { evictEntry(entry) @@ -104,28 +106,6 @@ export function discardRepoPreparations(repoPathKey: string): void { } } -/** Bound full-checkout disk use, evicting the requesting workspace's oldest preparation first. */ -function enforcePreparationLimit( - repoPathKey: string, - workspaceRootKey: string, - wslDistro: string -): void { - while (preparations.size >= WORKTREE_CREATE_PREPARATION_LIMIT) { - const byAge = [...preparations.values()].sort((left, right) => left.createdAt - right.createdAt) - const victim = - byAge.find( - (entry) => - entry.repoPathKey === repoPathKey && - entry.workspaceRootKey === workspaceRootKey && - entry.wslDistro === wslDistro - ) ?? byAge[0] - if (!victim) { - return - } - evictEntry(victim) - } -} - export function listPreparations(): PreparationEntry[] { return [...preparations.values()] } @@ -157,10 +137,13 @@ export function takePreparation( return registerClaim(entry, requestedKey) } -export function startPreparation( +function reusePreparation( args: StartPreparationArgs, - kind: DeferredPreparation['kind'] = 'explicit' -): Promise { + kind: DeferredPreparation['kind'] +): Promise | undefined { + if (!canPrepare(args)) { + return Promise.resolve() + } const existing = findPreparation( preparationPathKey(args.repoPath), preparationPathKey(args.workspaceRoot), @@ -175,10 +158,42 @@ export function startPreparation( ? refreshPreparationTip(existing, args.beforeMaterialization) : existing.ready } - if (deferPreparationForClaim(args, kind)) { - return Promise.resolve() + return deferPreparationForClaim(args, kind) ? Promise.resolve() : undefined +} + +export function startPreparation( + args: StartPreparationArgs, + kind: DeferredPreparation['kind'] = 'explicit' +): Promise { + const full = preparationCapacityUsed() >= WORKTREE_CREATE_PREPARATION_LIMIT + const retries = retryPendingPreparationDiscards( + full + ? undefined + : preparationHostKey(preparationPathKey(args.repoPath), args.options.wslDistro ?? '') + ) + void retries.catch((error) => + console.warn('[worktree-create] preparation cleanup retry failed', error) + ) + const reused = reusePreparation(args, kind) + if (reused) { + return reused } - return worktreePreparationGit.run(() => startBackgroundPreparation({ ...args, kind })) + if (!full) { + return worktreePreparationGit.run(() => startBackgroundPreparation({ ...args, kind })) + } + return worktreePreparationGit.run(() => + waitForPreparationAdmission(args, kind, WORKTREE_CREATE_PREPARATION_LIMIT, { + retry: retries, + reuse: reusePreparation, + hasCapacity: () => preparationCapacityUsed() < WORKTREE_CREATE_PREPARATION_LIMIT, + evict: (request) => { + const victim = selectPreparationVictim(preparations.values(), request) + return victim ? evictEntry(victim) : undefined + }, + start: (request, requestedKind) => + startBackgroundPreparation({ ...request, kind: requestedKind }) + }) + ) } function refreshPreparationTip( @@ -204,20 +219,25 @@ function refreshPreparationTip( return ready } -function startBackgroundPreparation({ - repoPath, - workspaceRoot, - baseBranch, - canonicalBase, - options, - beforeMaterialization, - kind -}: StartPreparationArgs & { kind: DeferredPreparation['kind'] }): Promise { +function startBackgroundPreparation( + args: StartPreparationArgs & { kind: DeferredPreparation['kind'] } +): Promise { + const { + repoPath, + workspaceRoot, + baseBranch, + canonicalBase, + options, + beforeMaterialization, + kind + } = args const repoPathKey = preparationPathKey(repoPath) const workspaceRootKey = preparationPathKey(workspaceRoot) const wslDistro = options.wslDistro ?? '' const key = preparationEntryKey(repoPathKey, workspaceRootKey, canonicalBase, wslDistro) - enforcePreparationLimit(repoPathKey, workspaceRootKey, wslDistro) + if (!canPrepare(args) || preparationCapacityUsed() >= WORKTREE_CREATE_PREPARATION_LIMIT) { + return Promise.resolve() + } const preparationId = `${process.pid}-${randomUUID()}` const lockReason = createWorktreePreparationLockReason( preparationId, @@ -242,13 +262,14 @@ function startBackgroundPreparation({ options, createdAt: Date.now(), operation, - checkoutStarted: false, + checkoutStarted: true, activity: createPreparationActivity(kind), ready: Promise.resolve() } operation.setDiscard((cleanupOptions) => - discardPreparedWorktree(repoPath, preparedPath, cleanupOptions, lockReason) + discardUnmaterializedPreparation(preparedPath, cleanupOptions) ) + registerPreparationObligation(entry) entry.ready = operation.run(async () => { await waitForPromiseWithSignal( startStalePreparationCleanup(preparationHostKey(repoPathKey, wslDistro), repoPath, options), @@ -257,7 +278,6 @@ function startBackgroundPreparation({ signal.throwIfAborted() await operation.trackWriter(mkdir(toHostFilesystemPath(preparationRoot), { recursive: true })) signal.throwIfAborted() - entry.checkoutStarted = true await prepareWorktreeCreateCheckout( repoPath, preparedPath, @@ -281,6 +301,7 @@ function startBackgroundPreparation({ } export async function _resetPreparationPoolForTests(): Promise { + cancelPreparationAdmissions() const entries = [...preparations.values()] preparations.clear() resetClaimsForTests() diff --git a/src/main/workspaces/creation/preparation/worktree-create-preparation-stale-cleanup.ts b/src/main/workspaces/creation/preparation/worktree-create-preparation-stale-cleanup.ts index 7ac8fea5ffa..0619cb0dd59 100644 --- a/src/main/workspaces/creation/preparation/worktree-create-preparation-stale-cleanup.ts +++ b/src/main/workspaces/creation/preparation/worktree-create-preparation-stale-cleanup.ts @@ -64,12 +64,12 @@ export async function startStalePreparationCleanup( repoPath: string, options: AddWorktreeOptions ): Promise { + void retryPendingPreparationDiscards(cleanupKey) const existing = staleCleanupInFlight.get(cleanupKey) if (existing) { await existing.scanned.catch(() => {}) return } - void retryPendingPreparationDiscards(cleanupKey) // Reclaim in background to avoid blocking creates; retain caller priority for the scan they await. const reclaimOptions: AddWorktreeOptions = { ...options, admissionTier: 'background' } const scan = listWorktreeGraph(repoPath, { diff --git a/src/main/workspaces/creation/preparation/worktree-create-preparation.test.ts b/src/main/workspaces/creation/preparation/worktree-create-preparation.test.ts index f0f3a1c4071..3beddbfdfc6 100644 --- a/src/main/workspaces/creation/preparation/worktree-create-preparation.test.ts +++ b/src/main/workspaces/creation/preparation/worktree-create-preparation.test.ts @@ -8,7 +8,6 @@ import { describe, expect, it } from 'vitest' import type { Repo } from '../../../../shared/repo-types' import { hasPendingStalePreparationCleanup } from './worktree-create-preparation-stale-cleanup' import '../../../../shared/worktree/create-preparation' -import { WorktreePreparationLockOwnershipError } from '../../../git/worktrees/creation/worktree-preparation-lock' import { _resetWorktreeCreatePreparationsForTests, consumePreparedWorktreeCreate, @@ -62,7 +61,8 @@ describe('worktree create preparation registry', () => { 'main', undefined, {}, - mocks.prepareCheckout.mock.calls[0]?.[3] + mocks.prepareCheckout.mock.calls[0]?.[3], + expect.anything() ) }) @@ -189,7 +189,8 @@ describe('worktree create preparation registry', () => { repo.path, armedPath, expect.objectContaining({ signal: undefined }), - expect.any(String) + expect.any(String), + null ) expect(mocks.discard).toHaveBeenCalledWith( repo.path, @@ -309,36 +310,4 @@ describe('worktree create preparation registry', () => { expect(mocks.unlock).not.toHaveBeenCalled() expect(mocks.discard).not.toHaveBeenCalled() }) - - it('cleans up and reports a finalize miss so normal add can run', async () => { - await prepareWorktreeCreateForRepo(store, repo, 'origin/main') - mocks.finalize.mockRejectedValueOnce(new Error('submodules prevent worktree move')) - - await expect( - consumePreparedWorktreeCreate({ - repoPath: repo.path, - workspaceRoot: '/workspace', - worktreePath: '/workspace/final', - branch: 'feature/test', - baseBranch: 'origin/main' - }) - ).resolves.toMatchObject({ status: 'miss', reason: 'finalize_failed' }) - expect(mocks.mkdir).toHaveBeenCalledWith('/workspace', { recursive: true }) - expect(mocks.discard).toHaveBeenCalledTimes(1) - }) - - it('preserves another owner’s checkout when finalization loses its lock', async () => { - await prepareWorktreeCreateForRepo(store, repo, 'origin/main') - mocks.finalize.mockRejectedValueOnce(new WorktreePreparationLockOwnershipError()) - await expect( - consumePreparedWorktreeCreate({ - repoPath: repo.path, - workspaceRoot: '/workspace', - worktreePath: '/workspace/final', - branch: 'feature/test', - baseBranch: 'origin/main' - }) - ).resolves.toMatchObject({ status: 'miss', reason: 'finalize_failed' }) - expect(mocks.discard).not.toHaveBeenCalled() - }) }) diff --git a/src/main/workspaces/creation/preparation/worktree-create-preparation.ts b/src/main/workspaces/creation/preparation/worktree-create-preparation.ts index f832a983b81..7ab008843c8 100644 --- a/src/main/workspaces/creation/preparation/worktree-create-preparation.ts +++ b/src/main/workspaces/creation/preparation/worktree-create-preparation.ts @@ -1,7 +1,8 @@ import { waitForPromiseWithSignal } from '../../../../shared/abort-signal-reason' import { discardPreparationEntry, - trackPreparationDiscard + trackPreparationDiscard, + releasePreparationObligation } from './worktree-preparation-discard-retry' import { worktreePreparationGit } from '../../../git/worktrees/creation/worktree-create-git-executor' import { mkdir } from 'node:fs/promises' @@ -20,7 +21,6 @@ import type { AddWorktreeOptions, AddWorktreeResult } from '../../../git/worktrees/worktree-operation-options' -import { WorktreePreparationLockOwnershipError } from '../../../git/worktrees/creation/worktree-preparation-lock' import { _resetPreparationPoolForTests, hasPendingPreparations, @@ -38,7 +38,7 @@ import { type ReservedPreparation } from './worktree-create-preparation-reservation' import { - discardPreparedWorktree, + PreparedWorktreeFinalizationPendingError, finalizePreparedWorktree } from '../../../git/worktrees/creation/worktree-create-preparation' import { @@ -127,8 +127,7 @@ async function prepareWorktreeCreateInBackground( return } const options = getLocalProjectWorktreeGitOptions(store, repo) - // Resolve WSL homes asynchronously to avoid freezing the composer while wsl.exe runs. - // Match createLocalWorktree's mirror distro so preparation and consume use the same root key. + // Resolve WSL homes asynchronously with createLocalWorktree's mirror distro and root key. const workspaceRoot = await computeWorkspaceRootAsync( repo.path, getWorktreePathSettings(repo, store.getSettings(), getWorktreeMirrorDistro(store, repo)) @@ -144,7 +143,8 @@ async function prepareWorktreeCreateInBackground( baseBranch, canonicalBase, options, - beforeMaterialization + beforeMaterialization, + canPrepare: () => !store.getRepo || Boolean(store.getRepo(repo.id)) }) } @@ -250,10 +250,7 @@ export async function consumePreparedWorktreeCreate( } function preparedCheckoutReset(retargeted: boolean, headReset: boolean): PreparedCheckoutReset { - if (!headReset) { - return 'none' - } - return retargeted ? 'retargeted' : 'base_moved' + return headReset ? (retargeted ? 'retargeted' : 'base_moved') : 'none' } async function attemptPreparedWorktreeCreate( @@ -283,10 +280,12 @@ async function attemptPreparedWorktreeCreate( args.baseBranch, args.refreshLocalBaseRef, options, - entry.lockReason + entry.lockReason, + entry.operation ) } ) + releasePreparationObligation(entry) const rearm = deferRearmPreparation(entry, reservation, args.baseBranch, claim.canonicalBase) return { status: 'hit', @@ -298,16 +297,15 @@ async function attemptPreparedWorktreeCreate( rearm } } catch (error) { - // Another owner holds the preparation's lock, so it is not ours to remove. - if (!(error instanceof WorktreePreparationLockOwnershipError)) { - await timePhase(args, 'prepared_checkout_discard', () => - discardPreparedWorktree(args.repoPath, entry.preparedPath, options, entry.lockReason) - ).catch(() => {}) - } + trackPreparationDiscard(worktreePreparationGit.run(() => discardPreparationEntry(entry))) if (options.signal?.aborted) { releaseClaimAfterCreate(reservation)() options.signal.throwIfAborted() } + if (error instanceof PreparedWorktreeFinalizationPendingError) { + releaseClaimAfterCreate(reservation)() + throw error.originalError + } console.warn( '[worktree-create] prepared checkout could not be finalized; using normal add', error diff --git a/src/main/workspaces/creation/preparation/worktree-preparation-admission-intents.ts b/src/main/workspaces/creation/preparation/worktree-preparation-admission-intents.ts new file mode 100644 index 00000000000..c54cb0b3679 --- /dev/null +++ b/src/main/workspaces/creation/preparation/worktree-preparation-admission-intents.ts @@ -0,0 +1,184 @@ +import { blockedWslDistroForPath } from '../../../wsl/filesystem/wsl-unc-access-gate' +import { waitForPromiseWithSignal } from '../../../../shared/abort-signal-reason' +import { preparationEntryKey, preparationPathKey } from './worktree-create-preparation-claim' +import type { DeferredPreparation } from './worktree-create-preparation-claim-registry' +import type { PreparationEntry } from './worktree-create-preparation-pool' +import type { AddWorktreeOptions } from '../../../git/worktrees/worktree-operation-options' + +export type StartPreparationArgs = { + repoPath: string + workspaceRoot: string + baseBranch: string + canonicalBase: string + options: AddWorktreeOptions + beforeMaterialization?: Promise + canPrepare?: () => boolean +} + +export function selectPreparationVictim( + entries: Iterable, + args: StartPreparationArgs +): PreparationEntry | undefined { + const byAge = [...entries].sort((left, right) => left.createdAt - right.createdAt) + return ( + byAge.find( + (entry) => + entry.repoPathKey === preparationPathKey(args.repoPath) && + entry.workspaceRootKey === preparationPathKey(args.workspaceRoot) && + entry.wslDistro === (args.options.wslDistro ?? '') + ) ?? byAge[0] + ) +} + +type PreparationAdmissionIntent = { + args: StartPreparationArgs + kind: DeferredPreparation['kind'] + ready: Promise + signal: AbortSignal + current(): boolean + release(): void + wait(work: Promise): Promise + cancel(): void +} + +const intents = new Map() + +function joinPreparationAdmission( + args: StartPreparationArgs, + kind: DeferredPreparation['kind'], + limit: number, + run: (intent: PreparationAdmissionIntent) => Promise, + reuse: () => Promise | undefined +): Promise { + const key = preparationEntryKey( + preparationPathKey(args.repoPath), + preparationPathKey(args.workspaceRoot), + args.canonicalBase, + args.options.wslDistro ?? '' + ) + const existing = intents.get(key) + if (existing) { + if (kind === 'explicit' || existing.kind !== 'explicit') { + existing.kind = kind + if (args.beforeMaterialization) { + existing.args.beforeMaterialization = args.beforeMaterialization + } + } + return existing.ready.then(() => (existing.signal.aborted ? undefined : reuse())) + } + if (intents.size >= limit) { + return Promise.resolve() + } + const controller = new AbortController() + const signal = args.options.signal + ? AbortSignal.any([controller.signal, args.options.signal]) + : controller.signal + const completion = Promise.withResolvers() + const intent: PreparationAdmissionIntent = { + args: { ...args }, + kind, + ready: completion.promise, + signal, + current: () => intents.get(key) === intent && !signal.aborted, + release: () => { + if (intents.get(key) === intent) { + intents.delete(key) + } + }, + wait: (work) => waitForPromiseWithSignal(work, signal), + cancel: () => { + controller.abort() + intent.release() + } + } + intents.set(key, intent) + void run(intent) + .catch((error) => { + if (!signal.aborted) { + throw error + } + }) + .then(completion.resolve, completion.reject) + .finally(intent.release) + return intent.ready +} + +export function cancelPreparationAdmissions(repoPathKey?: string): void { + for (const intent of intents.values()) { + if (!repoPathKey || preparationPathKey(intent.args.repoPath) === repoPathKey) { + intent.cancel() + } + } +} + +type AdmissionActions = { + retry: Promise + reuse: ( + args: StartPreparationArgs, + kind: DeferredPreparation['kind'] + ) => Promise | undefined + hasCapacity: () => boolean + evict: (args: StartPreparationArgs) => Promise | undefined + start: (args: StartPreparationArgs, kind: DeferredPreparation['kind']) => Promise +} + +export function canPrepare(args: StartPreparationArgs): boolean { + return ( + !args.options.signal?.aborted && + args.options.canStart?.() !== false && + args.canPrepare?.() !== false + ) +} + +export function waitForPreparationAdmission( + args: StartPreparationArgs, + kind: DeferredPreparation['kind'], + limit: number, + actions: AdmissionActions +): Promise { + return joinPreparationAdmission( + args, + kind, + limit, + (intent) => recoverPreparationCapacity(intent, actions), + () => (canPrepare(args) ? actions.reuse(args, kind) : undefined) + ) +} + +async function recoverPreparationCapacity( + intent: PreparationAdmissionIntent, + actions: AdmissionActions +): Promise { + const { args } = intent + const valid = (): boolean => intent.current() && canPrepare(args) + const hostAvailable = (): Promise => + intent + .wait(blockedWslDistroForPath(args.repoPath, args.options.wslDistro)) + .then((blocked) => !blocked) + await intent.wait(actions.retry) + if (!valid() || !(await hostAvailable()) || !valid()) { + return + } + let reused = actions.reuse(args, intent.kind) + if (reused) { + intent.release() + return reused + } + if (!actions.hasCapacity()) { + const removal = actions.evict(args) + if (!removal) { + return + } + await intent.wait(removal) + if (!valid() || !(await hostAvailable()) || !valid()) { + return + } + reused = actions.reuse(args, intent.kind) + if (reused) { + intent.release() + return reused + } + } + intent.release() + return actions.start(args, intent.kind) +} diff --git a/src/main/workspaces/creation/preparation/worktree-preparation-discard-retry.ts b/src/main/workspaces/creation/preparation/worktree-preparation-discard-retry.ts index c8b65032454..0ce0d4b20db 100644 --- a/src/main/workspaces/creation/preparation/worktree-preparation-discard-retry.ts +++ b/src/main/workspaces/creation/preparation/worktree-preparation-discard-retry.ts @@ -1,101 +1,88 @@ -import type { AddWorktreeOptions } from '../../../git/worktrees/worktree-operation-options' -import { discardPreparedWorktree } from '../../../git/worktrees/creation/worktree-create-preparation' -import { WorktreePreparationLockOwnershipError } from '../../../git/worktrees/creation/worktree-preparation-lock' -import { isOrphanedWorktreeError } from '../../../ipc/worktree-logic' +import { worktreePreparationGit } from '../../../git/worktrees/creation/worktree-create-git-executor' import { trackPreparationWork } from '../worktree-create-concurrency' -import type { WorktreePreparationOperation } from '../../../git/worktrees/creation/worktree-preparation-operation' +import { blockedWslDistroForPath } from '../../../wsl/filesystem/wsl-unc-access-gate' import type { PreparationEntry } from './worktree-create-preparation-pool' -// Retry live-owner discard failures on later preparations; stale cleanup only reclaims dead owners. -const PREPARATION_DISCARD_ATTEMPT_LIMIT = 3 - -export type PreparationDiscardTarget = { - hostKey: string - repoPath: string - preparedPath: string - lockReason: string - options: AddWorktreeOptions - operation?: WorktreePreparationOperation -} - -const pendingDiscards = new Map() +const obligations = new Map() const inFlightDiscards = new Set>() export function preparationHostKey(repoPathKey: string, wslDistro: string): string { return `${repoPathKey}\0${wslDistro}` } +function obligationKey(entry: PreparationEntry): string { + return `${preparationHostKey(entry.repoPathKey, entry.wslDistro)}\0${entry.preparedPath}` +} + +export function preparationCapacityUsed(): number { + return obligations.size +} + +export function registerPreparationObligation(entry: PreparationEntry): void { + const key = obligationKey(entry) + obligations.set(key, entry) + entry.operation.setDisposalOwner({ + current: () => obligations.get(key) === entry, + before: async () => !(await blockedWslDistroForPath(entry.repoPath, entry.options.wslDistro)), + schedule: (run) => { + const work = trackPreparationWork(worktreePreparationGit.run(run)) + trackPreparationDiscard(work) + return work + }, + disposed: () => { + if (obligations.get(key) === entry) { + obligations.delete(key) + } + } + }) +} + +export function releasePreparationObligation(entry: PreparationEntry): void { + const key = obligationKey(entry) + if (obligations.get(key) !== entry) { + return + } + obligations.delete(key) + entry.operation.release() +} + export async function discardPreparationEntry(entry: PreparationEntry): Promise { if (!entry.checkoutStarted) { return } - // Claim cleanup before yielding so queued refresh failures cannot discard the same checkout. + // Claim submission before yielding; the capacity owner survives this claim. entry.checkoutStarted = false - await discardPreparationWithRetry({ - hostKey: preparationHostKey(entry.repoPathKey, entry.wslDistro), - repoPath: entry.repoPath, - preparedPath: entry.preparedPath, - lockReason: entry.lockReason, - options: entry.options, - operation: entry.operation - }) -} - -/** Let test reset await detached discards before clearing the registry. */ -export function trackPreparationDiscard(work: Promise): void { - inFlightDiscards.add(work) - void work.finally(() => inFlightDiscards.delete(work)) -} - -function pendingKey(target: PreparationDiscardTarget): string { - return `${target.hostKey}\0${target.preparedPath}` -} - -async function runDiscard(target: PreparationDiscardTarget, attempts: number): Promise { - try { - const discard = (options: AddWorktreeOptions): Promise => - discardPreparedWorktree(target.repoPath, target.preparedPath, options, target.lockReason) - await (target.operation ? target.operation.discard() : discard(target.options)) - } catch (error) { - // Checkout failure may already have removed the registration; do not retry missing or foreign entries. - if (error instanceof WorktreePreparationLockOwnershipError || isOrphanedWorktreeError(error)) { - return - } - // Bounded: a path that never becomes removable must not tax every later preparation. - if (attempts >= PREPARATION_DISCARD_ATTEMPT_LIMIT) { - console.warn( - `[worktree-create] prepared checkout could not be discarded in ${attempts} attempts; ${target.preparedPath} stays registered until this process exits`, - error - ) - return - } - pendingDiscards.set(pendingKey(target), { ...target, attempts }) + if (obligations.get(obligationKey(entry)) === entry) { + await entry.operation.discard() } } -/** Record failed discards for bounded retries. */ -export function discardPreparationWithRetry( - target: PreparationDiscardTarget, - attempts = 1 -): Promise { - // Claim the record so an overlapping retry pass cannot run the same discard twice. - pendingDiscards.delete(pendingKey(target)) - const discard = trackPreparationWork(runDiscard(target, attempts)) - trackPreparationDiscard(discard) - return discard +export function trackPreparationDiscard(work: Promise): void { + inFlightDiscards.add(work) + void work.then( + () => inFlightDiscards.delete(work), + () => inFlightDiscards.delete(work) + ) } -export function retryPendingPreparationDiscards(hostKey: string): Promise { - const pending = [...pendingDiscards.values()].filter((target) => target.hostKey === hostKey) +export function retryPendingPreparationDiscards(hostKey?: string): Promise { return Promise.all( - pending.map(({ attempts, ...target }) => discardPreparationWithRetry(target, attempts + 1)) + [...obligations.values()] + .filter( + (entry) => + entry.operation.needsDiscardRetry && + (!hostKey || preparationHostKey(entry.repoPathKey, entry.wslDistro) === hostKey) + ) + .map((entry) => entry.operation.discard()) ).then(() => undefined) } -/** Settle background discards before clearing their registry. */ export async function resetPendingPreparationDiscardsForTests(): Promise { while (inFlightDiscards.size > 0) { - await Promise.all(inFlightDiscards) + await Promise.allSettled(inFlightDiscards) } - pendingDiscards.clear() + for (const entry of obligations.values()) { + entry.operation.release() + } + obligations.clear() } diff --git a/src/main/workspaces/creation/preparation/worktree-preparation-fetch-barrier.test.ts b/src/main/workspaces/creation/preparation/worktree-preparation-fetch-barrier.test.ts index 13f9e2e4e5c..2cc102b5fe1 100644 --- a/src/main/workspaces/creation/preparation/worktree-preparation-fetch-barrier.test.ts +++ b/src/main/workspaces/creation/preparation/worktree-preparation-fetch-barrier.test.ts @@ -81,7 +81,8 @@ describe('prepared checkout shared fetch barrier', () => { repo.path, entry.preparedPath, expect.objectContaining({ signal: undefined }), - entry.lockReason + entry.lockReason, + null ) expect(listPreparations()).toEqual([]) } finally { diff --git a/src/main/workspaces/creation/preparation/worktree-preparation-lifetime-real-git.test.ts b/src/main/workspaces/creation/preparation/worktree-preparation-lifetime-real-git.test.ts index 029738ac333..f8d573bfac3 100644 --- a/src/main/workspaces/creation/preparation/worktree-preparation-lifetime-real-git.test.ts +++ b/src/main/workspaces/creation/preparation/worktree-preparation-lifetime-real-git.test.ts @@ -1,13 +1,17 @@ -import { execFileSync } from 'node:child_process' +import { fixture, git, removeLifetimeFixtures } from './worktree-preparation-lifetime.test-fixture' +import type * as FilePromises from 'node:fs/promises' +import { toHostFilesystemPath } from '../../../filesystem/host-tree-removal' +import * as gitReadCache from '../../../git/source-control/git-read-cache-invalidation' +import * as gitAdmin from '../../../../shared/git/metadata/git-common-directory' +import { preparationPathKey } from './worktree-create-preparation-claim' +import * as staleCleanup from './worktree-create-preparation-stale-cleanup' import { existsSync } from 'node:fs' -import { mkdtemp, readFile, realpath, rm, writeFile } from 'node:fs/promises' -import { tmpdir } from 'node:os' -import { join } from 'node:path' +import { mkdir, readFile, rm, writeFile } from 'node:fs/promises' +import { dirname, join } from 'node:path' import { afterEach, expect, it, vi } from 'vitest' -import type { RuntimeStore } from '../../../runtime/construction/runtime-store-contract' -import type { AddWorktreeOptions } from '../../../git/worktrees/worktree-operation-options' +import * as wslGate from '../../../wsl/filesystem/wsl-unc-access-gate' +import { preparationCapacityUsed } from './worktree-preparation-discard-retry' import * as gitRunner from '../../../git/command-runner/git-exec-file' -import { createRuntimeLocalGitWorktree } from '../../../runtime/workspaces/creation/runtime-local-git-worktree-create' import { createWorktreeCreateTimingRecorder } from '../worktree-create-timing' import { _resetWorktreeCreatePreparationsForTests } from './worktree-create-preparation' import { @@ -16,94 +20,29 @@ import { startPreparation } from './worktree-create-preparation-pool' -const roots: string[] = [] -function git(cwd: string, ...args: string[]): string { - return execFileSync('git', args, { cwd, encoding: 'utf8', stdio: 'pipe' }).trim() -} - -async function fixture() { - const root = await realpath(await mkdtemp(join(tmpdir(), 'orca-preparation-lifetime-'))) - roots.push(root) - const repoPath = join(root, 'repo') - execFileSync('git', ['init', '--quiet', repoPath]) - git(repoPath, 'symbolic-ref', 'HEAD', 'refs/heads/main') - git(repoPath, 'config', 'user.email', 'test@example.com') - git(repoPath, 'config', 'user.name', 'Test User') - git(repoPath, 'config', 'core.autocrlf', 'false') - await writeFile(join(repoPath, 'version.txt'), 'original\n') - git(repoPath, 'add', '.') - git(repoPath, 'commit', '--quiet', '-m', 'initial') - const repo = { - id: 'lifetime-repo', - path: repoPath, - displayName: 'Repo', - addedAt: 0, - badgeColor: '' - } - const arm = ( - beforeMaterialization?: Promise, - options: AddWorktreeOptions = {}, - baseBranch = 'main' - ) => - startPreparation({ - repoPath, - workspaceRoot: root, - baseBranch, - canonicalBase: baseBranch === 'origin/main' ? 'refs/remotes/origin/main' : 'refs/heads/main', - options, - beforeMaterialization - }) - const create = async ( - branch: string, - baseBranch = 'main', - options: AddWorktreeOptions = {}, - waiting?: () => void, - timing = createWorktreeCreateTimingRecorder() - ) => { - const time = timing.time.bind(timing) - timing.time = (phase, operation) => { - if (phase === 'prepared_checkout_wait') { - waiting?.() +const rootMkdirFailure = vi.hoisted((): { path?: string } => ({})) +vi.mock('node:fs/promises', async (importOriginal) => { + const actual = await importOriginal() + return { + ...actual, + mkdir: (...args: Parameters) => { + if (String(args[0]) === rootMkdirFailure.path) { + return Promise.reject( + Object.assign(new Error('read-only workspace root'), { code: 'EACCES' }) + ) } - return time(phase, operation) - } - const rearm = { fire: () => {} } - try { - return await createRuntimeLocalGitWorktree({ - request: { repoSelector: repo.id, name: branch }, - repo, - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: no metadata/push/name-retirement operation is requested at this Git-only host boundary. - store: {} as RuntimeStore, - settings: { - workspaceDir: root, - nestWorkspaces: false, - refreshLocalBaseRefOnWorktreeCreate: false - }, - base: { baseBranch, remoteTrackingBase: null, deferredRefresh: null }, - workspaceRoot: root, - branchName: branch, - worktreePath: join(root, branch), - checkoutExistingBranch: false, - localWorktreeGitOptions: options, - // Foreground freshness already completed; the obsolete speculative barrier is independent. - baseRefRefresh: { finish: async () => {} }, - rearm, - timing - }) - } finally { - timing.finish() - rearm.fire() + return actual.mkdir(...args) } } - return { root, repoPath, arm, create } -} +}) afterEach(async () => { vi.useRealTimers() vi.restoreAllMocks() + rootMkdirFailure.path = undefined vi.unstubAllEnvs() await _resetWorktreeCreatePreparationsForTests() - await Promise.all(roots.splice(0).map((root) => rm(root, { recursive: true, force: true }))) + await removeLifetimeFixtures() }) it.each(['initial', 'queued'])( @@ -203,7 +142,7 @@ it('propagates caller cancellation without falling back to a phantom worktree', expect(await readFile(join(root, 'after-cancel', 'version.txt'), 'utf8')).toBe('original\n') }) -it('keeps a locked artifact after writer termination cannot be verified, even when proof arrives late', async () => { +it('parks an unproven writer and autonomously removes its hidden checkout after late proof', async () => { const { root, arm, create } = await fixture() const failed = Promise.withResolvers() const started = Promise.withResolvers() @@ -230,27 +169,32 @@ it('keeps a locked artifact after writer termination cannot be verified, even wh await creation await preparation await vi.advanceTimersByTimeAsync(30_000) + expect(existsSync(join(preparedPath, '.git'))).toBe(true) + // Repeated requests cannot revive or wait again on the same parked writer. + await arm() + await arm() terminated.resolve() + await vi.waitFor(() => expect(existsSync(preparedPath)).toBe(false)) await create('after-writer') expect(await readFile(join(root, 'writer-fallback', 'version.txt'), 'utf8')).toBe('original\n') - expect(existsSync(join(preparedPath, '.git'))).toBe(true) - expect(existsSync(join(preparedPath, 'version.txt'))).toBe(false) - expect(git(preparedPath, 'worktree', 'list', '--porcelain')).toContain( - 'locked orca-create-preparation:' + expect(git(root, '-C', join(root, 'repo'), 'worktree', 'list', '--porcelain')).not.toContain( + preparedPath ) }) -it('never spawns a destructive remove queued beyond retirement abandonment', async () => { +it('revokes an expired queued remove and admits fresh owned cleanup on its exact wake', async () => { const { repoPath, arm, create } = await fixture() const queued = Promise.withResolvers() const admitted = Promise.withResolvers() const attempted = Promise.withResolvers() + let first = true vi.useFakeTimers({ toFake: ['Date', 'setTimeout', 'clearTimeout'] }) await arm() const [entry] = listPreparations() const run = gitRunner.gitExecFileAsync vi.spyOn(gitRunner, 'gitExecFileAsync').mockImplementation(async (args, options) => { - if (args.includes('remove')) { + if (args.includes('remove') && first) { + first = false queued.resolve() await admitted.promise try { @@ -266,7 +210,523 @@ it('never spawns a destructive remove queued beyond retirement abandonment', asy await vi.advanceTimersByTimeAsync(30_000) admitted.resolve() await attempted.promise + await vi.waitFor(() => expect(existsSync(entry.preparedPath)).toBe(false)) await create('after-abandoned-discard') - expect(await readFile(join(entry.preparedPath, 'version.txt'), 'utf8')).toBe('original\n') - expect(git(repoPath, 'worktree', 'list', '--porcelain')).toContain(entry.lockReason) + expect(git(repoPath, 'worktree', 'list', '--porcelain')).not.toContain(entry.lockReason) }) + +it.each([3, 30])( + 'bounds physical preparations under %i requests while cleanup is exhausted', + async (requests) => { + const owners = await Promise.all([fixture(), fixture(), fixture()]) + for (const owner of owners) { + await owner.arm() + } + const entries = listPreparations() + const run = gitRunner.gitExecFileAsync + vi.spyOn(gitRunner, 'gitExecFileAsync').mockImplementation(async (args, options) => { + if (args.includes('remove')) { + throw new Error('checkout temporarily locked') + } + return run(args, options) + }) + for (const entry of entries) { + discardRepoPreparations(entry.repoPathKey) + } + const other = await fixture() + for (let index = 0; index < requests; index += 1) { + await other.arm() + } + expect( + entries.filter((entry) => existsSync(join(entry.preparedPath, 'version.txt'))) + ).toHaveLength(3) + expect(listPreparations()).toHaveLength(0) + await other.create('normal-create') + expect(await readFile(join(other.root, 'normal-create', 'version.txt'), 'utf8')).toBe( + 'original\n' + ) + } +) + +it('retries another repository before declining a full-pool request', async () => { + const owners = await Promise.all([fixture(), fixture(), fixture()]) + for (const owner of owners) { + await owner.arm() + } + const entries = listPreparations() + const run = gitRunner.gitExecFileAsync + let fail = true + const failed = Promise.withResolvers() + vi.spyOn(gitRunner, 'gitExecFileAsync').mockImplementation(async (args, options) => { + if (args.includes('remove') && fail) { + failed.resolve() + throw new Error('transient checkout lock') + } + return run(args, options) + }) + discardRepoPreparations(entries[0].repoPathKey) + await failed.promise + await entries[0].operation.discard() + fail = false + const other = await fixture() + await other.arm() + expect(existsSync(entries[0].preparedPath)).toBe(false) + expect(listPreparations().some((entry) => entry.repoPath === other.repoPath)).toBe(true) +}) + +it.each(['hidden', 'moved', 'unproven-target'])( + 'preserves finalization recovery for %s failure through the create consumer', + async (kind) => { + const { root, repoPath, arm, create } = await fixture() + await arm() + const [entry] = listPreparations() + if (kind === 'hidden') { + await writeFile(join(repoPath, 'version.txt'), 'requested\n') + git(repoPath, 'commit', '--quiet', '-am', 'new base') + } + const target = join(root, 'finalization-recovery') + const proof = Promise.withResolvers() + const failed = Promise.withResolvers() + const originalError = new Error('prepared finalization failed') + const run = gitRunner.gitExecFileAsync + let injected = false + vi.spyOn(gitRunner, 'gitExecFileAsync').mockImplementation(async (args, options) => { + const selected = + kind === 'hidden' + ? args.includes('reset') + : kind === 'moved' + ? args.includes('checkout') + : args.includes('move') + if (selected && !injected) { + injected = true + if (kind !== 'moved') { + options.observeChildTermination?.(proof.promise, true) + } + if (kind !== 'hidden') { + await run(args, options) + } + failed.resolve() + throw originalError + } + return run(args, options) + }) + vi.useFakeTimers({ toFake: ['Date', 'setTimeout', 'clearTimeout'] }) + const creating = create('finalization-recovery') + const outcome = + kind === 'unproven-target' ? expect(creating).rejects.toBe(originalError) : creating + await failed.promise + if (kind !== 'moved') { + await vi.advanceTimersByTimeAsync(30_000) + } + await outcome + if (kind === 'moved') { + expect(await readFile(join(target, 'version.txt'), 'utf8')).toBe('original\n') + expect(git(target, 'branch', '--show-current')).toBe('finalization-recovery') + } else { + if (kind === 'unproven-target') { + expect(git(repoPath, 'branch', '--list', 'finalization-recovery')).toBe('') + } else { + expect(await readFile(join(target, 'version.txt'), 'utf8')).toBe('requested\n') + expect(existsSync(entry.preparedPath)).toBe(true) + } + proof.resolve() + if (kind === 'hidden') { + await vi.waitFor(() => expect(existsSync(entry.preparedPath)).toBe(false)) + } else { + await writeFile(join(target, 'user.txt'), 'preserve returned target\n') + await arm() + expect(await readFile(join(target, 'user.txt'), 'utf8')).toBe('preserve returned target\n') + } + } + } +) + +it.each(['missing', 'foreign', 'unregistered'])( + 'retains unknown capacity but releases affirmative %s authority', + async (kind) => { + const { arm } = await fixture() + await arm() + const [entry] = listPreparations() + const lock = git(entry.preparedPath, 'rev-parse', '--git-path', 'locked') + await (kind === 'foreign' + ? writeFile(lock, 'replacement owner\n') + : rm(kind === 'unregistered' ? dirname(lock) : lock, { recursive: true })) + discardRepoPreparations(entry.repoPathKey) + await entry.operation.discard() + expect(existsSync(join(entry.preparedPath, 'version.txt'))).toBe(true) + expect(preparationCapacityUsed()).toBe(kind === 'foreign' ? 0 : 1) + } +) + +it('leaves stopped hosts untouched and retries only after the host becomes eligible', async () => { + const { arm } = await fixture() + await arm() + const [entry] = listPreparations() + const blocked = vi + .spyOn(wslGate, 'blockedWslDistroForPath') + .mockResolvedValue({ distro: 'stopped', state: 'stopped' }) + discardRepoPreparations(entry.repoPathKey) + await entry.operation.discard() + expect(existsSync(join(entry.preparedPath, 'version.txt'))).toBe(true) + await arm() + expect(existsSync(entry.preparedPath)).toBe(true) + blocked.mockResolvedValue(null) + await arm() + await vi.waitFor(() => expect(existsSync(entry.preparedPath)).toBe(false)) +}) + +it('releases exhausted capacity when the final admitted removal completes late', async () => { + const { arm } = await fixture() + await arm() + const [entry] = listPreparations() + const run = gitRunner.gitExecFileAsync + const admitted = Promise.withResolvers() + const proof = Promise.withResolvers() + let failures = 0 + vi.spyOn(gitRunner, 'gitExecFileAsync').mockImplementation(async (args, options) => { + if (args.includes('remove')) { + if (failures++ < 2) { + throw new Error('temporary file lock') + } + const result = await run(args, options) + options.observeChildTermination?.(proof.promise, true) + admitted.resolve() + return result + } + return run(args, options) + }) + discardRepoPreparations(entry.repoPathKey) + await entry.operation.discard() + await entry.operation.discard() + vi.useFakeTimers({ toFake: ['Date', 'setTimeout', 'clearTimeout'] }) + const cleanup = entry.operation.discard() + await admitted.promise + await vi.advanceTimersByTimeAsync(30_000) + await cleanup + expect(preparationCapacityUsed()).toBe(1) + proof.resolve() + await vi.waitFor(() => expect(preparationCapacityUsed()).toBe(0)) +}) + +it('coalesces healthy fourth-key admission until eviction is proven, then consumes its requested tip', async () => { + const owners = await Promise.all([fixture(), fixture(), fixture()]) + for (const owner of owners) { + await owner.arm() + } + const entries = listPreparations() + const fourth = await fixture() + const removing = Promise.withResolvers() + const proof = Promise.withResolvers() + const obsoleteFetch = Promise.withResolvers() + const run = gitRunner.gitExecFileAsync + vi.spyOn(gitRunner, 'gitExecFileAsync').mockImplementation((args, options) => { + if (args.includes('remove') && options.cwd === owners[0].repoPath) { + removing.resolve() + return run(args, { + ...options, + observeChildTermination: (terminated, writes) => + options.observeChildTermination?.( + writes ? Promise.all([terminated, proof.promise]).then(() => {}) : terminated, + writes + ) + }) + } + return run(args, options) + }) + const first = startPreparation( + { + repoPath: fourth.repoPath, + workspaceRoot: fourth.root, + baseBranch: 'main', + canonicalBase: 'refs/heads/main', + options: {}, + beforeMaterialization: obsoleteFetch.promise + }, + 'automatic' + ) + try { + await removing.promise + const joined = fourth.arm(Promise.resolve()) + expect(preparationCapacityUsed()).toBe(3) + expect(listPreparations().map((entry) => entry.preparedPath)).toEqual( + entries.slice(1).map((entry) => entry.preparedPath) + ) + proof.resolve() + await Promise.all([first, joined]) + expect(listPreparations()).toHaveLength(3) + const timing = createWorktreeCreateTimingRecorder() + await fourth.create('fourth-hit', 'main', {}, undefined, timing) + expect(timing.finish().preparedCheckout).toMatchObject({ status: 'hit', origin: 'prefetch' }) + expect(git(join(fourth.root, 'fourth-hit'), 'branch', '--show-current')).toBe('fourth-hit') + expect(await readFile(join(fourth.root, 'fourth-hit', 'version.txt'), 'utf8')).toBe( + 'original\n' + ) + } finally { + proof.resolve() + obsoleteFetch.resolve() + await first.catch(() => {}) + } +}) + +it('admits with free capacity and reuses an exact full-pool hit while matching cleanup is pending', async () => { + const owner = await fixture() + git(owner.repoPath, 'update-ref', 'refs/remotes/origin/main', 'HEAD') + await owner.arm() + const [retired] = listPreparations() + const failed = Promise.withResolvers() + const second = Promise.withResolvers() + const releaseSecond = Promise.withResolvers() + const third = Promise.withResolvers() + const releaseThird = Promise.withResolvers() + const run = gitRunner.gitExecFileAsync + let attempt = 0 + vi.spyOn(gitRunner, 'gitExecFileAsync').mockImplementation(async (args, options) => { + if (args.includes('remove') && options.cwd === owner.repoPath) { + attempt += 1 + if (attempt === 1) { + failed.resolve() + throw new Error('transient checkout lock') + } + if (attempt === 2) { + second.resolve() + await releaseSecond.promise + throw new Error('still locked') + } + third.resolve() + await releaseThird.promise + } + return run(args, options) + }) + try { + discardRepoPreparations(retired.repoPathKey) + await failed.promise + await retired.operation.discard() + const free = owner.arm(undefined, {}, 'origin/main') + await second.promise + await free + const other = await fixture() + await other.arm() + expect(preparationCapacityUsed()).toBe(3) + releaseSecond.resolve() + await retired.operation.discard() + const exact = owner.arm(undefined, {}, 'origin/main') + await third.promise + await exact + const timing = createWorktreeCreateTimingRecorder() + await owner.create('retry-isolated', 'origin/main', {}, undefined, timing) + expect(timing.finish().preparedCheckout?.status).toBe('hit') + expect(await readFile(join(owner.root, 'retry-isolated', 'version.txt'), 'utf8')).toBe( + 'original\n' + ) + } finally { + releaseSecond.resolve() + releaseThird.resolve() + } +}) + +it.each(['removed', 'canceled'])( + 'does not publish an admission invalidated while %s', + async (kind) => { + const owners = await Promise.all([fixture(), fixture(), fixture()]) + for (const owner of owners) { + await owner.arm() + } + const fourth = await fixture() + const removing = Promise.withResolvers() + const proof = Promise.withResolvers() + const run = gitRunner.gitExecFileAsync + vi.spyOn(gitRunner, 'gitExecFileAsync').mockImplementation((args, options) => { + if (args.includes('remove') && options.cwd === owners[0].repoPath) { + removing.resolve() + return run(args, { + ...options, + observeChildTermination: (terminated, writes) => + options.observeChildTermination?.( + writes ? Promise.all([terminated, proof.promise]).then(() => {}) : terminated, + writes + ) + }) + } + return run(args, options) + }) + const controller = new AbortController() + const pending = fourth.arm(undefined, { signal: controller.signal }) + try { + await removing.promise + if (kind === 'removed') { + discardRepoPreparations(preparationPathKey(fourth.repoPath)) + } else { + controller.abort() + } + await pending + await fourth.create('foreground-during-cleanup') + expect( + await readFile(join(fourth.root, 'foreground-during-cleanup', 'version.txt'), 'utf8') + ).toBe('original\n') + proof.resolve() + await owners[0].arm() + expect(listPreparations().some((entry) => entry.repoPath === fourth.repoPath)).toBe(false) + } finally { + proof.resolve() + controller.abort() + await pending.catch(() => {}) + } + } +) + +it('bounds distinct capacity waiters while allowing three requests to recover', async () => { + const owners = await Promise.all([fixture(), fixture(), fixture()]) + for (const owner of owners) { + await owner.arm() + } + const request = await fixture() + const proof = Promise.withResolvers() + const removing = Promise.withResolvers() + const run = gitRunner.gitExecFileAsync + vi.spyOn(gitRunner, 'gitExecFileAsync').mockImplementation((args, options) => { + if (args.includes('remove')) { + removing.resolve() + return run(args, { + ...options, + observeChildTermination: (terminated, writes) => + options.observeChildTermination?.( + writes ? Promise.all([terminated, proof.promise]).then(() => {}) : terminated, + writes + ) + }) + } + return run(args, options) + }) + const roots = Array.from({ length: 30 }, (_, index) => join(request.root, `request-${index}`)) + const pending = roots.map((workspaceRoot) => + startPreparation({ + repoPath: request.repoPath, + workspaceRoot, + baseBranch: 'main', + canonicalBase: 'refs/heads/main', + options: {} + }) + ) + try { + await removing.promise + await Promise.all(pending.slice(3)) + expect(preparationCapacityUsed()).toBe(3) + expect(roots.slice(3).some((root) => existsSync(root))).toBe(false) + proof.resolve() + await Promise.all(pending) + expect(preparationCapacityUsed()).toBe(3) + expect( + listPreparations() + .map((entry) => entry.workspaceRoot) + .sort() + ).toEqual(roots.slice(0, 3).sort()) + expect(roots.slice(3).some((root) => existsSync(root))).toBe(false) + } finally { + proof.resolve() + await Promise.allSettled(pending) + } +}) + +it('declines after a competing request takes the freed slot without evicting another victim', async () => { + const owners = await Promise.all([fixture(), fixture(), fixture()]) + for (const owner of owners) { + await owner.arm() + } + const entries = listPreparations() + const fourth = await fixture() + const competitor = await fixture() + const validating = Promise.withResolvers() + const release = Promise.withResolvers() + let checks = 0 + const gate = wslGate.blockedWslDistroForPath + vi.spyOn(wslGate, 'blockedWslDistroForPath').mockImplementation(async (path, distro, options) => { + if (path === fourth.repoPath && ++checks === 2) { + validating.resolve() + await release.promise + } + return gate(path, distro, options) + }) + const pending = fourth.arm() + try { + await validating.promise + await competitor.arm() + release.resolve() + await pending + expect(preparationCapacityUsed()).toBe(3) + expect(entries.slice(1).every((entry) => existsSync(entry.preparedPath))).toBe(true) + expect(listPreparations().some((entry) => entry.repoPath === fourth.repoPath)).toBe(false) + await fourth.create('competing-fallback') + expect(await readFile(join(fourth.root, 'competing-fallback', 'version.txt'), 'utf8')).toBe( + 'original\n' + ) + } finally { + release.resolve() + await pending.catch(() => {}) + } +}) + +it.each([750, 7500])( + 'avoids cleanup reconciliation of %i unrelated registrations when no add was issued', + async (width) => { + const owner = await fixture() + await owner.arm() + const [primer] = listPreparations() + discardRepoPreparations(primer.repoPathKey) + await primer.operation.discard() + const adminRoot = join(owner.repoPath, '.git', 'worktrees') + const head = git(owner.repoPath, 'rev-parse', 'HEAD') + for (let index = 0; index < width; index += 1) { + const admin = join(adminRoot, `unrelated-${index}`) + await mkdir(admin, { recursive: true }) + await writeFile(join(admin, 'gitdir'), `${join(owner.root, `unrelated-${index}`, '.git')}\n`) + await writeFile(join(admin, 'commondir'), '../..\n') + await writeFile(join(admin, 'HEAD'), `${head}\n`) + } + const blockedRoot = join(owner.root, 'read-only-root') + rootMkdirFailure.path = toHostFilesystemPath(join(blockedRoot, '.orca-preparing')) + const read = gitAdmin.readGitAdminFile + let unrelatedReads = 0 + vi.spyOn(gitAdmin, 'readGitAdminFile').mockImplementation((path, signal) => { + if (path.startsWith(join(adminRoot, 'unrelated-')) && path.endsWith('gitdir')) { + unrelatedReads += 1 + } + return read(path, signal) + }) + const invalidations = vi.spyOn(gitReadCache, 'runWithGitReadCacheInvalidation') + const lookups = vi.spyOn(gitRunner, 'gitExecFileAsync') + const staleScan = vi.spyOn(staleCleanup, 'startStalePreparationCleanup').mockResolvedValue() + for (let request = 0; request < 3; request += 1) { + await expect( + startPreparation({ + repoPath: owner.repoPath, + workspaceRoot: blockedRoot, + baseBranch: 'main', + canonicalBase: 'refs/heads/main', + options: {} + }) + ).rejects.toMatchObject({ code: 'EACCES' }) + await vi.waitFor(() => expect(preparationCapacityUsed()).toBe(0)) + } + expect(unrelatedReads).toBe(0) + expect(invalidations).not.toHaveBeenCalled() + expect(lookups).not.toHaveBeenCalled() + lookups.mockRestore() + staleScan.mockRestore() + const run = gitRunner.gitExecFileAsync + let issuedOperation: typeof primer.operation | undefined + vi.spyOn(gitRunner, 'gitExecFileAsync').mockImplementation(async (args, options) => { + const result = await run(args, options) + if (args.includes('add') && args.includes('--no-checkout')) { + issuedOperation = listPreparations()[0].operation + await rm(args.at(-2)!, { recursive: true, force: true }) + throw new Error('issued add lost its public result') + } + return result + }) + await expect(owner.arm()).rejects.toThrow('issued add lost its public result') + expect(issuedOperation).toBeDefined() + await issuedOperation!.discard() + expect(preparationCapacityUsed()).toBe(0) + expect(unrelatedReads).toBe(width) + } +) diff --git a/src/main/workspaces/creation/preparation/worktree-preparation-lifetime.test-fixture.ts b/src/main/workspaces/creation/preparation/worktree-preparation-lifetime.test-fixture.ts new file mode 100644 index 00000000000..4b3d9e22ade --- /dev/null +++ b/src/main/workspaces/creation/preparation/worktree-preparation-lifetime.test-fixture.ts @@ -0,0 +1,95 @@ +import { execFileSync } from 'node:child_process' +import { mkdtemp, realpath, rm, writeFile } from 'node:fs/promises' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import type { RuntimeStore } from '../../../runtime/construction/runtime-store-contract' +import type { AddWorktreeOptions } from '../../../git/worktrees/worktree-operation-options' +import { createRuntimeLocalGitWorktree } from '../../../runtime/workspaces/creation/runtime-local-git-worktree-create' +import { createWorktreeCreateTimingRecorder } from '../worktree-create-timing' +import { startPreparation } from './worktree-create-preparation-pool' + +const roots: string[] = [] +export function git(cwd: string, ...args: string[]): string { + return execFileSync('git', args, { cwd, encoding: 'utf8', stdio: 'pipe' }).trim() +} + +export async function fixture() { + const root = await realpath(await mkdtemp(join(tmpdir(), 'orca-preparation-lifetime-'))) + roots.push(root) + const repoPath = join(root, 'repo') + execFileSync('git', ['init', '--quiet', repoPath]) + git(repoPath, 'symbolic-ref', 'HEAD', 'refs/heads/main') + git(repoPath, 'config', 'user.email', 'test@example.com') + git(repoPath, 'config', 'user.name', 'Test User') + git(repoPath, 'config', 'core.autocrlf', 'false') + await writeFile(join(repoPath, 'version.txt'), 'original\n') + git(repoPath, 'add', '.') + git(repoPath, 'commit', '--quiet', '-m', 'initial') + const repo = { + id: 'lifetime-repo', + path: repoPath, + displayName: 'Repo', + addedAt: 0, + badgeColor: '' + } + const arm = ( + beforeMaterialization?: Promise, + options: AddWorktreeOptions = {}, + baseBranch = 'main' + ) => + startPreparation({ + repoPath, + workspaceRoot: root, + baseBranch, + canonicalBase: baseBranch === 'origin/main' ? 'refs/remotes/origin/main' : 'refs/heads/main', + options, + beforeMaterialization + }) + const create = async ( + branch: string, + baseBranch = 'main', + options: AddWorktreeOptions = {}, + waiting?: () => void, + timing = createWorktreeCreateTimingRecorder() + ) => { + const time = timing.time.bind(timing) + timing.time = (phase, operation) => { + if (phase === 'prepared_checkout_wait') { + waiting?.() + } + return time(phase, operation) + } + const rearm = { fire: () => {} } + try { + return await createRuntimeLocalGitWorktree({ + request: { repoSelector: repo.id, name: branch }, + repo, + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: no metadata/push/name-retirement operation is requested at this Git-only host boundary. + store: {} as RuntimeStore, + settings: { + workspaceDir: root, + nestWorkspaces: false, + refreshLocalBaseRefOnWorktreeCreate: false + }, + base: { baseBranch, remoteTrackingBase: null, deferredRefresh: null }, + workspaceRoot: root, + branchName: branch, + worktreePath: join(root, branch), + checkoutExistingBranch: false, + localWorktreeGitOptions: options, + // Foreground freshness already completed; the obsolete speculative barrier is independent. + baseRefRefresh: { finish: async () => {} }, + rearm, + timing + }) + } finally { + timing.finish() + rearm.fire() + } + } + return { root, repoPath, arm, create } +} + +export async function removeLifetimeFixtures(): Promise { + await Promise.all(roots.splice(0).map((root) => rm(root, { recursive: true, force: true }))) +} diff --git a/src/main/workspaces/creation/preparation/worktree-preparation-maintenance-real-git.test.ts b/src/main/workspaces/creation/preparation/worktree-preparation-maintenance-real-git.test.ts new file mode 100644 index 00000000000..8b873d66d16 --- /dev/null +++ b/src/main/workspaces/creation/preparation/worktree-preparation-maintenance-real-git.test.ts @@ -0,0 +1,203 @@ +import type * as FilePromises from 'node:fs/promises' +import { existsSync } from 'node:fs' +import { dirname, join } from 'node:path' +import { afterEach, expect, it, vi } from 'vitest' +import * as gitRunner from '../../../git/command-runner/git-exec-file' +import { toHostFilesystemPath } from '../../../filesystem/host-tree-removal' +import { preparationCapacityUsed } from './worktree-preparation-discard-retry' +import { _resetWorktreeCreatePreparationsForTests } from './worktree-create-preparation' +import { discardRepoPreparations, listPreparations } from './worktree-create-preparation-pool' +import { fixture, git, removeLifetimeFixtures } from './worktree-preparation-lifetime.test-fixture' +import { + _resetLocalRepoRefMaintenanceForTests, + createLocalRepoRefMaintenanceTarget, + getLocalRepoRefMaintenance +} from '../../../git/refs/maintenance/local-repo-ref-maintenance' + +const identityRead = vi.hoisted( + (): { path?: string; started?: () => void; resume?: Promise } => ({}) +) +vi.mock('node:fs/promises', async (importOriginal) => { + const actual = await importOriginal() + return { + ...actual, + realpath: async (...args: Parameters) => { + if (String(args[0]) === identityRead.path) { + identityRead.path = undefined + identityRead.started?.() + await identityRead.resume + } + return actual.realpath(...args) + } + } +}) + +afterEach(async () => { + vi.useRealTimers() + vi.restoreAllMocks() + identityRead.path = undefined + identityRead.started = undefined + identityRead.resume = undefined + await _resetWorktreeCreatePreparationsForTests() + _resetLocalRepoRefMaintenanceForTests() + await removeLifetimeFixtures() +}) + +async function attemptMaintenance(repoPath: string): Promise { + const maintenance = getLocalRepoRefMaintenance() + maintenance.arm(createLocalRepoRefMaintenanceTarget({ key: repoPath, repoPath })) + await vi.advanceTimersByTimeAsync(1000) + await maintenance.whenAttemptSettled() +} + +function enableMaintenance(): void { + _resetLocalRepoRefMaintenanceForTests({ + isBusy: () => false, + quietPeriodMs: 1000, + looseRefThreshold: 1 + }) +} + +it('retires a parked identity-read lease, then removes only through its fresh native-settlement wake', async () => { + const { repoPath, arm, create } = await fixture() + const other = await fixture() + await arm() + const [entry] = listPreparations() + const lock = git(entry.preparedPath, 'rev-parse', '--git-path', 'locked') + const readStarted = Promise.withResolvers() + const readReleased = Promise.withResolvers() + identityRead.path = dirname(toHostFilesystemPath(lock)) + identityRead.started = readStarted.resolve + identityRead.resume = readReleased.promise + const run = gitRunner.gitExecFileAsync + const removalPermissions: boolean[] = [] + vi.spyOn(gitRunner, 'gitExecFileAsync').mockImplementation((args, options) => { + if (args.includes('remove')) { + removalPermissions.push(options.canStart?.() !== false) + } + return run(args, options) + }) + vi.useFakeTimers({ toFake: ['Date', 'setTimeout', 'clearTimeout'] }) + enableMaintenance() + discardRepoPreparations(entry.repoPathKey) + await readStarted.promise + const disposal = entry.operation.discard() + try { + await vi.advanceTimersByTimeAsync(30_000) + await disposal + expect(preparationCapacityUsed()).toBe(1) + expect(existsSync(entry.preparedPath)).toBe(true) + await attemptMaintenance(other.repoPath) + expect(existsSync(join(other.repoPath, '.git', 'packed-refs'))).toBe(true) + await arm() + await arm() + expect(removalPermissions).toEqual([]) + readReleased.resolve() + await vi.waitFor(() => { + expect(existsSync(entry.preparedPath)).toBe(false) + expect(preparationCapacityUsed()).toBe(1) + }) + expect(removalPermissions).toEqual([true]) + expect(git(repoPath, 'worktree', 'list', '--porcelain')).not.toContain(entry.lockReason) + await create('after-read-lease') + expect(git(repoPath, 'show', 'after-read-lease:version.txt')).toBe('original') + } finally { + readReleased.resolve() + } +}) + +it('keeps original pause acquisition as its wake and never releases the successor lease', async () => { + const { arm } = await fixture() + const other = await fixture() + await arm() + const [entry] = listPreparations() + vi.useFakeTimers({ toFake: ['Date', 'setTimeout', 'clearTimeout'] }) + enableMaintenance() + const maintenance = getLocalRepoRefMaintenance() + const acquireLease = maintenance.pause.bind(maintenance) + const acquiring = Promise.withResolvers() + const acquired = Promise.withResolvers() + const successor = Promise.withResolvers() + const successorReady = Promise.withResolvers() + const releases: string[] = [] + vi.spyOn(maintenance, 'pause') + .mockImplementationOnce(async (reason) => { + const release = await acquireLease(reason) + acquired.resolve() + await acquiring.promise + return () => { + releases.push('old') + release() + } + }) + .mockImplementationOnce(async (reason) => { + const release = await acquireLease(reason) + successorReady.resolve() + await successor.promise + return release + }) + discardRepoPreparations(entry.repoPathKey) + await acquired.promise + const disposal = entry.operation.discard() + try { + await vi.advanceTimersByTimeAsync(30_000) + await disposal + expect(preparationCapacityUsed()).toBe(1) + expect(maintenance.pause).toHaveBeenCalledTimes(1) + expect(releases).toEqual([]) + acquiring.resolve() + await successorReady.promise + expect(releases).toEqual(['old']) + await attemptMaintenance(other.repoPath) + expect(existsSync(join(other.repoPath, '.git', 'packed-refs'))).toBe(false) + successor.resolve() + await vi.waitFor(() => { + expect(existsSync(entry.preparedPath)).toBe(false) + expect(preparationCapacityUsed()).toBe(0) + }) + await attemptMaintenance(other.repoPath) + expect(existsSync(join(other.repoPath, '.git', 'packed-refs'))).toBe(true) + } finally { + acquiring.resolve() + successor.resolve() + } +}) + +it('holds cleanup maintenance through a rejected writer until its actual termination receipt', async () => { + const { arm } = await fixture() + const other = await fixture() + await arm() + const [entry] = listPreparations() + const issued = Promise.withResolvers() + const terminated = Promise.withResolvers() + const run = gitRunner.gitExecFileAsync + let first = true + vi.spyOn(gitRunner, 'gitExecFileAsync').mockImplementation(async (args, options) => { + if (args.includes('remove') && first) { + first = false + options.observeChildTermination?.(terminated.promise, true) + issued.resolve() + throw new Error('cleanup rejected before native termination') + } + return run(args, options) + }) + vi.useFakeTimers({ toFake: ['Date', 'setTimeout', 'clearTimeout'] }) + enableMaintenance() + discardRepoPreparations(entry.repoPathKey) + await issued.promise + try { + await vi.advanceTimersByTimeAsync(30_000) + await entry.operation.discard() + await attemptMaintenance(other.repoPath) + expect(existsSync(join(other.repoPath, '.git', 'packed-refs'))).toBe(false) + terminated.resolve() + await vi.waitFor(() => { + expect(existsSync(entry.preparedPath)).toBe(false) + expect(preparationCapacityUsed()).toBe(0) + }) + await attemptMaintenance(other.repoPath) + expect(existsSync(join(other.repoPath, '.git', 'packed-refs'))).toBe(true) + } finally { + terminated.resolve() + } +}) diff --git a/src/main/workspaces/creation/preparation/worktree-preparation-tip-refresh.test.ts b/src/main/workspaces/creation/preparation/worktree-preparation-tip-refresh.test.ts index c4ba7537a4e..ee20bbbd568 100644 --- a/src/main/workspaces/creation/preparation/worktree-preparation-tip-refresh.test.ts +++ b/src/main/workspaces/creation/preparation/worktree-preparation-tip-refresh.test.ts @@ -76,7 +76,8 @@ describe('prepared checkout tip refresh', () => { repo.path, entry.preparedPath, expect.anything(), - entry.lockReason + entry.lockReason, + null ) expect(listPreparations()).toEqual([]) } finally { @@ -111,7 +112,8 @@ describe('prepared checkout tip refresh', () => { repo.path, entry.preparedPath, expect.anything(), - entry.lockReason + entry.lockReason, + null ) }) diff --git a/src/renderer/src/components/automations/external/external-automation-scope-gating.test.ts b/src/renderer/src/components/automations/external/external-automation-scope-gating.test.ts index dbb45ed5d28..8453526a281 100644 --- a/src/renderer/src/components/automations/external/external-automation-scope-gating.test.ts +++ b/src/renderer/src/components/automations/external/external-automation-scope-gating.test.ts @@ -1,11 +1,7 @@ import { describe, expect, it } from 'vitest' import type { AutomationHostCatalogEntry } from '../hosts/automation-host-catalog-types' -import { - externalAutomationProbeOwners, - externalAutomationScopeGateFromError, - parseExternalAutomationScopeCode -} from './external-automation-scope-gating' +import { externalAutomationProbeOwners } from './external-automation-scope-gating' function entry(overrides: Partial = {}): AutomationHostCatalogEntry { return { @@ -41,10 +37,3 @@ describe('external automation scope gating', () => { ]) }) }) - -describe('engine scope errors', () => { - it('leaves unrelated failures alone so they are not relabelled as scope limits', () => { - expect(externalAutomationScopeGateFromError(new Error('socket hang up'))).toBeNull() - expect(parseExternalAutomationScopeCode(null)).toBeNull() - }) -}) diff --git a/src/renderer/src/components/automations/hosts/automation-host-cache.test.ts b/src/renderer/src/components/automations/hosts/automation-host-cache.test.ts index 5ad2c8280b5..604c343c601 100644 --- a/src/renderer/src/components/automations/hosts/automation-host-cache.test.ts +++ b/src/renderer/src/components/automations/hosts/automation-host-cache.test.ts @@ -38,14 +38,6 @@ function createCache(overrides: Parameters[0] } describe('automation host cache commit fence', () => { - it('discards a response whose entry was invalidated while it was in flight', () => { - const cache = createCache() - const fence = cache.beginRequest(DESKTOP_SELF) - cache.invalidate(DESKTOP_SELF) - expect(cache.commit(fence, { rows: [row('a')] })).toBe(false) - expect(cache.get(DESKTOP_SELF)?.data).toEqual([]) - }) - it('discards a response whose authority catalog generation advanced', () => { let generation = 7 const cache = createCache({ catalogGeneration: () => generation }) diff --git a/src/renderer/src/components/automations/hosts/automation-host-list-rows.test.ts b/src/renderer/src/components/automations/hosts/automation-host-list-rows.test.ts index 7c3a41555bf..d0cfa3336b8 100644 --- a/src/renderer/src/components/automations/hosts/automation-host-list-rows.test.ts +++ b/src/renderer/src/components/automations/hosts/automation-host-list-rows.test.ts @@ -101,19 +101,6 @@ const ALL_HOSTS: AutomationHostFilterResolution = { } describe('automation host list rows', () => { - it('reports nothing answered until a host has actually committed', () => { - const rows = resolveAutomationHostListRows({ - catalog: catalogOf([DESKTOP_SELF]), - resolution: ALL_HOSTS, - entry: () => cached([], null) - }) - - // Why this matters: the caller keeps its own list while this is false, so a - // never-answered host must not read as an empty one. - expect(rows.answered).toBe(false) - expect(rows.automations).toEqual([]) - }) - it('keeps the owned copy when the orphan scope returns the same record', () => { const owned = row('a-1', DESKTOP_SELF.owner) const rows = resolveAutomationHostListRows({ diff --git a/src/renderer/src/components/native-chat/NativeChatMessageList.tsx b/src/renderer/src/components/native-chat/NativeChatMessageList.tsx index c4fc8c4b958..53a0ebbc0a0 100644 --- a/src/renderer/src/components/native-chat/NativeChatMessageList.tsx +++ b/src/renderer/src/components/native-chat/NativeChatMessageList.tsx @@ -223,7 +223,7 @@ export function NativeChatMessageList({ subagentChoices, forkOffer, line: { - draws: tailRow === 'activity', + tailRow, thinking: turnStatuses.active?.thinking === true, stopping, activityText: turnActivity?.text diff --git a/src/renderer/src/components/native-chat/conversation/slots/native-chat-response-actions-hang.test.ts b/src/renderer/src/components/native-chat/conversation/slots/native-chat-response-actions-hang.test.ts new file mode 100644 index 00000000000..e29ddca593e --- /dev/null +++ b/src/renderer/src/components/native-chat/conversation/slots/native-chat-response-actions-hang.test.ts @@ -0,0 +1,239 @@ +import { describe, expect, it } from 'vitest' + +import type { NativeChatMessage } from '../../../../../../shared/native-chat/native-chat-types' +import type { NativeChatTurnStatus } from '../../../../../../shared/native-chat/transcript/native-chat-turn-status' +import type { NativeChatResolvedPrompt } from '../../../../../../shared/native-chat/native-chat-resolution-receipt' +import type { NativeChatTurnDiff } from '../../../../../../shared/native-chat/tools/native-chat-turn-diffs' +import { nativeChatSubagentSections } from '../../subagents/native-chat-subagent-sections' +import { + buildNativeChatTranscriptSlots, + type NativeChatMessageSlot +} from './native-chat-transcript-slots' + +const SETTLED: NativeChatTurnStatus = { startedAt: 1, thinking: false, workedSeconds: 4 } +const DIFF: NativeChatTurnDiff = { files: [], added: 1, removed: 0, truncated: false } + +function text( + id: string, + body: string, + role: NativeChatMessage['role'] = 'assistant' +): NativeChatMessage { + return { id, role, blocks: [{ type: 'text', text: body }], timestamp: 1, source: 'transcript' } +} + +function workerUpdate(id: string): NativeChatMessage { + return { + ...text(id, 'Update from worker', 'user'), + from: { kind: 'agent', senders: [], orchestration: null } + } +} + +function toolRun(id: string): NativeChatMessage { + return { + id, + role: 'assistant', + blocks: [{ type: 'tool-call', name: 'shell', input: { command: 'ls' }, state: 'completed' }], + timestamp: 1, + source: 'transcript' + } +} + +type Overrides = Partial[0]> + +function build(messages: NativeChatMessage[], overrides: Overrides = {}): NativeChatMessageSlot[] { + let turn: string | undefined + const turnKeys = messages.map((message) => { + // A worker's update lands inside the turn it reached, as the host attributes it. + if (message.role === 'user' && !message.from) { + turn = message.id + } + return turn + }) + return buildNativeChatTranscriptSlots({ + messages, + turnKeys, + liveTurnKey: undefined, + receipts: new Map(), + turnStatuses: { active: null, completedByTurn: {} }, + turnDiffs: new Map(), + expandedTurnKeys: new Set(), + isWorking: false, + lifecycleWorking: false, + ...overrides + }).filter((slot): slot is NativeChatMessageSlot => slot.kind === 'message') +} + +function answer(messages: NativeChatMessage[], overrides: Overrides = {}): NativeChatMessageSlot { + const slot = build(messages, overrides).find((candidate) => candidate.message.id === 'answer') + if (!slot) { + throw new Error('Missing the answer row') + } + return slot +} + +const PROMPT = text('u', 'go', 'user') +const ANSWER = text('answer', 'done') +/** One line of text: the row's minimum while its controls hang, 20px more with them in flow. */ +const HANGING_PX = 24 +const IN_FLOW_PX = 44 + +describe('response actions hang', () => { + it("hangs above the person's own bubble and at the end of the transcript", () => { + const followed = answer([PROMPT, ANSWER, text('u2', 'next', 'user')]) + expect(followed.actionsHang).toBe(true) + expect(followed.estimatedHeight).toBe(HANGING_PX) + expect(answer([PROMPT, ANSWER]).actionsHang).toBe(true) + }) + + it('keeps its own height above anything left-side in the next row', () => { + for (const next of [ + workerUpdate('w'), + text('n', 'notice', 'system'), + toolRun('tool'), + text('thought', 'thinking', 'reasoning') + ]) { + const slot = answer([PROMPT, ANSWER, next], { expandedTurnKeys: new Set(['u']) }) + expect([next.id, slot.actionsHang]).toEqual([next.id, undefined]) + expect([next.id, slot.estimatedHeight]).toEqual([next.id, IN_FLOW_PX]) + } + }) + + it('keeps its own height above a turn bar drawn above the next bubble', () => { + const messages = [PROMPT, ANSWER, text('u2', 'next', 'user')] + // The next turn's opener is not loaded, so its bar draws above the row that stands in for it. + const barAbove = build(messages, { + turnKeys: ['u', 'u', 'unloaded'], + turnStatuses: { active: null, completedByTurn: { unloaded: SETTLED } } + }) + expect(barAbove.map((slot) => [slot.message.id, slot.statusAbove, slot.actionsHang])).toEqual([ + ['u', false, undefined], + ['answer', false, undefined], + ['u2', true, undefined] + ]) + }) + + it('keeps its own height above what its own row draws after the message', () => { + const next = text('u2', 'next', 'user') + const withDiff = answer([PROMPT, ANSWER, next], { turnDiffs: new Map([['u', DIFF]]) }) + expect(withDiff.turnDiff).toBe(DIFF) + expect(withDiff.actionsHang).toBeUndefined() + + const pullRequests = [ + { + provider: 'github' as const, + url: 'https://github.com/acme/app/pull/1', + slug: { owner: 'acme', repo: 'app' }, + number: 1 + } + ] + const withPullRequests = answer([PROMPT, ANSWER, next], { + openedPullRequests: new Map([['u', pullRequests]]) + }) + expect(withPullRequests.openedPullRequests).toBe(pullRequests) + expect(withPullRequests.actionsHang).toBeUndefined() + + // Even as the last slot: the rollup is what sits under the controls. + expect(answer([PROMPT, ANSWER], { turnDiffs: new Map([['u', DIFF]]) }).actionsHang).toBe( + undefined + ) + }) + + it('keeps its own height above a status row drawn below the message', () => { + // A turn keyed by the answer itself draws its bar under that row, as it does under a prompt. + const below = answer([ANSWER, text('u2', 'next', 'user')], { + turnKeys: ['answer', 'u2'], + turnStatuses: { active: null, completedByTurn: { answer: SETTLED } } + }) + expect(below.status).toBe(SETTLED) + expect(below.statusAbove).toBe(false) + expect(below.drawsMessage).toBe(true) + expect(below.actionsHang).toBeUndefined() + // Drawn above the row instead, the bar leaves nothing under the controls. + const above = answer([ANSWER, text('u2', 'next', 'user')], { + turnKeys: ['unloaded', 'u2'], + turnStatuses: { active: null, completedByTurn: { unloaded: SETTLED } } + }) + expect(above.statusAbove).toBe(true) + expect(above.actionsHang).toBe(true) + }) + + it('charges the estimate only on a row that holds controls', () => { + // A working turn's frontier offers no controls, so nothing is added though a card follows. + const working = answer([PROMPT, ANSWER, workerUpdate('w')], { + liveTurnKey: 'u', + isWorking: true + }) + expect(working.actionsHang).toBeUndefined() + expect(working.estimatedHeight).toBe(HANGING_PX) + // The turn's actions belong to its last words, so an earlier response holds none. + const earlier = build([PROMPT, text('first', 'looking'), toolRun('tool'), ANSWER], { + expandedTurnKeys: new Set(['u']) + }).find((slot) => slot.message.id === 'first') + expect(earlier?.endsResponse).toBe(false) + expect(earlier?.estimatedHeight).toBe(HANGING_PX) + // Spacing scales the controls with the rest of the row's chrome. + expect( + answer([PROMPT, ANSWER, workerUpdate('w')], { + typography: { lineHeightPx: 22, charsPerLine: 96, spacingScale: 1.5 } + }).estimatedHeight + ).toBe(54) + }) + + it('keeps its own height at the end while a row draws under the transcript', () => { + expect(answer([PROMPT, ANSWER], { tailRowBelow: true }).actionsHang).toBeUndefined() + // Only the last slot sits above that row. + expect( + answer([PROMPT, ANSWER, text('u2', 'next', 'user')], { tailRowBelow: true }).actionsHang + ).toBe(true) + }) + + it('looks past a failed send, which draws after the transcript and its tail row', () => { + const failed: NativeChatMessage = { ...text('failed', 'retry me', 'user'), unsent: true } + expect(answer([PROMPT, ANSWER, failed]).actionsHang).toBe(true) + expect(answer([PROMPT, ANSWER, failed], { tailRowBelow: true }).actionsHang).toBeUndefined() + expect(answer([PROMPT, ANSWER, failed, workerUpdate('w')]).actionsHang).toBeUndefined() + }) + + it('leaves rows that never hold response controls alone', () => { + const slots = build([PROMPT, ANSWER, text('n', 'notice', 'system'), workerUpdate('w')]) + expect(slots.map((slot) => [slot.message.id, slot.actionsHang])).toEqual([ + ['u', undefined], + ['answer', undefined], + ['n', undefined], + ['w', undefined] + ]) + }) + + it('leaves a subagent section as it was, and counts its head as left-side', () => { + const roster: NativeChatMessage = { + id: 'roster', + role: 'system', + blocks: [ + { + type: 'subagent-group', + groupId: 'root', + agents: [{ id: 'worker', label: 'worker', state: 'completed' }] + } + ], + timestamp: 1, + source: 'transcript' + } + const child = text('child', 'reading') + const conversation = [PROMPT, ANSWER, roster, text('u2', 'next', 'user')] + const input: Overrides = { + subagentSections: nativeChatSubagentSections( + conversation, + new Map([['worker', [{ message: child, turnKey: undefined }]]]) + ), + subagentChoices: { sections: new Map([['worker', true]]), rosters: new Map() } + } + const slots = build(conversation, input) + const inSection = slots.find((slot) => slot.message.id === 'child') + expect(inSection?.depth).toBe(1) + expect(inSection?.actionsHang).toBeUndefined() + // A section's rows already keep their controls in flow: one line of text and the controls, + // charged once by the section itself. + expect(inSection?.estimatedHeight).toBe(22 + 20) + expect(slots.find((slot) => slot.message.id === 'answer')?.actionsHang).toBeUndefined() + }) +}) diff --git a/src/renderer/src/components/native-chat/conversation/slots/native-chat-response-actions-hang.ts b/src/renderer/src/components/native-chat/conversation/slots/native-chat-response-actions-hang.ts new file mode 100644 index 00000000000..86477296a54 --- /dev/null +++ b/src/renderer/src/components/native-chat/conversation/slots/native-chat-response-actions-hang.ts @@ -0,0 +1,98 @@ +// Response controls sit on the left. They may hang into the gap below only when nothing else on the +// left starts there; otherwise they would touch the next item, so they keep their own height. + +import { + type NativeChatRowTypography, + nativeChatRowContentMetrics, + nativeChatRowHeightWithControlsInFlow +} from '../../viewport/virtualization/native-chat-row-height-estimate' +import type { + NativeChatMessageSlot, + NativeChatTranscriptSlot +} from './native-chat-transcript-slots' + +/** The person's own right-aligned bubble, with nothing of the row drawn on the left above it. */ +function slotOpensWithPersonBubble(slot: NativeChatTranscriptSlot): boolean { + return ( + slot.kind === 'message' && + slot.depth === 0 && + slot.drawsMessage && + slot.receipt === undefined && + slot.statusAbove !== true && + slot.message.role === 'user' && + // Agent-authored input draws a left-aligned sender card instead of a bubble. + slot.message.from === undefined && + !slot.message.blocks.some((block) => block.type === 'text' && block.providerFrame) + ) +} + +/** The list moves an unjournaled, unsent message below the transcript and its tail row. */ +function slotDrawsAfterTranscript(slot: NativeChatTranscriptSlot): boolean { + return ( + slot.kind === 'message' && + slot.message.unsent === true && + slot.message.journalPosition === undefined + ) +} + +/** Whether the row draws something after its message: a turn bar, a diff rollup or a PR card. */ +function slotDrawsAfterMessage(slot: NativeChatMessageSlot): boolean { + return ( + (slot.status !== undefined && slot.statusAbove !== true) || + slot.turnDiff !== undefined || + slot.openedPullRequests !== undefined + ) +} + +/** Whether the row draws response controls, as far as its estimate can tell without its words. */ +function slotHoldsControls( + slot: NativeChatMessageSlot, + typography: NativeChatRowTypography | undefined +): boolean { + if (slot.receipt !== undefined || slot.activeTurnIsWorking) { + return false + } + // Outside a turn every worded response holds its own, unless the agent's next step follows. + return ( + slot.endsResponse ?? + (slot.continuesTurn !== true && + nativeChatRowContentMetrics(slot.message, typography).textLines > 0) + ) +} + +/** Set `actionsHang` on the conversation's own agent rows, and charge the estimate of a row whose + * controls stay in flow. Runs after `endsResponse` and `continuesTurn` are known. */ +export function markNativeChatResponseActionsHang( + drawn: readonly NativeChatTranscriptSlot[], + /** A left-side row draws under the last slot (the live activity line, the awaiting-input row). */ + tailRowBelow: boolean, + typography?: NativeChatRowTypography +): void { + // Newest first, carrying what draws next: a send that never reached the journal draws after the + // transcript, so it is not what follows the row before it. + let following: NativeChatTranscriptSlot | undefined + for (let index = drawn.length - 1; index >= 0; index -= 1) { + const slot = drawn[index]! + const next = following + if (!slotDrawsAfterTranscript(slot)) { + following = slot + } + // A subagent's section keeps its controls inside its border, so they never hang there. + if ( + slot.kind !== 'message' || + slot.depth !== 0 || + !slot.drawsMessage || + slot.message.role !== 'assistant' + ) { + continue + } + if ( + !slotDrawsAfterMessage(slot) && + (next === undefined ? !tailRowBelow : slotOpensWithPersonBubble(next)) + ) { + slot.actionsHang = true + } else if (slotHoldsControls(slot, typography)) { + slot.estimatedHeight = nativeChatRowHeightWithControlsInFlow(slot.estimatedHeight, typography) + } + } +} diff --git a/src/renderer/src/components/native-chat/conversation/slots/native-chat-transcript-input.ts b/src/renderer/src/components/native-chat/conversation/slots/native-chat-transcript-input.ts index 44419f356b2..47e6b69266b 100644 --- a/src/renderer/src/components/native-chat/conversation/slots/native-chat-transcript-input.ts +++ b/src/renderer/src/components/native-chat/conversation/slots/native-chat-transcript-input.ts @@ -35,4 +35,6 @@ export type NativeChatTranscriptSlotsInput = { subagentChoices?: NativeChatSubagentChoices /** The open reasoning block the live activity line discloses: its row takes no slot meanwhile. */ liveReasoningId?: string | null + /** A left-side row draws under the last slot: the live activity line or the awaiting-input row. */ + tailRowBelow?: boolean } diff --git a/src/renderer/src/components/native-chat/conversation/slots/native-chat-transcript-slots.test.ts b/src/renderer/src/components/native-chat/conversation/slots/native-chat-transcript-slots.test.ts index c6291a4bd6e..860d226a374 100644 --- a/src/renderer/src/components/native-chat/conversation/slots/native-chat-transcript-slots.test.ts +++ b/src/renderer/src/components/native-chat/conversation/slots/native-chat-transcript-slots.test.ts @@ -131,6 +131,22 @@ describe('transcript slots', () => { expect(working.find((slot) => slot.message.id === 'a')?.activeTurnIsWorking).toBe(true) }) + it('marks only the newest reply for always-visible actions, including while it is working', () => { + const messages = [ + text('u1', 'first', 'user'), + text('a1', 'first reply'), + text('u2', 'second', 'user'), + text('a2', 'second reply') + ] + for (const overrides of [{}, { liveTurnKey: 'u2', isWorking: true }]) { + const replies = build(messages, overrides).filter((slot) => slot.endsResponse) + expect(replies.map((slot) => [slot.message.id, slot.latestResponse === true])).toEqual([ + ['a1', false], + ['a2', true] + ]) + } + }) + it("keeps a turn's actions on its text, or on its image while folding hides the text", () => { const image: NativeChatMessage = { id: 'a-image', diff --git a/src/renderer/src/components/native-chat/conversation/slots/native-chat-transcript-slots.ts b/src/renderer/src/components/native-chat/conversation/slots/native-chat-transcript-slots.ts index 382e173d68e..7072134dc54 100644 --- a/src/renderer/src/components/native-chat/conversation/slots/native-chat-transcript-slots.ts +++ b/src/renderer/src/components/native-chat/conversation/slots/native-chat-transcript-slots.ts @@ -40,6 +40,7 @@ import { nativeChatSlotOffersFork, type NativeChatSideChatForkPoint } from '../../messages/actions/native-chat-side-chat-fork-point' +import { markNativeChatResponseActionsHang } from './native-chat-response-actions-hang' import type { Translate } from '../../../../i18n/use-translate' export type NativeChatTranscriptSlot = @@ -73,6 +74,13 @@ export type NativeChatMessageSlot = { * the last drawn response with words, else the last with images. Absent outside a turn and in * subagent sections. */ endsResponse?: boolean + /** This response is the newest one in the conversation. */ + latestResponse?: boolean + /** Response controls under this row may hang into the gap below it: the row draws nothing after + * its message, and what follows is the person's own right-aligned bubble or nothing. Absent when + * something left-side follows (an agent's card, a notice, a task or subagent row, the turn's bar, + * diff rollup or PR card), where the controls keep their own height, and in subagent sections. */ + actionsHang?: boolean turnDiff: NativeChatTurnDiff | undefined /** Pull requests this row's turn opened, drawn after it. */ openedPullRequests?: readonly NativeChatOpenedPullRequest[] @@ -116,6 +124,7 @@ export function buildNativeChatTranscript( subagentSections: sections = NO_NATIVE_CHAT_SUBAGENT_SECTIONS, subagentChoices: choices = NO_NATIVE_CHAT_SUBAGENT_CHOICES, liveReasoningId = null, + tailRowBelow = false, forkOffer } = input // Share row rendering facts with fold selection so answer detection agrees with visible prose. @@ -257,6 +266,19 @@ export function buildNativeChatTranscript( slot.endsResponse = true } } + const latestResponse = drawn.findLast( + (slot) => + slot.kind === 'message' && + slot.depth === 0 && + slot.drawsMessage && + !slot.receipt && + slot.message.role === 'assistant' && + (slot.endsResponse === true || + (slot.endsResponse === undefined && nativeChatAgentRowWords(slot.message, t).length > 0)) + ) + if (latestResponse?.kind === 'message') { + latestResponse.latestResponse = true + } for (let index = 0; index < drawn.length - 1; index += 1) { const slot = drawn[index]! const next = drawn[index + 1]! @@ -275,6 +297,7 @@ export function buildNativeChatTranscript( slot.continuesTurn = true } } + markNativeChatResponseActionsHang(drawn, tailRowBelow, typography) return { slots: drawn, forkPoint: forkOffer diff --git a/src/renderer/src/components/native-chat/conversation/slots/use-native-chat-transcript-slots.ts b/src/renderer/src/components/native-chat/conversation/slots/use-native-chat-transcript-slots.ts index 8b3b56250f7..4f4d3b63536 100644 --- a/src/renderer/src/components/native-chat/conversation/slots/use-native-chat-transcript-slots.ts +++ b/src/renderer/src/components/native-chat/conversation/slots/use-native-chat-transcript-slots.ts @@ -15,8 +15,14 @@ import type { NativeChatTranscriptSlotsInput } from './native-chat-transcript-in export function useNativeChatTranscriptSlots({ line, ...input -}: Omit & { - line: { draws: boolean; thinking: boolean; stopping?: boolean; activityText?: string | null } +}: Omit & { + line: { + /** The row drawn under the transcript, if any. */ + tailRow: 'awaiting-input' | 'activity' | null + thinking: boolean + stopping?: boolean + activityText?: string | null + } }): { slots: NativeChatTranscriptSlot[] forkPoint: NativeChatSideChatForkPoint | null @@ -39,7 +45,8 @@ export function useNativeChatTranscriptSlots({ subagentChoices, forkOffer } = input - const { draws, thinking, stopping = false, activityText } = line + const { tailRow, thinking, stopping = false, activityText } = line + const draws = tailRow === 'activity' const liveLine = useMemo( () => nativeChatLiveLine({ @@ -70,6 +77,8 @@ export function useNativeChatTranscriptSlots({ ] ) const liveReasoningId = liveLine?.reasoning?.message.id ?? null + // A boolean, so the line's changing words never rebuild the slots. + const tailRowBelow = liveLine !== null || tailRow === 'awaiting-input' const { slots, forkPoint } = useMemo( () => buildNativeChatTranscript({ @@ -88,6 +97,7 @@ export function useNativeChatTranscriptSlots({ subagentSections, subagentChoices, liveReasoningId, + tailRowBelow, forkOffer }), [ @@ -102,6 +112,7 @@ export function useNativeChatTranscriptSlots({ receipts, subagentChoices, subagentSections, + tailRowBelow, turnDiffs, turnKeys, turnStatuses, diff --git a/src/renderer/src/components/native-chat/messages/actions/native-chat-side-chat-fork-point.hooks.test.tsx b/src/renderer/src/components/native-chat/messages/actions/native-chat-side-chat-fork-point.hooks.test.tsx index 6f8cc11def4..27eec57c35e 100644 --- a/src/renderer/src/components/native-chat/messages/actions/native-chat-side-chat-fork-point.hooks.test.tsx +++ b/src/renderer/src/components/native-chat/messages/actions/native-chat-side-chat-fork-point.hooks.test.tsx @@ -91,7 +91,7 @@ const EMPTY_RECEIPTS = new Map() const NO_STATUSES = { active: null, completedByTurn: {} } const EMPTY_DIFFS = new Map() const EMPTY_KEYS = new Set() -const LINE = { draws: false, thinking: false } +const LINE = { tailRow: null, thinking: false } /** Every eligibility decision, in any search, asks this set; count those asks. */ class CountedSet extends Set { diff --git a/src/renderer/src/components/native-chat/messages/rows/NativeChatAssistantMessageRow.tsx b/src/renderer/src/components/native-chat/messages/rows/NativeChatAssistantMessageRow.tsx index 9af89d8fddb..19b85488e34 100644 --- a/src/renderer/src/components/native-chat/messages/rows/NativeChatAssistantMessageRow.tsx +++ b/src/renderer/src/components/native-chat/messages/rows/NativeChatAssistantMessageRow.tsx @@ -52,6 +52,8 @@ export function NativeChatAssistantMessageRow({ trailingRun, continuesTurn = false, endsResponse, + latestResponse = true, + actionsHang = false, inSubagentSection = false, runtimeContext, fork @@ -122,8 +124,12 @@ export function NativeChatAssistantMessageRow({ } className={cn( 'mt-1 w-fit select-none', - // They hang into the gap below; a section keeps them inside its border instead. - !inSubagentSection && '-mb-5' + !latestResponse && + fork?.pendingItemId !== message.id && + 'transition-opacity can-hover:pointer-events-none can-hover:opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 group-focus-within:pointer-events-auto group-focus-within:opacity-100', + // They hang into the gap below only when nothing left-side starts there. Never in a + // section, which keeps them inside its border. + actionsHang && '-mb-5' )} /> ) : null} diff --git a/src/renderer/src/components/native-chat/messages/rows/NativeChatMessageRow.tsx b/src/renderer/src/components/native-chat/messages/rows/NativeChatMessageRow.tsx index 11c9bbda907..0ee81443a4a 100644 --- a/src/renderer/src/components/native-chat/messages/rows/NativeChatMessageRow.tsx +++ b/src/renderer/src/components/native-chat/messages/rows/NativeChatMessageRow.tsx @@ -59,6 +59,9 @@ export type MessageRowProps = { continuesTurn?: boolean /** In a turn: whether this row holds the response's actions (its last words, else its last images). */ endsResponse?: boolean + latestResponse?: boolean + /** Response controls may hang into the gap below; otherwise they keep their own height. */ + actionsHang?: boolean /** Align this message's top to the top of the scroll viewport. */ onScrollMessageToTop: (el: HTMLElement) => void deliveryNotice?: NativeChatDeliveryNotice diff --git a/src/renderer/src/components/native-chat/messages/rows/NativeChatTranscriptRow.fixture.tsx b/src/renderer/src/components/native-chat/messages/rows/NativeChatTranscriptRow.fixture.tsx new file mode 100644 index 00000000000..f2c4f9c04bc --- /dev/null +++ b/src/renderer/src/components/native-chat/messages/rows/NativeChatTranscriptRow.fixture.tsx @@ -0,0 +1,69 @@ +import { defineFixture } from '../../../../component-fixtures/component-fixture' +import { NativeChatMessageList } from '../../NativeChatMessageList' +import type { NativeChatLiveSession } from '../../session/terminal/read/native-chat-live-session-contract' +import type { NativeChatMessage } from '../../../../../../shared/native-chat/native-chat-types' +import { orchestrationMailFixture } from '../../../../../../shared/agent-session/orchestration-mail.test-fixture' + +const STARTED_AT = 1_800_000_000_000 +let sent = 0 +function at(): number { + sent += 1 + return STARTED_AT + sent * 60_000 +} +function text(id: string, role: NativeChatMessage['role'], body: string): NativeChatMessage { + return { id, role, source: 'transcript', timestamp: at(), blocks: [{ type: 'text', text: body }] } +} + +// What follows a response's copy / fork / scroll-up row: a worker's card, the person's own bubble, +// and the turn's changed-files rollup. +const messages: NativeChatMessage[] = [ + text('ask', 'user', 'Have a worker review the parser.'), + text('dispatched', 'assistant', 'A review worker is on it. I will report when it answers.'), + { + ...orchestrationMailFixture({ body: 'The parser review found nothing blocking.' }), + timestamp: at() + }, + text('reported', 'assistant', 'The worker found nothing blocking.'), + text('follow-up', 'user', 'Good. Update the greeting too.'), + { + id: 'edit', + role: 'assistant', + source: 'transcript', + timestamp: at(), + blocks: [ + { + type: 'tool-call', + name: 'Edit', + state: 'completed', + input: { + file_path: '/Users/alice/orca/workspaces/orca/feature-x/src/components/greeting.ts', + old_string: 'return "Hello"', + new_string: 'return `Hello, ${name}`' + } + }, + { type: 'tool-result', output: 'The file was updated successfully.' } + ] + }, + text('answer', 'assistant', 'The greeting now includes the name.') +] + +const session: NativeChatLiveSession = { + messages, + agent: 'claude', + sessionId: 'fixture', + status: 'ready', + readPhase: 'ready', + hasMore: false, + loadingEarlier: false, + olderHistoryGeneration: 0, + loadEarlier: async () => 'applied' +} + +export const responseActionsGap = defineFixture({ + width: 560, + render: () => ( +
+ +
+ ) +}) diff --git a/src/renderer/src/components/native-chat/messages/rows/NativeChatTranscriptRow.tsx b/src/renderer/src/components/native-chat/messages/rows/NativeChatTranscriptRow.tsx index 3bfadce54b5..2494bcbd1bc 100644 --- a/src/renderer/src/components/native-chat/messages/rows/NativeChatTranscriptRow.tsx +++ b/src/renderer/src/components/native-chat/messages/rows/NativeChatTranscriptRow.tsx @@ -48,12 +48,15 @@ export type NativeChatTranscriptRowContext = { export const NativeChatTranscriptRow = memo(function NativeChatTranscriptRow({ slot, context, - newRowsMarker + newRowsMarker, + newRowsMarkerBelow = false }: { slot: NativeChatTranscriptSlot context: NativeChatTranscriptRowContext /** The "New" marker, when it draws in this row. */ newRowsMarker?: NativeChatNewRowsMarkerState + /** The "New" marker opens the next row: left-side, so this row's actions keep their own height. */ + newRowsMarkerBelow?: boolean }): React.JSX.Element { // Offered only on the conversation's own turn-opening prompts (`nativeChatRowOffersRewind`). const rewind = useContext(NativeChatRewindContext) @@ -105,7 +108,8 @@ export const NativeChatTranscriptRow = memo(function NativeChatTranscriptRow({ ) : null return ( // The negative margin shortens the measured row, which is what moves the next one up. - // A row whose actions hang into the gap keeps it whole, so they never cover the next row. + // A row that holds its response's actions keeps the gap whole: they stay in flow above the + // agent's next step (`actionsHang` is unset there), which then sits a full gap below them.
= {}): Marker { - return { - key: 'answer', - place: 'above-row', - arriving: true, - onArrived: vi.fn(), - onDismiss: vi.fn(), - ...overrides - } -} - -const VIEWPORT_PX = 600 -const ROW_TOP_PX = 1_000 - -let restoreLayout: (() => void)[] = [] - -/** Place the view bottom aboveMarkerPx short of a marker positioned intoRowPx within its row. */ -function pane( - value: Marker, - { intoRowPx = 0, aboveMarkerPx = 0 }: { intoRowPx?: number; aboveMarkerPx?: number } = {} -) { - const isRow = (element: HTMLElement): boolean => element.hasAttribute('data-index') - const isMarker = (element: HTMLElement): boolean => element.getAttribute('role') === 'separator' - const layout = (name: string, get: (this: HTMLElement) => unknown) => - overrideLayoutProperty(name, { get }) - restoreLayout = [ - layout('clientHeight', () => VIEWPORT_PX), - layout('scrollTop', () => ROW_TOP_PX + intoRowPx - VIEWPORT_PX - aboveMarkerPx), - layout('offsetTop', function () { - return isRow(this) ? ROW_TOP_PX : isMarker(this) ? intoRowPx : 0 - }), - layout('offsetParent', function () { - return isRow(this) || isMarker(this) ? this.parentElement : null - }) - ] - const onReveal = vi.fn() - const view = render( -
-
- -
-
-
- -
-
-