diff --git a/.github/workflows/computer-e2e.yml b/.github/workflows/computer-e2e.yml index 25ca3cd84ba..7458ec1831b 100644 --- a/.github/workflows/computer-e2e.yml +++ b/.github/workflows/computer-e2e.yml @@ -14,10 +14,8 @@ on: - 'config/scripts/native-build/windows/windows-rust-executable-build.mjs' - 'config/scripts/native-build/windows/build-windows-cli-launcher.test.mjs' - 'config/scripts/performance/macos-computer-owner/macos-computer-helper-owner-loss-benchmark.mjs' - - 'config/scripts/performance/macos-computer-owner/macos-computer-helper-owner-loss-group-recovery.test.mjs' - 'config/scripts/performance/macos-computer-owner/macos-computer-helper-owner-loss-metrics.mjs' - 'config/scripts/performance/macos-computer-owner/macos-computer-helper-owner-loss-processes.mjs' - - 'config/scripts/performance/macos-computer-owner/macos-computer-helper-owner-loss-processes.test.mjs' - 'config/scripts/performance/macos-computer-owner/macos-computer-helper-owner-loss-trial-cleanup.mjs' - 'config/scripts/runtime-verification/daemon-lifecycle/daemon-boot-smoke.mjs' - 'config/scripts/runtime-verification/daemon-lifecycle/daemon-endpoint-handover-smoke.mjs' @@ -91,8 +89,6 @@ jobs: # Use shared Vitest config: bare invocation misses config/ and its timeout/Windows worker cap, breaking real csc.exe tests. - run: >- pnpm vitest run --config config/vitest.config.ts - config/scripts/performance/macos-computer-owner/macos-computer-helper-owner-loss-group-recovery.test.mjs - config/scripts/performance/macos-computer-owner/macos-computer-helper-owner-loss-processes.test.mjs src/main/computer/sidecar-transport/sidecar-client.test.ts src/main/computer/macos-native/macos-native-provider-client.test.ts src/main/providers/shell-launch/windows/shell-preflight-runtime.windows.test.ts diff --git a/.github/workflows/computer-macos-native.yml b/.github/workflows/computer-macos-native.yml index 1ab53b1011a..9d34798efee 100644 --- a/.github/workflows/computer-macos-native.yml +++ b/.github/workflows/computer-macos-native.yml @@ -50,11 +50,6 @@ jobs: - uses: ./.github/actions/install-node-dependencies with: native-runtime: electron - - name: Owner-loss benchmark process cleanup - run: >- - pnpm vitest run - config/scripts/performance/macos-computer-owner/macos-computer-helper-owner-loss-group-recovery.test.mjs - config/scripts/performance/macos-computer-owner/macos-computer-helper-owner-loss-processes.test.mjs # Why: the parallel launcher's cancellation tests are darwin-only and no # other PR job runs on macOS. - name: Parallel native build launcher cancellation diff --git a/.github/workflows/macos-updater-tests.yml b/.github/workflows/macos-updater-tests.yml index 22c01e524ac..01747e576fa 100644 --- a/.github/workflows/macos-updater-tests.yml +++ b/.github/workflows/macos-updater-tests.yml @@ -57,8 +57,3 @@ jobs: src/main/updater/mac-install/updater-mac-quit-guard.test.ts src/main/startup/quit/main-process-quit-update-veto.test.ts src/main/window/main-window/main-window-state-lifecycle.test.ts - - name: Prove login-backed terminal writer census on the disposable runner - env: - ORCA_MACOS_LOGIN_CENSUS_CI: '1' - ORCA_BACKGROUND_LAUNCH: '1' - run: pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/agent-session/lifecycle/structured-agent-cli-writers.test.ts diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 54e61b5d512..4a709fa8afa 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -859,7 +859,6 @@ jobs: src/shared/shell/wsl/fish-wsl-cwd-report.node-pty.test.ts \ src/main/wsl/filesystem/wsl-sh-cwd-report.node-pty.test.ts \ src/shared/terminal/pty/ingress/pty-reply-echo-shapes.node-pty.test.ts \ - src/shared/shell/launch/startup-shell-portability.live-shell.test.ts \ src/shared/shell/command-resolution/posix-command-path-lookup.test.ts # Shards wait only for the plan, not preflight, which moves them about two minutes earlier. diff --git a/config/reliability-gates.jsonc b/config/reliability-gates.jsonc index f1c1bcd119d..64ef396e1a2 100644 --- a/config/reliability-gates.jsonc +++ b/config/reliability-gates.jsonc @@ -2225,35 +2225,26 @@ "providers": ["local", "ssh", "remote-runtime"], "coveredPlatforms": ["macos"], "coveredProviders": [], - "coverageNotes": "Audit5790 companion to audit5787: Retire simulator palette activation: collision/ambiguous-host refusal and owning split/tab selection alarms are intentionally lost. Narrow3 compound selectors and remove1 testFiles. Complete dated evidenceRuns are unchanged; none selects these retired suites and none validates narrowed selectors. All unrelated remaining assertions and selectors retain their original scope, without replacement certification. No fresh execution or current import reachability result is claimed. Complete prior account preserved verbatim below as historical: Audit5779 companion to audit5775: Retire the complete browser palette activation suite. Colliding child-ID pre-mutation refusal, focus intent captured before page removal, correct split selection and missing authoritative wrapper refusal alarms are intentionally lost without replacement. Narrow three compound commands and remove one testFiles entry. Complete dated evidenceRuns are unchanged; none selects these retired suites and none validates narrowed selectors. All unrelated remaining assertions and selectors retain their original scope, without replacement certification. No fresh execution or current import reachability result is claimed. Complete prior account preserved verbatim below as historical: Audit5765 companion to audit5760 retires the whole simulator-palette-search.test.ts suite. Direct same-ID local/remote simulator candidate ownership and ambiguous hostless legacy refusal alarms are intentionally lost without equivalent replacement. Four compound unit commands are narrowed and its testFiles entry removed. Browser candidate and paired Cmd-J selection assertions remain unchanged, with only their original scope; they are not certified as replacements. All complete dated evidenceRuns remain unchanged; none selects this removed suite, and none validates changed commands. No fresh execution, current import reachability, replacement coverage or native/platform/remote result is claimed. Complete prior account is preserved verbatim below as historical, including any older then-retained coverage claim: Audit5718 companion to audit5715 retires the whole worktree-checks-review-index.test.ts suite. Its remaining same-ID local/SSH Worktree-object review-index isolation alarm is intentionally lost without equivalent replacement. Remove its standalone selector, narrow two compound selectors, and remove its testFiles/assertionRefs entries. Two complete dated failed receipts selecting this suite through command/currentCommand are retired unchanged into knownGaps; they do not validate any remaining selector. All unrelated selectors, assertions and receipts retain only their original scope. No fresh execution, current import reachability, provider/native/platform or replacement coverage is claimed. Complete prior account preserved verbatim: Audit5658 integrates source audit5652: retire the whole web-session-tabs-sync-mirror-identity.test.ts suite and its exact active selectors. Intentionally lose same-id host mirror snapshot and removal isolation alarms without replacement. Remaining selectors retain only their own scope; no fresh execution, native/platform or remote evidence is claimed. Complete original selector fields are preserved in knownGaps. Historical prior account (preserved verbatim): Audit3663 renews approved3644/3645/3648/amended3651 at privatec1ef: remove10authored/26finite across7changedtestpaths,4whole drivers; retain23authored/24finite including actualcmdkStrictMode defaultcursor race. Retire version1.5.0/1.5.1→shrinksImages capability threshold and launch-to-prompt wiring alarm. Surviving prompt tests explicitly supply capability and do not replace wiring coverage. Retire resolved-before-personOnly precedence; hook-gone/live-dialog guidance; stale-incarnation versus live-looking dialog classification; delayed/clipped warning extraction and wait-for-paint wiring; 3row setting/personOnly approve/deny/disclaimer suggestion composition;13row setting/reason/person/coordinator admission, close/mail attribution, terminal delivery/refusal/preanswered/personOnly/dropped-allow handler propagation alarms. Real state/access/SQLite effects occur; these genuine losses are accepted, not mocked-away. Retire full command extraction from serialized JSON in worker receipt and nontruncation alarm; no rendering, actual worker approval or native shell proof. Retire2row extra-source first/last order and controlled default cursor projection, plus generic open-palette livefolder add/remove render alarm. Explicitly supersede rawexact297KEEP refresh. Keep actualcmdk/StrictMode default cursor race driver; no default-suite loss claim. No equivalent replacement asserted. Retained queue/commit/retryownership/filebudget, terminalfreshness/provenance/competing-answer, RPC DB-effect, qualifiedfolder/runtimehandoff and lingering-reopen cases have distinct scope. Audit3675 preserves the upstream revised unreported-approval close regression, its escalation helper and adapted survivors. Source-only static renewal; no runner/compiler/app/native/remote/CI claim. Upstream41390host-owned approvalwatch/report lifetime reviewed separately; no new lifetime test removed. Preserve all earlier metadata/evidence. Audit3381 intentionally removes the entire Cmd-J host-qualified candidate-ownership suite and its active selectors/assertion. The hidden same-id sibling ambiguity regression alarm is lost without replacement. The complete original dated failed receipt below is retired verbatim, including both command and currentCommand, rather than reassigned as validation of remaining selectors. Other complete receipts retain their exact original scopes; remaining browser/simulator/workspace/e2e selectors do not imply equivalent ownership protection. No fresh execution is claimed. Audit3359 retires the whole ensure-simulator-tab-behavior suite: host-collision reuse, host stamping, inactive creation and unknown-owner routing alarms are intentionally lost without equivalent replacement. Its standalone command is removed and four compound commands narrowed. Three complete dated receipts selecting that source through currentCommand are retired verbatim, including their compound historical selectors; no retained test inherits their validation. Seven unrelated macOS receipts retain their original scope. No fresh runtime/UI, simulator, provider, historical-import, mobile, mixed-version or cross-platform validation is claimed. Audit 3301 removes the orphaned mobile file-close fallback and ordinary cross-content MRU examples from tabs-open-close-lifecycle.test.ts. Earlier descriptions of retained MRU coverage are historical. Audit5612 retires the remaining integrated mobile markdown close/frame-settlement suite, accepting loss of its closed-editor snapshot republishing alarm without replacement or fresh validation. Preserve the existing administrative failed receipt and all complete retired receipts verbatim, along with selectors and unrelated assertions; no equivalent replacement or fresh Cmd-J, native or remote result is claimed. Audit 3273 removes 14 authored declarations and 19 expanded scenarios across four whole suites and eight partial suites. Retired alarms cover saved-local cancellation/layout ownership, ambiguous-owner warning reset, folder attachment routing, VM false-capability bypass, abandoned reveal warmup cleanup and viewport claim deduplication/rearming, quiet unrelated remote-removal refusal, startup-command one-shot consumption, repository/floating recovery-ledger rows, fake-React pinned-scroll intent, split-ratio state identity/subscriber suppression and fractional change, cross-host project-group join refusal, three PR request-lifetime permutations, upstream-status preservation on error, and unresolved Git-owner refusal. These regression checks are intentionally lost under the test-value audit; retained scenarios are not equivalent replacements. Historical coverage receipts remain historical, including gate35 subscriber claims. Audit2729 reduces browser-page-palette-activation.test.ts: separate SSH/paired-runtime alias forwarding, distinct multigroup views accepted, and remote-folder activation forwarding alarms are removed. Collision refusal, preactivation address-bar focus capture, owning-group activation state and missing-tab refusal remain byte-identical. No equivalent replacement, fresh gate execution or actual host/browser delivery evidence is claimed. Prior coverage account: Audit2697 browser source review (metadata followup2702): Reduce src/renderer/src/lib/browser/palette/browser-palette-page-entries.test.ts by four authored/expanded cases without replacement. The remaining three cases preserve only their existing same-ID execution-host separation, absent stamped-owner refusal and ambiguous legacy-bucket refusal scope. Intentionally lose duplicate backing-tab-ID suppression, multiple unified-browser claims of one workspace, foreign-worktree unified-tab rejection, and the 1000-workspace output/internal getter-read budget alarm. These are real removed alarms; the retained host cases are not equivalent replacements. Current test-value policy rejects internal getter/read budgets; no replacement performance or measured-cost claim is made. Keep existing nonempty selectors and the retained same-ID browser assertionRef. No fresh gate execution or reduced-source validation is supplied; dated receipts, results, commands and historical coverage accounts remain within their original source scope. No live browser activation, physical provider, mixed-version execution, mobile, native UI, platform hardware, soak or timing result is added. Prior coverage account (preserved verbatim): Audit2266 reduces cmd-j-host-qualified-candidate-ownership.test.ts to the scoped open-tab hidden same-ID legacy ambiguity refusal. Separate browser/simulator paired-runtime alias and current-row projections, generic workspace host projection and hostless explicit-owner refusal examples are removed without equivalent replacement. No fresh gate execution, browser activation, physical host, simulator or remote delivery evidence is claimed. Historical dated receipts and budgets remain raw-byte exact. Prior coverage account: Audit1899 replays sealed Audit1895: workspace-session-schema.test.ts keeps only cross-workspace truncated-tab salvage and legacy browser-history cap normalization. Four current commands and testFiles retain that reduced source; no current assertionRef or active receipt selects it. SSH file-owner, isolated browser partition, launch/title/quick-command fields, recency, structured-chat/view-mode and remote browser identity hydration alarms are intentionally lost. Existing retired receipt strings and unrelated active receipts remain verbatim. No equivalent replacement, new Cmd-J gate execution, native simulator or remote/browser restore proof is claimed. Historical coverage account before Audit1899: Audit1494 removes use-open-tab-search.test.ts. Supplied host/worktree/title/ranking projections, simple subscription updates and result-array identity alarms are retired. No actual activation or navigation occurred in that suite. No equivalent replacement coverage or fresh Cmd-J gate validation is claimed. Historical receipts remain scoped to their original selectors. Audit1433 narrows worktree-checks-review-index.test.ts to same-ID local/SSH object-key review isolation. Local provider/cache lookup, GitLab preference, suppression/legacy fallback, explicit-PR authority, physical-versus-runtime review isolation, and branchless-workspace alarms are intentionally removed. No equivalent replacement coverage is claimed. Historical receipts and commands remain unchanged and do not certify the reduced source. Historical coverage account: Audit1396 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): Audit1308 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Deterministic candidate-builder contracts inject local and paired-runtime worktrees with the same bare id into the real aggregated tab buckets, including folder workspaces and a paired runtime transporting an SSH-owned worktree. A mirror contract preserves distinct same-id runtime tabs. A paired Electron journey verifies both visible browser rows and both visible simulator rows, then requires each selection to render its owning active tab and update backing host-qualified state. The test-value audit narrowed simulator-palette-search.test.ts to the recency tie, same-id host isolation, ambiguous legacy host rejection and oversized-input getter tripwire. Supplied timestamp, empty-query context ordering, host projection, alias/range, metadata matching, active-tab score, over-token/whitespace and malformed display-name fallback examples were removed. Their separate alarms are lost; retained candidate and activation contracts do not establish equivalent coverage. Historical run commands and results remain historical. The audit also removed the standalone workspace-tab-palette-search suite: supplied row, title, metadata, alias, range, ranking and ownership examples no longer provide their separate alarms. Other retained contracts are not replacement coverage. The mirror-identity fixture now retains same-id sibling-runtime isolation and the repeated-frame subscriber tripwire only. Supplied field, owner, alias and mapping examples are removed; their separate alarms are lost. The retained sibling-runtime case is not equivalent coverage for them. The test-value audit removed tabs-open-close-lifecycle host-stamping examples and ordinary tab/group operations from tabs-pane-layout-operations. Local-null, explicit-runtime and SSH-without-active-host stamp assertions are lost; retained mobile/MRU and subscriber/atomic split cases do not replace them. Candidate and live Cmd-J evidence retains its own scope. Historical commands, outcomes and narratives remain historical. Audit1308: src/renderer/src/lib/browser-palette-search.test.ts removed. Browser-palette token and pasted-query size-guard work alarms disappear. No equivalent replacement coverage is claimed. Audit1386: src/renderer/src/lib/open-mobile-emulator-tab.test.ts reduced. Duplicate attach count and null-tab creation retry/guard reset standalone alarms removed; no simulator device used. 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. Audit1396: src/renderer/src/lib/simulator-palette-search.test.ts reduced. Lose simulator-specific lastFocusedAt tie-order alarm; identity/routing and pre-scan size fence remain. No native simulator or real remote launch claim. No equivalent replacement coverage is claimed. Audit1402: src/renderer/src/runtime/web-session-tabs-sync-mirror-identity.test.ts reduced. Loses repeated no-op frame store-notification budget; independent cross-runtime resource preservation remains. 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": "Audit5910 retires the complete browser-palette-page-entries suite: same-ID host-qualified search rows, missing stamped-owner refusal and ambiguous legacy-bucket refusal alarms are intentionally lost without equivalent replacement. Remove two standalone selectors, narrow two compound selectors and remove its testFiles/assertionRefs entries. Remaining selectors/assertions retain only their original scope. All complete dated evidenceRuns remain unchanged; none selects this source and none validates the changed selectors. Complete prior account retained verbatim: Audit5790 companion to audit5787: Retire simulator palette activation: collision/ambiguous-host refusal and owning split/tab selection alarms are intentionally lost. Narrow3 compound selectors and remove1 testFiles. Complete dated evidenceRuns are unchanged; none selects these retired suites and none validates narrowed selectors. All unrelated remaining assertions and selectors retain their original scope, without replacement certification. No fresh execution or current import reachability result is claimed. Complete prior account preserved verbatim below as historical: Audit5779 companion to audit5775: Retire the complete browser palette activation suite. Colliding child-ID pre-mutation refusal, focus intent captured before page removal, correct split selection and missing authoritative wrapper refusal alarms are intentionally lost without replacement. Narrow three compound commands and remove one testFiles entry. Complete dated evidenceRuns are unchanged; none selects these retired suites and none validates narrowed selectors. All unrelated remaining assertions and selectors retain their original scope, without replacement certification. No fresh execution or current import reachability result is claimed. Complete prior account preserved verbatim below as historical: Audit5765 companion to audit5760 retires the whole simulator-palette-search.test.ts suite. Direct same-ID local/remote simulator candidate ownership and ambiguous hostless legacy refusal alarms are intentionally lost without equivalent replacement. Four compound unit commands are narrowed and its testFiles entry removed. Browser candidate and paired Cmd-J selection assertions remain unchanged, with only their original scope; they are not certified as replacements. All complete dated evidenceRuns remain unchanged; none selects this removed suite, and none validates changed commands. No fresh execution, current import reachability, replacement coverage or native/platform/remote result is claimed. Complete prior account is preserved verbatim below as historical, including any older then-retained coverage claim: Audit5718 companion to audit5715 retires the whole worktree-checks-review-index.test.ts suite. Its remaining same-ID local/SSH Worktree-object review-index isolation alarm is intentionally lost without equivalent replacement. Remove its standalone selector, narrow two compound selectors, and remove its testFiles/assertionRefs entries. Two complete dated failed receipts selecting this suite through command/currentCommand are retired unchanged into knownGaps; they do not validate any remaining selector. All unrelated selectors, assertions and receipts retain only their original scope. No fresh execution, current import reachability, provider/native/platform or replacement coverage is claimed. Complete prior account preserved verbatim: Audit5658 integrates source audit5652: retire the whole web-session-tabs-sync-mirror-identity.test.ts suite and its exact active selectors. Intentionally lose same-id host mirror snapshot and removal isolation alarms without replacement. Remaining selectors retain only their own scope; no fresh execution, native/platform or remote evidence is claimed. Complete original selector fields are preserved in knownGaps. Historical prior account (preserved verbatim): Audit3663 renews approved3644/3645/3648/amended3651 at privatec1ef: remove10authored/26finite across7changedtestpaths,4whole drivers; retain23authored/24finite including actualcmdkStrictMode defaultcursor race. Retire version1.5.0/1.5.1→shrinksImages capability threshold and launch-to-prompt wiring alarm. Surviving prompt tests explicitly supply capability and do not replace wiring coverage. Retire resolved-before-personOnly precedence; hook-gone/live-dialog guidance; stale-incarnation versus live-looking dialog classification; delayed/clipped warning extraction and wait-for-paint wiring; 3row setting/personOnly approve/deny/disclaimer suggestion composition;13row setting/reason/person/coordinator admission, close/mail attribution, terminal delivery/refusal/preanswered/personOnly/dropped-allow handler propagation alarms. Real state/access/SQLite effects occur; these genuine losses are accepted, not mocked-away. Retire full command extraction from serialized JSON in worker receipt and nontruncation alarm; no rendering, actual worker approval or native shell proof. Retire2row extra-source first/last order and controlled default cursor projection, plus generic open-palette livefolder add/remove render alarm. Explicitly supersede rawexact297KEEP refresh. Keep actualcmdk/StrictMode default cursor race driver; no default-suite loss claim. No equivalent replacement asserted. Retained queue/commit/retryownership/filebudget, terminalfreshness/provenance/competing-answer, RPC DB-effect, qualifiedfolder/runtimehandoff and lingering-reopen cases have distinct scope. Audit3675 preserves the upstream revised unreported-approval close regression, its escalation helper and adapted survivors. Source-only static renewal; no runner/compiler/app/native/remote/CI claim. Upstream41390host-owned approvalwatch/report lifetime reviewed separately; no new lifetime test removed. Preserve all earlier metadata/evidence. Audit3381 intentionally removes the entire Cmd-J host-qualified candidate-ownership suite and its active selectors/assertion. The hidden same-id sibling ambiguity regression alarm is lost without replacement. The complete original dated failed receipt below is retired verbatim, including both command and currentCommand, rather than reassigned as validation of remaining selectors. Other complete receipts retain their exact original scopes; remaining browser/simulator/workspace/e2e selectors do not imply equivalent ownership protection. No fresh execution is claimed. Audit3359 retires the whole ensure-simulator-tab-behavior suite: host-collision reuse, host stamping, inactive creation and unknown-owner routing alarms are intentionally lost without equivalent replacement. Its standalone command is removed and four compound commands narrowed. Three complete dated receipts selecting that source through currentCommand are retired verbatim, including their compound historical selectors; no retained test inherits their validation. Seven unrelated macOS receipts retain their original scope. No fresh runtime/UI, simulator, provider, historical-import, mobile, mixed-version or cross-platform validation is claimed. Audit 3301 removes the orphaned mobile file-close fallback and ordinary cross-content MRU examples from tabs-open-close-lifecycle.test.ts. Earlier descriptions of retained MRU coverage are historical. Audit5612 retires the remaining integrated mobile markdown close/frame-settlement suite, accepting loss of its closed-editor snapshot republishing alarm without replacement or fresh validation. Preserve the existing administrative failed receipt and all complete retired receipts verbatim, along with selectors and unrelated assertions; no equivalent replacement or fresh Cmd-J, native or remote result is claimed. Audit 3273 removes 14 authored declarations and 19 expanded scenarios across four whole suites and eight partial suites. Retired alarms cover saved-local cancellation/layout ownership, ambiguous-owner warning reset, folder attachment routing, VM false-capability bypass, abandoned reveal warmup cleanup and viewport claim deduplication/rearming, quiet unrelated remote-removal refusal, startup-command one-shot consumption, repository/floating recovery-ledger rows, fake-React pinned-scroll intent, split-ratio state identity/subscriber suppression and fractional change, cross-host project-group join refusal, three PR request-lifetime permutations, upstream-status preservation on error, and unresolved Git-owner refusal. These regression checks are intentionally lost under the test-value audit; retained scenarios are not equivalent replacements. Historical coverage receipts remain historical, including gate35 subscriber claims. Audit2729 reduces browser-page-palette-activation.test.ts: separate SSH/paired-runtime alias forwarding, distinct multigroup views accepted, and remote-folder activation forwarding alarms are removed. Collision refusal, preactivation address-bar focus capture, owning-group activation state and missing-tab refusal remain byte-identical. No equivalent replacement, fresh gate execution or actual host/browser delivery evidence is claimed. Prior coverage account: Audit2697 browser source review (metadata followup2702): Reduce src/renderer/src/lib/browser/palette/browser-palette-page-entries.test.ts by four authored/expanded cases without replacement. The remaining three cases preserve only their existing same-ID execution-host separation, absent stamped-owner refusal and ambiguous legacy-bucket refusal scope. Intentionally lose duplicate backing-tab-ID suppression, multiple unified-browser claims of one workspace, foreign-worktree unified-tab rejection, and the 1000-workspace output/internal getter-read budget alarm. These are real removed alarms; the retained host cases are not equivalent replacements. Current test-value policy rejects internal getter/read budgets; no replacement performance or measured-cost claim is made. Keep existing nonempty selectors and the retained same-ID browser assertionRef. No fresh gate execution or reduced-source validation is supplied; dated receipts, results, commands and historical coverage accounts remain within their original source scope. No live browser activation, physical provider, mixed-version execution, mobile, native UI, platform hardware, soak or timing result is added. Prior coverage account (preserved verbatim): Audit2266 reduces cmd-j-host-qualified-candidate-ownership.test.ts to the scoped open-tab hidden same-ID legacy ambiguity refusal. Separate browser/simulator paired-runtime alias and current-row projections, generic workspace host projection and hostless explicit-owner refusal examples are removed without equivalent replacement. No fresh gate execution, browser activation, physical host, simulator or remote delivery evidence is claimed. Historical dated receipts and budgets remain raw-byte exact. Prior coverage account: Audit1899 replays sealed Audit1895: workspace-session-schema.test.ts keeps only cross-workspace truncated-tab salvage and legacy browser-history cap normalization. Four current commands and testFiles retain that reduced source; no current assertionRef or active receipt selects it. SSH file-owner, isolated browser partition, launch/title/quick-command fields, recency, structured-chat/view-mode and remote browser identity hydration alarms are intentionally lost. Existing retired receipt strings and unrelated active receipts remain verbatim. No equivalent replacement, new Cmd-J gate execution, native simulator or remote/browser restore proof is claimed. Historical coverage account before Audit1899: Audit1494 removes use-open-tab-search.test.ts. Supplied host/worktree/title/ranking projections, simple subscription updates and result-array identity alarms are retired. No actual activation or navigation occurred in that suite. No equivalent replacement coverage or fresh Cmd-J gate validation is claimed. Historical receipts remain scoped to their original selectors. Audit1433 narrows worktree-checks-review-index.test.ts to same-ID local/SSH object-key review isolation. Local provider/cache lookup, GitLab preference, suppression/legacy fallback, explicit-PR authority, physical-versus-runtime review isolation, and branchless-workspace alarms are intentionally removed. No equivalent replacement coverage is claimed. Historical receipts and commands remain unchanged and do not certify the reduced source. Historical coverage account: Audit1396 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): Audit1308 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Deterministic candidate-builder contracts inject local and paired-runtime worktrees with the same bare id into the real aggregated tab buckets, including folder workspaces and a paired runtime transporting an SSH-owned worktree. A mirror contract preserves distinct same-id runtime tabs. A paired Electron journey verifies both visible browser rows and both visible simulator rows, then requires each selection to render its owning active tab and update backing host-qualified state. The test-value audit narrowed simulator-palette-search.test.ts to the recency tie, same-id host isolation, ambiguous legacy host rejection and oversized-input getter tripwire. Supplied timestamp, empty-query context ordering, host projection, alias/range, metadata matching, active-tab score, over-token/whitespace and malformed display-name fallback examples were removed. Their separate alarms are lost; retained candidate and activation contracts do not establish equivalent coverage. Historical run commands and results remain historical. The audit also removed the standalone workspace-tab-palette-search suite: supplied row, title, metadata, alias, range, ranking and ownership examples no longer provide their separate alarms. Other retained contracts are not replacement coverage. The mirror-identity fixture now retains same-id sibling-runtime isolation and the repeated-frame subscriber tripwire only. Supplied field, owner, alias and mapping examples are removed; their separate alarms are lost. The retained sibling-runtime case is not equivalent coverage for them. The test-value audit removed tabs-open-close-lifecycle host-stamping examples and ordinary tab/group operations from tabs-pane-layout-operations. Local-null, explicit-runtime and SSH-without-active-host stamp assertions are lost; retained mobile/MRU and subscriber/atomic split cases do not replace them. Candidate and live Cmd-J evidence retains its own scope. Historical commands, outcomes and narratives remain historical. Audit1308: src/renderer/src/lib/browser-palette-search.test.ts removed. Browser-palette token and pasted-query size-guard work alarms disappear. No equivalent replacement coverage is claimed. Audit1386: src/renderer/src/lib/open-mobile-emulator-tab.test.ts reduced. Duplicate attach count and null-tab creation retry/guard reset standalone alarms removed; no simulator device used. 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. Audit1396: src/renderer/src/lib/simulator-palette-search.test.ts reduced. Lose simulator-specific lastFocusedAt tie-order alarm; identity/routing and pre-scan size fence remain. No native simulator or real remote launch claim. No equivalent replacement coverage is claimed. Audit1402: src/renderer/src/runtime/web-session-tabs-sync-mirror-identity.test.ts reduced. Loses repeated no-op frame store-notification budget; independent cross-runtime resource preservation remains. 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://linear.app/stably/issue/STA-4965", "https://github.com/stablyai/orca/pull/15371" ], "invariant": "Candidate identity is the tuple of execution-host identity and worktree identity: same-id sibling hosts retain separate correct browser, simulator, and workspace tabs, each tab appears exactly once, and selection activates its owning host.", - "oracle": "Audit5790 companion to audit5787: Retire simulator palette activation: collision/ambiguous-host refusal and owning split/tab selection alarms are intentionally lost. Narrow3 compound selectors and remove1 testFiles. Complete dated evidenceRuns are unchanged; none selects these retired suites and none validates narrowed selectors. All unrelated remaining assertions and selectors retain their original scope, without replacement certification. No fresh execution or current import reachability result is claimed. Complete prior account preserved verbatim below as historical: Audit5779 companion to audit5775: Retire the complete browser palette activation suite. Colliding child-ID pre-mutation refusal, focus intent captured before page removal, correct split selection and missing authoritative wrapper refusal alarms are intentionally lost without replacement. Narrow three compound commands and remove one testFiles entry. Complete dated evidenceRuns are unchanged; none selects these retired suites and none validates narrowed selectors. All unrelated remaining assertions and selectors retain their original scope, without replacement certification. No fresh execution or current import reachability result is claimed. Complete prior account preserved verbatim below as historical: Audit5765 companion to audit5760 retires the whole simulator-palette-search.test.ts suite. Direct same-ID local/remote simulator candidate ownership and ambiguous hostless legacy refusal alarms are intentionally lost without equivalent replacement. Four compound unit commands are narrowed and its testFiles entry removed. Browser candidate and paired Cmd-J selection assertions remain unchanged, with only their original scope; they are not certified as replacements. All complete dated evidenceRuns remain unchanged; none selects this removed suite, and none validates changed commands. No fresh execution, current import reachability, replacement coverage or native/platform/remote result is claimed. Complete prior account is preserved verbatim below as historical, including any older then-retained coverage claim: Audit5718 companion to audit5715 retires the whole worktree-checks-review-index.test.ts suite. Its remaining same-ID local/SSH Worktree-object review-index isolation alarm is intentionally lost without equivalent replacement. Remove its standalone selector, narrow two compound selectors, and remove its testFiles/assertionRefs entries. Two complete dated failed receipts selecting this suite through command/currentCommand are retired unchanged into knownGaps; they do not validate any remaining selector. All unrelated selectors, assertions and receipts retain only their original scope. No fresh execution, current import reachability, provider/native/platform or replacement coverage is claimed. Complete prior account preserved verbatim: Audit5658 integrates source audit5652: retire the whole web-session-tabs-sync-mirror-identity.test.ts suite and its exact active selectors. Intentionally lose same-id host mirror snapshot and removal isolation alarms without replacement. Remaining selectors retain only their own scope; no fresh execution, native/platform or remote evidence is claimed. Complete original selector fields are preserved in knownGaps. Historical prior account (preserved verbatim): Audit3663 renews approved3644/3645/3648/amended3651 at privatec1ef: remove10authored/26finite across7changedtestpaths,4whole drivers; retain23authored/24finite including actualcmdkStrictMode defaultcursor race. Retire version1.5.0/1.5.1→shrinksImages capability threshold and launch-to-prompt wiring alarm. Surviving prompt tests explicitly supply capability and do not replace wiring coverage. Retire resolved-before-personOnly precedence; hook-gone/live-dialog guidance; stale-incarnation versus live-looking dialog classification; delayed/clipped warning extraction and wait-for-paint wiring; 3row setting/personOnly approve/deny/disclaimer suggestion composition;13row setting/reason/person/coordinator admission, close/mail attribution, terminal delivery/refusal/preanswered/personOnly/dropped-allow handler propagation alarms. Real state/access/SQLite effects occur; these genuine losses are accepted, not mocked-away. Retire full command extraction from serialized JSON in worker receipt and nontruncation alarm; no rendering, actual worker approval or native shell proof. Retire2row extra-source first/last order and controlled default cursor projection, plus generic open-palette livefolder add/remove render alarm. Explicitly supersede rawexact297KEEP refresh. Keep actualcmdk/StrictMode default cursor race driver; no default-suite loss claim. No equivalent replacement asserted. Retained queue/commit/retryownership/filebudget, terminalfreshness/provenance/competing-answer, RPC DB-effect, qualifiedfolder/runtimehandoff and lingering-reopen cases have distinct scope. Audit3675 preserves the upstream revised unreported-approval close regression, its escalation helper and adapted survivors. Source-only static renewal; no runner/compiler/app/native/remote/CI claim. Upstream41390host-owned approvalwatch/report lifetime reviewed separately; no new lifetime test removed. Preserve all earlier metadata/evidence. Audit3381 intentionally removes the entire Cmd-J host-qualified candidate-ownership suite and its active selectors/assertion. The hidden same-id sibling ambiguity regression alarm is lost without replacement. The complete original dated failed receipt below is retired verbatim, including both command and currentCommand, rather than reassigned as validation of remaining selectors. Other complete receipts retain their exact original scopes; remaining browser/simulator/workspace/e2e selectors do not imply equivalent ownership protection. No fresh execution is claimed. Audit3359 retires the whole ensure-simulator-tab-behavior suite: host-collision reuse, host stamping, inactive creation and unknown-owner routing alarms are intentionally lost without equivalent replacement. Its standalone command is removed and four compound commands narrowed. Three complete dated receipts selecting that source through currentCommand are retired verbatim, including their compound historical selectors; no retained test inherits their validation. Seven unrelated macOS receipts retain their original scope. No fresh runtime/UI, simulator, provider, historical-import, mobile, mixed-version or cross-platform validation is claimed. Audit 3301 removes the orphaned mobile file-close fallback and ordinary cross-content MRU examples from tabs-open-close-lifecycle.test.ts. Earlier descriptions of retained MRU coverage are historical. Audit5612 retires the remaining integrated mobile markdown close/frame-settlement suite, accepting loss of its closed-editor snapshot republishing alarm without replacement or fresh validation. Preserve the existing administrative failed receipt and all complete retired receipts verbatim, along with selectors and unrelated assertions; no equivalent replacement or fresh Cmd-J, native or remote result is claimed. Audit 3273 removes 14 authored declarations and 19 expanded scenarios across four whole suites and eight partial suites. Retired alarms cover saved-local cancellation/layout ownership, ambiguous-owner warning reset, folder attachment routing, VM false-capability bypass, abandoned reveal warmup cleanup and viewport claim deduplication/rearming, quiet unrelated remote-removal refusal, startup-command one-shot consumption, repository/floating recovery-ledger rows, fake-React pinned-scroll intent, split-ratio state identity/subscriber suppression and fractional change, cross-host project-group join refusal, three PR request-lifetime permutations, upstream-status preservation on error, and unresolved Git-owner refusal. These regression checks are intentionally lost under the test-value audit; retained scenarios are not equivalent replacements. Historical coverage receipts remain historical, including gate35 subscriber claims. Audit2697 browser source review (metadata followup2702): Reduce src/renderer/src/lib/browser/palette/browser-palette-page-entries.test.ts by four authored/expanded cases without replacement. The remaining three cases preserve only their existing same-ID execution-host separation, absent stamped-owner refusal and ambiguous legacy-bucket refusal scope. Intentionally lose duplicate backing-tab-ID suppression, multiple unified-browser claims of one workspace, foreign-worktree unified-tab rejection, and the 1000-workspace output/internal getter-read budget alarm. These are real removed alarms; the retained host cases are not equivalent replacements. Current test-value policy rejects internal getter/read budgets; no replacement performance or measured-cost claim is made. Keep existing nonempty selectors and the retained same-ID browser assertionRef. No fresh gate execution or reduced-source validation is supplied; dated receipts, results, commands and historical coverage accounts remain within their original source scope. No live browser activation, physical provider, mixed-version execution, mobile, native UI, platform hardware, soak or timing result is added. Prior coverage account (preserved verbatim): Audit2266 current retained source checks only that scoped open-tab search rejects hostless legacy browser, simulator and workspace tabs when a hidden same-ID sibling host remains in the ownership catalog. Reduced selectors require fresh validation; existing historical receipts do not validate the changed source. Prior oracle account: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): Aggregate two hosts' tabs under one intentionally colliding worktree id, stamp each unified tab with its execution host, and require exactly one candidate per owner. Repeat with an SSH physical owner transported by a paired-runtime alias. Independently require each browser and simulator Cmd-J selection to update activeWorkspaceExecutionHostId plus its owning workspace/group and render the selected tab active. Ambiguous legacy tabs without ownership fail closed.", + "oracle": "Audit5910 retires the complete browser-palette-page-entries suite: same-ID host-qualified search rows, missing stamped-owner refusal and ambiguous legacy-bucket refusal alarms are intentionally lost without equivalent replacement. Remove two standalone selectors, narrow two compound selectors and remove its testFiles/assertionRefs entries. Remaining selectors/assertions retain only their original scope. All complete dated evidenceRuns remain unchanged; none selects this source and none validates the changed selectors. Complete prior account retained verbatim: Audit5790 companion to audit5787: Retire simulator palette activation: collision/ambiguous-host refusal and owning split/tab selection alarms are intentionally lost. Narrow3 compound selectors and remove1 testFiles. Complete dated evidenceRuns are unchanged; none selects these retired suites and none validates narrowed selectors. All unrelated remaining assertions and selectors retain their original scope, without replacement certification. No fresh execution or current import reachability result is claimed. Complete prior account preserved verbatim below as historical: Audit5779 companion to audit5775: Retire the complete browser palette activation suite. Colliding child-ID pre-mutation refusal, focus intent captured before page removal, correct split selection and missing authoritative wrapper refusal alarms are intentionally lost without replacement. Narrow three compound commands and remove one testFiles entry. Complete dated evidenceRuns are unchanged; none selects these retired suites and none validates narrowed selectors. All unrelated remaining assertions and selectors retain their original scope, without replacement certification. No fresh execution or current import reachability result is claimed. Complete prior account preserved verbatim below as historical: Audit5765 companion to audit5760 retires the whole simulator-palette-search.test.ts suite. Direct same-ID local/remote simulator candidate ownership and ambiguous hostless legacy refusal alarms are intentionally lost without equivalent replacement. Four compound unit commands are narrowed and its testFiles entry removed. Browser candidate and paired Cmd-J selection assertions remain unchanged, with only their original scope; they are not certified as replacements. All complete dated evidenceRuns remain unchanged; none selects this removed suite, and none validates changed commands. No fresh execution, current import reachability, replacement coverage or native/platform/remote result is claimed. Complete prior account is preserved verbatim below as historical, including any older then-retained coverage claim: Audit5718 companion to audit5715 retires the whole worktree-checks-review-index.test.ts suite. Its remaining same-ID local/SSH Worktree-object review-index isolation alarm is intentionally lost without equivalent replacement. Remove its standalone selector, narrow two compound selectors, and remove its testFiles/assertionRefs entries. Two complete dated failed receipts selecting this suite through command/currentCommand are retired unchanged into knownGaps; they do not validate any remaining selector. All unrelated selectors, assertions and receipts retain only their original scope. No fresh execution, current import reachability, provider/native/platform or replacement coverage is claimed. Complete prior account preserved verbatim: Audit5658 integrates source audit5652: retire the whole web-session-tabs-sync-mirror-identity.test.ts suite and its exact active selectors. Intentionally lose same-id host mirror snapshot and removal isolation alarms without replacement. Remaining selectors retain only their own scope; no fresh execution, native/platform or remote evidence is claimed. Complete original selector fields are preserved in knownGaps. Historical prior account (preserved verbatim): Audit3663 renews approved3644/3645/3648/amended3651 at privatec1ef: remove10authored/26finite across7changedtestpaths,4whole drivers; retain23authored/24finite including actualcmdkStrictMode defaultcursor race. Retire version1.5.0/1.5.1→shrinksImages capability threshold and launch-to-prompt wiring alarm. Surviving prompt tests explicitly supply capability and do not replace wiring coverage. Retire resolved-before-personOnly precedence; hook-gone/live-dialog guidance; stale-incarnation versus live-looking dialog classification; delayed/clipped warning extraction and wait-for-paint wiring; 3row setting/personOnly approve/deny/disclaimer suggestion composition;13row setting/reason/person/coordinator admission, close/mail attribution, terminal delivery/refusal/preanswered/personOnly/dropped-allow handler propagation alarms. Real state/access/SQLite effects occur; these genuine losses are accepted, not mocked-away. Retire full command extraction from serialized JSON in worker receipt and nontruncation alarm; no rendering, actual worker approval or native shell proof. Retire2row extra-source first/last order and controlled default cursor projection, plus generic open-palette livefolder add/remove render alarm. Explicitly supersede rawexact297KEEP refresh. Keep actualcmdk/StrictMode default cursor race driver; no default-suite loss claim. No equivalent replacement asserted. Retained queue/commit/retryownership/filebudget, terminalfreshness/provenance/competing-answer, RPC DB-effect, qualifiedfolder/runtimehandoff and lingering-reopen cases have distinct scope. Audit3675 preserves the upstream revised unreported-approval close regression, its escalation helper and adapted survivors. Source-only static renewal; no runner/compiler/app/native/remote/CI claim. Upstream41390host-owned approvalwatch/report lifetime reviewed separately; no new lifetime test removed. Preserve all earlier metadata/evidence. Audit3381 intentionally removes the entire Cmd-J host-qualified candidate-ownership suite and its active selectors/assertion. The hidden same-id sibling ambiguity regression alarm is lost without replacement. The complete original dated failed receipt below is retired verbatim, including both command and currentCommand, rather than reassigned as validation of remaining selectors. Other complete receipts retain their exact original scopes; remaining browser/simulator/workspace/e2e selectors do not imply equivalent ownership protection. No fresh execution is claimed. Audit3359 retires the whole ensure-simulator-tab-behavior suite: host-collision reuse, host stamping, inactive creation and unknown-owner routing alarms are intentionally lost without equivalent replacement. Its standalone command is removed and four compound commands narrowed. Three complete dated receipts selecting that source through currentCommand are retired verbatim, including their compound historical selectors; no retained test inherits their validation. Seven unrelated macOS receipts retain their original scope. No fresh runtime/UI, simulator, provider, historical-import, mobile, mixed-version or cross-platform validation is claimed. Audit 3301 removes the orphaned mobile file-close fallback and ordinary cross-content MRU examples from tabs-open-close-lifecycle.test.ts. Earlier descriptions of retained MRU coverage are historical. Audit5612 retires the remaining integrated mobile markdown close/frame-settlement suite, accepting loss of its closed-editor snapshot republishing alarm without replacement or fresh validation. Preserve the existing administrative failed receipt and all complete retired receipts verbatim, along with selectors and unrelated assertions; no equivalent replacement or fresh Cmd-J, native or remote result is claimed. Audit 3273 removes 14 authored declarations and 19 expanded scenarios across four whole suites and eight partial suites. Retired alarms cover saved-local cancellation/layout ownership, ambiguous-owner warning reset, folder attachment routing, VM false-capability bypass, abandoned reveal warmup cleanup and viewport claim deduplication/rearming, quiet unrelated remote-removal refusal, startup-command one-shot consumption, repository/floating recovery-ledger rows, fake-React pinned-scroll intent, split-ratio state identity/subscriber suppression and fractional change, cross-host project-group join refusal, three PR request-lifetime permutations, upstream-status preservation on error, and unresolved Git-owner refusal. These regression checks are intentionally lost under the test-value audit; retained scenarios are not equivalent replacements. Historical coverage receipts remain historical, including gate35 subscriber claims. Audit2697 browser source review (metadata followup2702): Reduce src/renderer/src/lib/browser/palette/browser-palette-page-entries.test.ts by four authored/expanded cases without replacement. The remaining three cases preserve only their existing same-ID execution-host separation, absent stamped-owner refusal and ambiguous legacy-bucket refusal scope. Intentionally lose duplicate backing-tab-ID suppression, multiple unified-browser claims of one workspace, foreign-worktree unified-tab rejection, and the 1000-workspace output/internal getter-read budget alarm. These are real removed alarms; the retained host cases are not equivalent replacements. Current test-value policy rejects internal getter/read budgets; no replacement performance or measured-cost claim is made. Keep existing nonempty selectors and the retained same-ID browser assertionRef. No fresh gate execution or reduced-source validation is supplied; dated receipts, results, commands and historical coverage accounts remain within their original source scope. No live browser activation, physical provider, mixed-version execution, mobile, native UI, platform hardware, soak or timing result is added. Prior coverage account (preserved verbatim): Audit2266 current retained source checks only that scoped open-tab search rejects hostless legacy browser, simulator and workspace tabs when a hidden same-ID sibling host remains in the ownership catalog. Reduced selectors require fresh validation; existing historical receipts do not validate the changed source. Prior oracle account: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): Aggregate two hosts' tabs under one intentionally colliding worktree id, stamp each unified tab with its execution host, and require exactly one candidate per owner. Repeat with an SSH physical owner transported by a paired-runtime alias. Independently require each browser and simulator Cmd-J selection to update activeWorkspaceExecutionHostId plus its owning workspace/group and render the selected tab active. Ambiguous legacy tabs without ownership fail closed.", "commands": [ "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/worktree-jump/WorktreeJumpPalette.test.tsx", - "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/browser/palette/browser-palette-page-entries.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/browser/palette/browser-palette-page-entries.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/worktree-jump/WorktreeJumpPalette.test.tsx src/renderer/src/lib/browser/palette/browser-palette-page-entries.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/worktree-jump/WorktreeJumpPalette.test.tsx src/renderer/src/lib/browser/palette/browser-palette-page-entries.test.ts src/renderer/src/lib/simulator/launch/open-mobile-emulator-tab.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/worktree-jump/WorktreeJumpPalette.test.tsx", + "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/worktree-jump/WorktreeJumpPalette.test.tsx src/renderer/src/lib/simulator/launch/open-mobile-emulator-tab.test.ts", "pnpm exec playwright test tests/e2e/paired-cmd-j-host-qualified-tabs.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1", "SKIP_BUILD=1 pnpm exec playwright test tests/e2e/paired-cmd-j-host-qualified-tabs.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1" ], "testFiles": [ "src/renderer/src/components/worktree-jump/WorktreeJumpPalette.test.tsx", - "src/renderer/src/lib/browser/palette/browser-palette-page-entries.test.ts", "src/renderer/src/lib/simulator/launch/open-mobile-emulator-tab.test.ts", "tests/e2e/paired-cmd-j-host-qualified-tabs.spec.ts" ], "assertionRefs": [ - { - "file": "src/renderer/src/lib/browser/palette/browser-palette-page-entries.test.ts", - "assertions": [ - "same-id local and remote browser tabs appear once under their owning hosts" - ] - }, { "file": "tests/e2e/paired-cmd-j-host-qualified-tabs.spec.ts", "assertions": [ @@ -2383,7 +2374,8 @@ "Audit5779 exact original complete assertionRefs JSON value, preserved verbatim as historical selector metadata; changed selectors have no new validation:\n[\n {\n \"file\": \"src/renderer/src/lib/browser/palette/browser-palette-page-entries.test.ts\",\n \"assertions\": [\n \"same-id local and remote browser tabs appear once under their owning hosts\"\n ]\n },\n {\n \"file\": \"tests/e2e/paired-cmd-j-host-qualified-tabs.spec.ts\",\n \"assertions\": [\n \"both browser selections activate and render their owning host and workspace\",\n \"both simulator selections activate and render their owning host and group\"\n ]\n }\n ]", "Audit5790 exact original complete commands JSON value, preserved verbatim as historical selector metadata; changed selectors have no new validation:\n[\n \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/worktree-jump/WorktreeJumpPalette.test.tsx\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/browser/palette/browser-palette-page-entries.test.ts src/renderer/src/lib/simulator/search/simulator-palette-search.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/browser/palette/browser-palette-page-entries.test.ts src/renderer/src/lib/simulator/search/simulator-palette-search.test.ts src/renderer/src/lib/browser/palette/browser-page-palette-activation.test.ts src/renderer/src/lib/simulator/tabs/simulator-tab-palette-activation.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/worktree-jump/WorktreeJumpPalette.test.tsx src/renderer/src/lib/browser/palette/browser-palette-page-entries.test.ts src/renderer/src/lib/simulator/search/simulator-palette-search.test.ts src/renderer/src/lib/browser/palette/browser-page-palette-activation.test.ts src/renderer/src/lib/simulator/tabs/simulator-tab-palette-activation.test.ts\",\n \"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/worktree-jump/WorktreeJumpPalette.test.tsx src/renderer/src/lib/browser/palette/browser-palette-page-entries.test.ts src/renderer/src/lib/simulator/search/simulator-palette-search.test.ts src/renderer/src/lib/browser/palette/browser-page-palette-activation.test.ts src/renderer/src/lib/simulator/tabs/simulator-tab-palette-activation.test.ts src/renderer/src/lib/simulator/launch/open-mobile-emulator-tab.test.ts\",\n \"pnpm exec playwright test tests/e2e/paired-cmd-j-host-qualified-tabs.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1\",\n \"SKIP_BUILD=1 pnpm exec playwright test tests/e2e/paired-cmd-j-host-qualified-tabs.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1\"\n ]", "Audit5790 exact original complete testFiles JSON value, preserved verbatim as historical selector metadata; changed selectors have no new validation:\n[\n \"src/renderer/src/components/worktree-jump/WorktreeJumpPalette.test.tsx\",\n \"src/renderer/src/lib/browser/palette/browser-palette-page-entries.test.ts\",\n \"src/renderer/src/lib/simulator/search/simulator-palette-search.test.ts\",\n \"src/renderer/src/lib/browser/palette/browser-page-palette-activation.test.ts\",\n \"src/renderer/src/lib/simulator/tabs/simulator-tab-palette-activation.test.ts\",\n \"src/renderer/src/lib/simulator/launch/open-mobile-emulator-tab.test.ts\",\n \"tests/e2e/paired-cmd-j-host-qualified-tabs.spec.ts\"\n ]", - "Audit5790 exact original complete assertionRefs JSON value, preserved verbatim as historical selector metadata; changed selectors have no new validation:\n[\n {\n \"file\": \"src/renderer/src/lib/browser/palette/browser-palette-page-entries.test.ts\",\n \"assertions\": [\n \"same-id local and remote browser tabs appear once under their owning hosts\"\n ]\n },\n {\n \"file\": \"tests/e2e/paired-cmd-j-host-qualified-tabs.spec.ts\",\n \"assertions\": [\n \"both browser selections activate and render their owning host and workspace\",\n \"both simulator selections activate and render their owning host and group\"\n ]\n }\n ]" + "Audit5790 exact original complete assertionRefs JSON value, preserved verbatim as historical selector metadata; changed selectors have no new validation:\n[\n {\n \"file\": \"src/renderer/src/lib/browser/palette/browser-palette-page-entries.test.ts\",\n \"assertions\": [\n \"same-id local and remote browser tabs appear once under their owning hosts\"\n ]\n },\n {\n \"file\": \"tests/e2e/paired-cmd-j-host-qualified-tabs.spec.ts\",\n \"assertions\": [\n \"both browser selections activate and render their owning host and workspace\",\n \"both simulator selections activate and render their owning host and group\"\n ]\n }\n ]", + "Audit5910 retires the complete browser-palette-page-entries suite: same-ID host-qualified search rows, missing stamped-owner refusal and ambiguous legacy-bucket refusal alarms are intentionally lost without equivalent replacement. Remove two standalone selectors, narrow two compound selectors and remove its testFiles/assertionRefs entries. Remaining selectors/assertions retain only their original scope. All complete dated evidenceRuns remain unchanged; none selects this source and none validates the changed selectors." ], "demotionRule": "Cannot promote if a same-id sibling tab duplicates, disappears, activates another host, or if ambiguous unstamped ownership is guessed." }, @@ -4125,7 +4117,7 @@ "providers": ["remote-runtime"], "coveredPlatforms": ["macos"], "coveredProviders": [], - "coverageNotes": "Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit5583 removes the entire src/renderer/src/lib/browser/documents/doc-preview-grants.test.ts suite and its active selectors. Intentionally lose stale preview grant rejection and newer-capability preservation alarms without equivalent replacement or fresh gate evidence. Historical prior account follows: Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit3994 retires two authored callbacks imported by the shared construction test driver: split OSC 9999 carry and rendererless status ownership, plus OpenCode permission text taking priority in status and tui-idle refusal. Remaining imports and selectors keep their scope. No equivalent replacement or fresh gate execution is claimed. Audit3460 final-v2 composes accepted AUTHOR3454/PEER3455 on actual post263 main: intentionally removes99 authored/106 potential expanded cases across16 selected drivers, including7 whole suites, retaining24 authored/26 potential cases. No equivalent replacement or fresh runtime is claimed. The complete mocked session-close routing suite is removed, including the explicit cross-worktree cleanup alarm. Remove its active file, command token and assertion reference; historical selectors and receipts retain their original scope. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3342 retires the complete mobile editor/diff tab-publication projection suite: editor/diff serialization, workspace-document privacy withholding, pending/focus and capability/options projections are intentionally lost without equivalent replacement. The surviving focused selectors are unexecuted in this source composition. Six complete compound macOS receipts whose command fields select the changed source are retired verbatim as history; their other selected tests receive no promoted evidence. Other dated receipts keep their original scope; no fresh runtime/UI/mobile/mixed-version or cross-platform validation is claimed. Audit3335 retires the complete three-case browser-tabs snapshot assembly suite: canonical snapshot replay/placement/focus, local host-page adoption and unstamped host echo leaving a local page untouched alarms are intentionally lost without equivalent replacement. The surviving focused selector is unexecuted in this source composition. Unrelated dated receipts keep their original scope; no fresh runtime/network, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Audit 3301 removes the caller-chat-target precedence over host selection example from web-session-tabs-sync-focus-intent.test.ts. The snapshot-before-RPC replay and split-sibling-first exact-leaf focus cases remain unchanged and match the existing assertion reference. Preserve current selectors, assertion references, unrelated active receipts and complete archived history. These mocked state-composition survivors provide no equivalent replacement, rendered, native, network or fresh execution proof. Audit3108: doc-preview-grants.test.ts now retains only the stale grant-rejection race: a late rejected grant request must not evict a newer grant registry entry, witnessed by later revocation of grant-2. Retire stable minted-location and outside-workspace POSIX/Windows request-projection alarms without replacement. The direct nonempty grant selector remains unchanged; no real grant-server/file authorization, SSH/HTML delivery or native-focus result is claimed. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2043: Remove the registration-wait, webview-security, preview-authorization, guest-lifecycle and grant-IPC unit suites and the sibling-directory assertion reference. Runtime and browser capability consumers also lose removed imported examples. Remaining document-policy, file-reader and grant-registry assertions do not replace those alarms. Preserve the 27 independent dated receipts at their original unchanged selectors; reduced prospective unit selectors have no fresh result or equivalent replacement claim. Historical prior account (preserved verbatim): Audit1973: Delete the browser RPC forwarding/schema/scalar suite and its prospective selector. Preserve all27 unrelated dated receipts; no actual browser operation alarm is replaced. 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): Audit1925 (sources1922/1923): The complete terminal-file-link-actions suite is removed. Lose supplied local/remote menu-row inventories, browser label/order/download/reveal callback forwarding, platform-copy and source-group pinning examples. No OS reveal/download, real remote preview or browser navigation was exercised; the other real document-preview sources are not equivalent replacements. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1899 replays sealed Audit1895: workspace-doc-history.test.ts is entirely removed from its current command and testFiles. Supplied recency/dedupe/cap/title/identity examples and the10000-row getter-read budget alarm are intentionally lost. No current assertionRef or active receipt selects that file. Unrelated active receipts and all prior gap literals remain verbatim; no replacement history/index-work coverage or new browser/paired-preview gate execution is claimed. Historical coverage account before Audit1899: Audit1853 reduces LinkActionPopover.test.tsx and archives its complete 2026-09-06 mixed-selector receipt. The lost copy/open-state and Settings callback-order/omission alarms are accepted without equivalent replacement coverage. No fresh execution of this gate is credited. Audit1709 removes low-value test definitions and retires affected assertion or execution-receipt claims without equivalent replacement coverage. Per-source reviews bound retained behavior and injected/native/remote limits. Unchanged assertions and receipts keep their original scope; gates lacking current active evidence are downgraded. Historical scope before this audit: Audit1687 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: Audit1630 removes low-value Git, GitHub/GitLab and IPC 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: Audit1571 removes mock forwarding, capability/schema inventories, private predicates, supplied error/result replays, and filesystem-mocked persistence checks without equivalent replacement claims. Retained changed tests also exercise real local permission-file reread, registry proxy rollback/credential retirement, site display recovery, and pending sender/credential/document admission with injected Electron/UI producers. Retained network tests exercise owned stream credit/cleanup, generation and retirement fences, real loopback proxy/SOCKS bytes and file-backed binding state. SSH/WSL/paired runtime, native sessions, authority producers and storage clears remain injected; simulated relaunch uses filesystem mocks. The unchanged profile-retirement suite was statically reviewed and not rerun. No actual SSH/WSL runtime, native Chromium jar deletion, durable process restart, remote DNS or external site proof. Receipts selecting changed tests are retired and unaffected receipts remain unchanged. Historical scope before this audit: Audit1568 removes API inventories, supplied mock-value/forwarding assertions, implementation-shape tables and negative/setup cases that do not reach their intended boundary, without equivalent replacement claims. Retained changed definitions exercise owned manager lifetime/queue/refcount/clamp and real synthetic process/files/staging boundaries. Seventeen unchanged native Electron definitions across this combined audit are statically reviewed and not rerun. Changed native suites exercise local popup wire/cookie/session and clean/native process-identity behavior; known popup-admission flaws remain unfixed. Unit native/event/session/registry inputs remain injected. No actual OS focus, registry/host execution, CRX verification or durable restart proof. Receipts selecting changed tests are retired and unaffected receipts remain unchanged. Historical scope before this audit: Audit1564 retires copied cookie key recipes, mock bridge/preview forwarding and flag tables, source-spelling/script inventories and setup-only alarms without equivalent replacement coverage. Retained changed cases exercise actual scoped SQLite merge/rollback/schema refusal, owned cancellation and grant authority/canonical containment, ranged response consistency, replacement guest ownership and executed guest-script promise/DOM cleanup behavior. Session, host response, geometry/observer and transport producers remain injected where documented. One unchanged native extension definition is not rerun locally; no actual remote filesystem, native layout/focus or authentication claim. Receipts selecting modified tests are retired; unaffected exact-selector receipts remain unchanged. Historical scope before this audit: 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): Audit1386 changes referenced sources; no new execution result validates reduced selectors. Retained unchanged receipts apply only to unchanged commands. Historical coverage: Audit1308 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): A macOS desktop host and a separate paired Electron client exercise the Explorer preview action end to end: the document renders inside the client-local orca-preview guest, the client gains exactly one browser workspace and it is the document one, the host's own page registry and tab snapshot gain nothing, the split does not take focus from the source editor, an explicit click activates the preview, and closing it with its X leaves the editor and terminal intact. Both host oracles are read in a run where an ordinary URL browser tab from the same client does arrive in them, because a host that cannot project browser pages at all would otherwise answer the absence question the same way. A second journey quits that client with a document tab open and relaunches it on the same profile, which is the restore the user's original report turned on: the same workspace row comes back blank and named by the document, renders again, and does so over a grant URL that differs from the one that was quit. The same journey pins the guest URL to the orca-preview scheme, so a regression back to file:// or to a host browser page is visible. The rewritten journey caught a live gap the old one could not see: since previews became browser pages they had no chrome to hand focus to their guest, so main refused every reported link click as coming from an unfocused guest and the one route out of a preview was dead. Main's own log answered it — registered true, grant live, focused false — after the embedder reported the anchor really taking six real presses. The pane now hands focus over when it is the reader's surface, and the journey routes. The preview's own components moved out of the editor folder into browser-pane/workspace-doc/ with this change, since a preview is a browser pane and no longer an editor one; their i18n keys keep the historical auto.components.editor.HtmlDocPreview prefix rather than dropping thirty translated strings across four locales for a tidier key path. Seven gate commands named those files by their old paths and were re-issued at the new ones, and the nine dated runs behind them were retired rather than left naming files that are no longer there, on the same principle this gate already applied twice: vitest treats a missing named file as a filter and exits 0, so such a command reports green while silently running only the half that still exists. Each retired record's finding is carried into the replacement run recorded below it, including the red half of the entry/subresource pair, which was re-measured by re-applying its mutant at the new path rather than being dropped. The fence over the page-management channels was decided channel by channel before it was built, and that decision record is: of the 23 channels that can name a page, 6 are allowed for a workspace-document page — the tool channels the reader drives, which reach it through the one authority that reads both halves of the registry — 9 refuse (download accept and cancel, devtools, certificate proceed, client page metadata publish, viewport override, WebAuthn account response, registration probe, registration repair), 3 cannot name a page at all because they take a profile or a worktree instead, and the rest are the registration and activation doors, refused on membership. What shipped is not the per-channel guard that classification implies: eleven call sites read the browsing map directly, so a guard per channel is exactly the caller-flag seam that has to be remembered at every future call site. The registry was split in two instead, which makes the classification structural — a document guest is absent from the browsing map, so every refusing channel refuses by absence rather than by a guard, and a channel added later inherits the refusal without being classified at all. Unit contracts cover grant scoping and path containment, per-owner read routing, refusal of a truncated or over-cap read, the old-server binary degradation, scheme admission on will-attach-webview, the guest navigation policy, the plan layer's local/SSH/paired/out-of-worktree routing, and the distinct sentence the reader sees for each failure reason. The paired browser-creation surfaces this gate still owns — capability rejection cleanup, canonical page identity, reconciliation rollback, close convergence — keep their existing headed and headless journeys. Linux and Windows live journeys remain gaps. A refused subresource is a notice on a rendered document rather than a failure panel, since only the entry document's failure leaves the reader with nothing; the entry document is served as text by every owner and cannot be refused for its format at all. Grants die with the renderer document that minted them, at window creation and on every reload, because the renderer holds the only record of which preview owns which grant. The mint and revoke channels answer only the trusted renderer, and a preview tab is never republished to mobile clients, which have no grant to read it with. External URLs leave the preview only via a trusted user click on an anchor while the preview is focused; script-driven navigation and popups reach nothing. The guest's navigation sinks are deny-only and route no URL at all, and the guest carries a preview-only preload, pinned by will-attach-webview and denied to every other attach path, whose capture-phase click handler reports an anchor's URL to main; main answers only a report from a preview guest with a live bound grant that is the focused contents, and only for http(s). Two earlier reader-facing records from 2026-08-26, which measured a shape where a subresource failure was filtered out and the panel still carried an unsupported-asset sentence, were retired with that shape rather than left contradicting the 10/10 runs of the command they share. Two more were retired on the same principle when the external-link design changed: a record showing that removing a recent-input gate let the unattended document open two browser tabs, and a record showing that dropping the webview's allowpopups attribute left a target=_blank press with nothing to route. Both measured machinery that no longer exists — the input gate could not tell a script's navigation from the click it followed, which is the case now recorded below, and the preload intercepts the press before Chromium considers a popup at all, so allowpopups was removed. WebRTC is fenced by the guest's IP-handling policy alone: this Chromium answers a webrtc content-security-policy directive as unrecognized and gathers candidates anyway, so the directive is deliberately absent from the served policy and a unit assertion keeps it out. A standalone Electron probe on the same version gathered 7 candidates including a STUN reflexive one without the policy and 0 with it. Two command paths this gate used to carry no longer exist, and their structured evidence was retired with them rather than left naming files that are no longer there: vitest treats a missing named file as a filter and exits 0, so such a command reports green while silently running only the half that still exists. The first is src/renderer/src/lib/file-preview-capability-cleanup.test.ts, deleted in STA-5557 when HTML previews stopped creating paired browser tabs: on 2026-08-12 its five-assertion STA-4063 oracle ran red 5/5 on scan e4c278eb52 and on main bc2e30000b, partially green 2/5 on pre-fix PR #14100, and green 5/5 on candidate 14b5877a75; the surviving half of that oracle is web-runtime-browser-capability-cleanup.test.ts, still commanded above. The second is tests/e2e/paired-remote-html-browser-focus.spec.ts, renamed in STA-5557 to paired-remote-html-preview-local-render.spec.ts because the journey no longer proves anything about browser focus: its 2026-08-12 runs established the owning-runtime routing and no-focus-steal behavior of the then-current browser-tab preview (red on main 346e59c879 and a90a18d43d, green on candidates d05217c40d and b7de9c0961, red again with only the side-preview focus or routing seam disabled), and its 2026-08-26 runs are recorded below under the current path. An adversarial pass after the journey landed found four coverage gaps rather than shipping defects, and all four are pinned here. The page url had a third door: the navigation commit wrote whatever url was reported, unfenced, and while nothing reaches it for a document page today it sat one report away from giving a document page a URL that persistence, the publish boundary and the address bar all read. The group projection was the load-bearing half of the mobile publish boundary that no test had: removing it alone left the whole suite green, because no test in it had tab groups, while the phone payload gained a group whose order and active tab named a document tab it was never sent. The focus handoff was covered only in the narrowing direction, so widening it — dropping the page-activity check, or either half of the reader-surface check — survived both suites. And the handoff itself was offered once and never again, so another app taking the front left the preview's one route out shut until the pane remounted, which is a desktop gap rather than a test-only one. The standalone capability-cleanup and browser-placement ledger suites were removed, including their mixed-version rejection, cleanup transfer, capacity and partition alarms. web-runtime-session.test.ts no longer supplies browser creation, rollback or recovery assertions. The grouped workspace-document exclusion remains; the separate no-group publication example was removed. Existing live/browser-store evidence does not establish equivalent replacement alarms. Earlier descriptions of the removed fixtures and their run results are historical. The client-owned-placement and layout-groups suites are removed. The broad mirror fixture no longer supplies preview placement/reservation/move assertions. Browser rows retain pre-response replay and real local-workspace reuse; focus intent retains response ordering and exact-leaf sibling ordering. Supplied browser-layout and placement/focus projection alarms are lost; retained evidence is narrower and not equivalent. The test-value audit retires renderer grant-release mock ledgers, direct creation/title/session-field copies, notification/onboarding calls and several placement/per-page projections. Canonical-ID rejection, document reopen/restore and preview URL fences remain; they do not prove close-to-registry revocation or replace every lost alarm. Historical execution evidence is unchanged. The test-value audit removed the direct legacy editor-preview hydration example from tabs-hydration.test.ts. Dropping legacy preview chrome while preserving the same-document ordinary editor no longer has that alarm. The surviving corrupt-id deduplication case does not cover that migration, and retained preview journeys are not equivalent replacement coverage. Historical run counts and migration mutation findings describe the earlier suite. Audit1308: src/renderer/src/components/editor/EditorPanelShell.header.test.tsx removed. Header visibility and mocked editor-surface inventory alarms disappear. No equivalent replacement coverage is claimed. 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. Audit1386: src/renderer/src/lib/doc-preview-grants.test.ts reduced. Repeated-mount mint count, ordinary release/remint and failed-mint cache retry standalone alarms removed; no actual grant server/access test. No equivalent replacement coverage is claimed. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. 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/browser/guest-lifecycle/manager/browser-manager-guest-policy-profile.test.ts removed. Loses workspace-document in-grant navigation/popup refusal, cleanup/re-attach, cross-registry guest authorization and browsing-map separation alarms. No equivalent browser policy coverage is claimed. No equivalent replacement coverage is claimed. Audit1421 removes browser-address-bar-suggestions.test.ts. Document suggestion title/path matching, recency merging and path-prefix ranking alarms are lost. No equivalent replacement coverage is claimed. Historical receipts remain scoped to unchanged selectors; the reduced command has no new execution result. Audit2452 removes the whole fake-effect browser-close routing suite. Active selectors and assertion references no longer select it. Its requested-worktree default close, sibling-page close and explicit missing-page typed reply alarms are intentionally retired without equivalent replacement. Prior dated receipts remain unchanged and scoped to their original sources; no fresh execution of the reduced gate, rendered browser, live remote, mobile or cross-platform validation is claimed.", + "coverageNotes": "Audit5910 retires the complete use-doc-preview-guest-tools suite: token-scoped pending-card position after inner scroll, load reset and detached guest listener cleanup alarms are intentionally lost without equivalent replacement. Narrow three compound selectors and remove its testFiles entry. All remaining assertions/selectors and complete dated evidenceRuns retain only their original scope; no fresh validation or replacement claim. Complete prior account retained verbatim: Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit5583 removes the entire src/renderer/src/lib/browser/documents/doc-preview-grants.test.ts suite and its active selectors. Intentionally lose stale preview grant rejection and newer-capability preservation alarms without equivalent replacement or fresh gate evidence. Historical prior account follows: Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit3994 retires two authored callbacks imported by the shared construction test driver: split OSC 9999 carry and rendererless status ownership, plus OpenCode permission text taking priority in status and tui-idle refusal. Remaining imports and selectors keep their scope. No equivalent replacement or fresh gate execution is claimed. Audit3460 final-v2 composes accepted AUTHOR3454/PEER3455 on actual post263 main: intentionally removes99 authored/106 potential expanded cases across16 selected drivers, including7 whole suites, retaining24 authored/26 potential cases. No equivalent replacement or fresh runtime is claimed. The complete mocked session-close routing suite is removed, including the explicit cross-worktree cleanup alarm. Remove its active file, command token and assertion reference; historical selectors and receipts retain their original scope. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3342 retires the complete mobile editor/diff tab-publication projection suite: editor/diff serialization, workspace-document privacy withholding, pending/focus and capability/options projections are intentionally lost without equivalent replacement. The surviving focused selectors are unexecuted in this source composition. Six complete compound macOS receipts whose command fields select the changed source are retired verbatim as history; their other selected tests receive no promoted evidence. Other dated receipts keep their original scope; no fresh runtime/UI/mobile/mixed-version or cross-platform validation is claimed. Audit3335 retires the complete three-case browser-tabs snapshot assembly suite: canonical snapshot replay/placement/focus, local host-page adoption and unstamped host echo leaving a local page untouched alarms are intentionally lost without equivalent replacement. The surviving focused selector is unexecuted in this source composition. Unrelated dated receipts keep their original scope; no fresh runtime/network, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Audit 3301 removes the caller-chat-target precedence over host selection example from web-session-tabs-sync-focus-intent.test.ts. The snapshot-before-RPC replay and split-sibling-first exact-leaf focus cases remain unchanged and match the existing assertion reference. Preserve current selectors, assertion references, unrelated active receipts and complete archived history. These mocked state-composition survivors provide no equivalent replacement, rendered, native, network or fresh execution proof. Audit3108: doc-preview-grants.test.ts now retains only the stale grant-rejection race: a late rejected grant request must not evict a newer grant registry entry, witnessed by later revocation of grant-2. Retire stable minted-location and outside-workspace POSIX/Windows request-projection alarms without replacement. The direct nonempty grant selector remains unchanged; no real grant-server/file authorization, SSH/HTML delivery or native-focus result is claimed. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2043: Remove the registration-wait, webview-security, preview-authorization, guest-lifecycle and grant-IPC unit suites and the sibling-directory assertion reference. Runtime and browser capability consumers also lose removed imported examples. Remaining document-policy, file-reader and grant-registry assertions do not replace those alarms. Preserve the 27 independent dated receipts at their original unchanged selectors; reduced prospective unit selectors have no fresh result or equivalent replacement claim. Historical prior account (preserved verbatim): Audit1973: Delete the browser RPC forwarding/schema/scalar suite and its prospective selector. Preserve all27 unrelated dated receipts; no actual browser operation alarm is replaced. 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): Audit1925 (sources1922/1923): The complete terminal-file-link-actions suite is removed. Lose supplied local/remote menu-row inventories, browser label/order/download/reveal callback forwarding, platform-copy and source-group pinning examples. No OS reveal/download, real remote preview or browser navigation was exercised; the other real document-preview sources are not equivalent replacements. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1899 replays sealed Audit1895: workspace-doc-history.test.ts is entirely removed from its current command and testFiles. Supplied recency/dedupe/cap/title/identity examples and the10000-row getter-read budget alarm are intentionally lost. No current assertionRef or active receipt selects that file. Unrelated active receipts and all prior gap literals remain verbatim; no replacement history/index-work coverage or new browser/paired-preview gate execution is claimed. Historical coverage account before Audit1899: Audit1853 reduces LinkActionPopover.test.tsx and archives its complete 2026-09-06 mixed-selector receipt. The lost copy/open-state and Settings callback-order/omission alarms are accepted without equivalent replacement coverage. No fresh execution of this gate is credited. Audit1709 removes low-value test definitions and retires affected assertion or execution-receipt claims without equivalent replacement coverage. Per-source reviews bound retained behavior and injected/native/remote limits. Unchanged assertions and receipts keep their original scope; gates lacking current active evidence are downgraded. Historical scope before this audit: Audit1687 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: Audit1630 removes low-value Git, GitHub/GitLab and IPC 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: Audit1571 removes mock forwarding, capability/schema inventories, private predicates, supplied error/result replays, and filesystem-mocked persistence checks without equivalent replacement claims. Retained changed tests also exercise real local permission-file reread, registry proxy rollback/credential retirement, site display recovery, and pending sender/credential/document admission with injected Electron/UI producers. Retained network tests exercise owned stream credit/cleanup, generation and retirement fences, real loopback proxy/SOCKS bytes and file-backed binding state. SSH/WSL/paired runtime, native sessions, authority producers and storage clears remain injected; simulated relaunch uses filesystem mocks. The unchanged profile-retirement suite was statically reviewed and not rerun. No actual SSH/WSL runtime, native Chromium jar deletion, durable process restart, remote DNS or external site proof. Receipts selecting changed tests are retired and unaffected receipts remain unchanged. Historical scope before this audit: Audit1568 removes API inventories, supplied mock-value/forwarding assertions, implementation-shape tables and negative/setup cases that do not reach their intended boundary, without equivalent replacement claims. Retained changed definitions exercise owned manager lifetime/queue/refcount/clamp and real synthetic process/files/staging boundaries. Seventeen unchanged native Electron definitions across this combined audit are statically reviewed and not rerun. Changed native suites exercise local popup wire/cookie/session and clean/native process-identity behavior; known popup-admission flaws remain unfixed. Unit native/event/session/registry inputs remain injected. No actual OS focus, registry/host execution, CRX verification or durable restart proof. Receipts selecting changed tests are retired and unaffected receipts remain unchanged. Historical scope before this audit: Audit1564 retires copied cookie key recipes, mock bridge/preview forwarding and flag tables, source-spelling/script inventories and setup-only alarms without equivalent replacement coverage. Retained changed cases exercise actual scoped SQLite merge/rollback/schema refusal, owned cancellation and grant authority/canonical containment, ranged response consistency, replacement guest ownership and executed guest-script promise/DOM cleanup behavior. Session, host response, geometry/observer and transport producers remain injected where documented. One unchanged native extension definition is not rerun locally; no actual remote filesystem, native layout/focus or authentication claim. Receipts selecting modified tests are retired; unaffected exact-selector receipts remain unchanged. Historical scope before this audit: 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): Audit1386 changes referenced sources; no new execution result validates reduced selectors. Retained unchanged receipts apply only to unchanged commands. Historical coverage: Audit1308 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): A macOS desktop host and a separate paired Electron client exercise the Explorer preview action end to end: the document renders inside the client-local orca-preview guest, the client gains exactly one browser workspace and it is the document one, the host's own page registry and tab snapshot gain nothing, the split does not take focus from the source editor, an explicit click activates the preview, and closing it with its X leaves the editor and terminal intact. Both host oracles are read in a run where an ordinary URL browser tab from the same client does arrive in them, because a host that cannot project browser pages at all would otherwise answer the absence question the same way. A second journey quits that client with a document tab open and relaunches it on the same profile, which is the restore the user's original report turned on: the same workspace row comes back blank and named by the document, renders again, and does so over a grant URL that differs from the one that was quit. The same journey pins the guest URL to the orca-preview scheme, so a regression back to file:// or to a host browser page is visible. The rewritten journey caught a live gap the old one could not see: since previews became browser pages they had no chrome to hand focus to their guest, so main refused every reported link click as coming from an unfocused guest and the one route out of a preview was dead. Main's own log answered it — registered true, grant live, focused false — after the embedder reported the anchor really taking six real presses. The pane now hands focus over when it is the reader's surface, and the journey routes. The preview's own components moved out of the editor folder into browser-pane/workspace-doc/ with this change, since a preview is a browser pane and no longer an editor one; their i18n keys keep the historical auto.components.editor.HtmlDocPreview prefix rather than dropping thirty translated strings across four locales for a tidier key path. Seven gate commands named those files by their old paths and were re-issued at the new ones, and the nine dated runs behind them were retired rather than left naming files that are no longer there, on the same principle this gate already applied twice: vitest treats a missing named file as a filter and exits 0, so such a command reports green while silently running only the half that still exists. Each retired record's finding is carried into the replacement run recorded below it, including the red half of the entry/subresource pair, which was re-measured by re-applying its mutant at the new path rather than being dropped. The fence over the page-management channels was decided channel by channel before it was built, and that decision record is: of the 23 channels that can name a page, 6 are allowed for a workspace-document page — the tool channels the reader drives, which reach it through the one authority that reads both halves of the registry — 9 refuse (download accept and cancel, devtools, certificate proceed, client page metadata publish, viewport override, WebAuthn account response, registration probe, registration repair), 3 cannot name a page at all because they take a profile or a worktree instead, and the rest are the registration and activation doors, refused on membership. What shipped is not the per-channel guard that classification implies: eleven call sites read the browsing map directly, so a guard per channel is exactly the caller-flag seam that has to be remembered at every future call site. The registry was split in two instead, which makes the classification structural — a document guest is absent from the browsing map, so every refusing channel refuses by absence rather than by a guard, and a channel added later inherits the refusal without being classified at all. Unit contracts cover grant scoping and path containment, per-owner read routing, refusal of a truncated or over-cap read, the old-server binary degradation, scheme admission on will-attach-webview, the guest navigation policy, the plan layer's local/SSH/paired/out-of-worktree routing, and the distinct sentence the reader sees for each failure reason. The paired browser-creation surfaces this gate still owns — capability rejection cleanup, canonical page identity, reconciliation rollback, close convergence — keep their existing headed and headless journeys. Linux and Windows live journeys remain gaps. A refused subresource is a notice on a rendered document rather than a failure panel, since only the entry document's failure leaves the reader with nothing; the entry document is served as text by every owner and cannot be refused for its format at all. Grants die with the renderer document that minted them, at window creation and on every reload, because the renderer holds the only record of which preview owns which grant. The mint and revoke channels answer only the trusted renderer, and a preview tab is never republished to mobile clients, which have no grant to read it with. External URLs leave the preview only via a trusted user click on an anchor while the preview is focused; script-driven navigation and popups reach nothing. The guest's navigation sinks are deny-only and route no URL at all, and the guest carries a preview-only preload, pinned by will-attach-webview and denied to every other attach path, whose capture-phase click handler reports an anchor's URL to main; main answers only a report from a preview guest with a live bound grant that is the focused contents, and only for http(s). Two earlier reader-facing records from 2026-08-26, which measured a shape where a subresource failure was filtered out and the panel still carried an unsupported-asset sentence, were retired with that shape rather than left contradicting the 10/10 runs of the command they share. Two more were retired on the same principle when the external-link design changed: a record showing that removing a recent-input gate let the unattended document open two browser tabs, and a record showing that dropping the webview's allowpopups attribute left a target=_blank press with nothing to route. Both measured machinery that no longer exists — the input gate could not tell a script's navigation from the click it followed, which is the case now recorded below, and the preload intercepts the press before Chromium considers a popup at all, so allowpopups was removed. WebRTC is fenced by the guest's IP-handling policy alone: this Chromium answers a webrtc content-security-policy directive as unrecognized and gathers candidates anyway, so the directive is deliberately absent from the served policy and a unit assertion keeps it out. A standalone Electron probe on the same version gathered 7 candidates including a STUN reflexive one without the policy and 0 with it. Two command paths this gate used to carry no longer exist, and their structured evidence was retired with them rather than left naming files that are no longer there: vitest treats a missing named file as a filter and exits 0, so such a command reports green while silently running only the half that still exists. The first is src/renderer/src/lib/file-preview-capability-cleanup.test.ts, deleted in STA-5557 when HTML previews stopped creating paired browser tabs: on 2026-08-12 its five-assertion STA-4063 oracle ran red 5/5 on scan e4c278eb52 and on main bc2e30000b, partially green 2/5 on pre-fix PR #14100, and green 5/5 on candidate 14b5877a75; the surviving half of that oracle is web-runtime-browser-capability-cleanup.test.ts, still commanded above. The second is tests/e2e/paired-remote-html-browser-focus.spec.ts, renamed in STA-5557 to paired-remote-html-preview-local-render.spec.ts because the journey no longer proves anything about browser focus: its 2026-08-12 runs established the owning-runtime routing and no-focus-steal behavior of the then-current browser-tab preview (red on main 346e59c879 and a90a18d43d, green on candidates d05217c40d and b7de9c0961, red again with only the side-preview focus or routing seam disabled), and its 2026-08-26 runs are recorded below under the current path. An adversarial pass after the journey landed found four coverage gaps rather than shipping defects, and all four are pinned here. The page url had a third door: the navigation commit wrote whatever url was reported, unfenced, and while nothing reaches it for a document page today it sat one report away from giving a document page a URL that persistence, the publish boundary and the address bar all read. The group projection was the load-bearing half of the mobile publish boundary that no test had: removing it alone left the whole suite green, because no test in it had tab groups, while the phone payload gained a group whose order and active tab named a document tab it was never sent. The focus handoff was covered only in the narrowing direction, so widening it — dropping the page-activity check, or either half of the reader-surface check — survived both suites. And the handoff itself was offered once and never again, so another app taking the front left the preview's one route out shut until the pane remounted, which is a desktop gap rather than a test-only one. The standalone capability-cleanup and browser-placement ledger suites were removed, including their mixed-version rejection, cleanup transfer, capacity and partition alarms. web-runtime-session.test.ts no longer supplies browser creation, rollback or recovery assertions. The grouped workspace-document exclusion remains; the separate no-group publication example was removed. Existing live/browser-store evidence does not establish equivalent replacement alarms. Earlier descriptions of the removed fixtures and their run results are historical. The client-owned-placement and layout-groups suites are removed. The broad mirror fixture no longer supplies preview placement/reservation/move assertions. Browser rows retain pre-response replay and real local-workspace reuse; focus intent retains response ordering and exact-leaf sibling ordering. Supplied browser-layout and placement/focus projection alarms are lost; retained evidence is narrower and not equivalent. The test-value audit retires renderer grant-release mock ledgers, direct creation/title/session-field copies, notification/onboarding calls and several placement/per-page projections. Canonical-ID rejection, document reopen/restore and preview URL fences remain; they do not prove close-to-registry revocation or replace every lost alarm. Historical execution evidence is unchanged. The test-value audit removed the direct legacy editor-preview hydration example from tabs-hydration.test.ts. Dropping legacy preview chrome while preserving the same-document ordinary editor no longer has that alarm. The surviving corrupt-id deduplication case does not cover that migration, and retained preview journeys are not equivalent replacement coverage. Historical run counts and migration mutation findings describe the earlier suite. Audit1308: src/renderer/src/components/editor/EditorPanelShell.header.test.tsx removed. Header visibility and mocked editor-surface inventory alarms disappear. No equivalent replacement coverage is claimed. 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. Audit1386: src/renderer/src/lib/doc-preview-grants.test.ts reduced. Repeated-mount mint count, ordinary release/remint and failed-mint cache retry standalone alarms removed; no actual grant server/access test. No equivalent replacement coverage is claimed. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. 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/browser/guest-lifecycle/manager/browser-manager-guest-policy-profile.test.ts removed. Loses workspace-document in-grant navigation/popup refusal, cleanup/re-attach, cross-registry guest authorization and browsing-map separation alarms. No equivalent browser policy coverage is claimed. No equivalent replacement coverage is claimed. Audit1421 removes browser-address-bar-suggestions.test.ts. Document suggestion title/path matching, recency merging and path-prefix ranking alarms are lost. No equivalent replacement coverage is claimed. Historical receipts remain scoped to unchanged selectors; the reduced command has no new execution result. Audit2452 removes the whole fake-effect browser-close routing suite. Active selectors and assertion references no longer select it. Its requested-worktree default close, sibling-page close and explicit missing-page typed reply alarms are intentionally retired without equivalent replacement. Prior dated receipts remain unchanged and scoped to their original sources; no fresh execution of the reduced gate, rendered browser, live remote, mobile or cross-platform validation is claimed.", "motivatingLinks": [ "https://linear.app/stably/issue/STA-5557/remote-html-preview-render-workspace-files-locally-over-the-file", "https://linear.app/stably/issue/STA-3872/unable-to-open-html-files-in-remote-server", @@ -4136,7 +4128,7 @@ "https://github.com/stablyai/orca/pull/13876" ], "invariant": "Opening one HTML preview from a paired client renders the workspace document in exactly one client-local browser tab, located by that document and served over the orca-preview scheme. The client gains exactly that one browser workspace and it is the document one — blank where a URL page carries a URL, named by the document, with the chip naming the file — while the host gains no browser page at all, neither in its own page registry nor in the tab snapshot its clients publish into. The preview occupies its own split without taking focus from the source editor; an explicit click activates it, and closing it removes only the preview. Following a document from a file link is the other half of that switch and does move the reader to it, tab group included, whether the preview is new or already open, because opening a file is a request to look at it. A document tab quit with the client comes back as the same row on a grant the relaunched client mints afresh. A preview is named by the browser page it is open in, not by a namespace of its own, and the page registry has two halves: a workspace-document guest is registered in its own map and is absent from the browsing one entirely. That absence is the fence. Page, session and profile management, agent tab enumeration and command targeting, download routing and certificate attribution all read the browsing map directly, in more places than a per-channel guard could be remembered in, so none of them can name a document page and none of them carries a guard. Browser tools the reader drives (element grab, hover describe, selection capture, the annotation viewport bridge) are the one operation that legitimately spans the halves, and they go through the single authority that reads both, keyed by the page and its hosting renderer. The halves are disjoint in both directions: browsing registration refuses a page the document half already holds, and minting a grant refuses a page the browsing half already holds, so one id can never name a surface in both. The headless backend acts on that refusal by destroying the window it had already opened rather than leaving a policy-less page behind an id nothing can drive, keeping nothing under that id for its own shutdown to hand back. Registration refuses on the same terms when the guest it was asked about is already gone. The exit door is guarded in both its halves: a preview withdraws by revoking its grant and never through the unregister channel, so a page the document half holds arriving there is refused before either the registration teardown or the grab-state disposal beside it, which would otherwise drop the intent an in-flight preview grab compares by identity and leave that grab answering ok without ever arming its guest. A bridge request whose guest does not resolve is refused without tearing down the page it named, so a misaddressed request cannot cancel a healthy page's in-flight downloads and grabs. The annotation viewport bridge resolves its guest when its serialized op actually runs rather than when the request arrived, so a cross-process navigation while it waited cannot leave the bridge installed in a retired guest while the reader looks at a new one. State main keys by a preview's page is disposed when that page's grant is revoked, which is the only signal a preview's surface is gone. A tool asking for a page whose guest has not attached yet waits for that registration and arms when it arrives, rather than answering not-ready at the reader; that wait resolves only the request already naming this page, never the worktree-wide or any-tab waits the CLI and agents use to ask for a browser tab to drive. Handing the previewed document to the reader's own machine routes on the owners its grant was minted against — the file's own connection owner and the worktree's own runtime owner, neither read from the tab's stored fields. Only a document proven to live on this machine reaches the client OS; one with a resolved remote owner is downloaded first; and one whose owner cannot be resolved at all, workspace root included, is refused with a message naming that, because the download route would otherwise read the same absolute path on the client and hand back a same-named local file under the remote document's name. A runtime-owned path that falls outside its worktree root is refused by that route itself and surfaces as a failure toast rather than a download. Nothing the document does writes a file to this machine either: the preview partition denies downloads outright instead of routing them through the browser download flow, which has no page to attribute a preview's bytes to and would otherwise reserve a name in this desktop's Downloads folder and write them there unprompted. That refusal is visible to the reader and invisible to the document: the preview's shell carries a fixed sentence saying downloads are off, published at most once per preview per interval so a document asking in a loop cannot fill Orca's chrome, while the page itself gets back exactly what it got before, which is nothing. The sentence names no file, because the document chooses the name it offers; and a refusal never takes the document away the way an entry document's own failure does, whatever it names. A preview is a browser tab, not an editor tab in a preview mode: it is named the way a browser tab is named — by the document it shows when that document declares a title, and by the file it shows when it does not — while the chip goes on naming the file and the host whatever the document calls itself. A title is refused on the same terms the url is: a document that declares none has Chromium report the grant URL as its title, and that title is stored, mirrored onto the tab and written to disk, so anything carrying the scheme falls back to the file instead. It is created by the preview action as a page located by its document, it carries the workspace-relative path copy the editor's path header owned, and closing it revokes the grant that made the document readable while a URL tab closing beside it revokes nothing. Chrome persisted by builds that made previews editor tabs is dropped on restore rather than coming back naming a surface no restore can produce, and the ordinary editor tab for the same document is left alone. A document tab is held back at the mobile publish boundary — no client holds its grant, and the wire has no tab kind for it — while an ordinary browser tab beside it still publishes. It is held back from the group projection that publishes tab order, recency and group activity as well as from the tab list itself, so no published group names a tab the phone is never sent. A browser page can be located by a workspace document instead of a URL, and the document is the whole of its stored identity. The grant and the orca-preview URL that document is served over are minted when the page mounts and replaced by a hard reload, so neither is ever written to the page's url, mirrored onto its tab, persisted or published: such a page's url is the blank URL from creation through restore, including when a session written elsewhere carries a grant URL in, and what the session carries is the worktree and path a restored page mints afresh against today's owners. Every door onto a page's url holds that line — creation, the title update, and the navigation commit alike — so a report about a document page cannot give it a URL it never had, and the title fallback and the loading affordance follow the url each door actually wrote. The mirror carries the document too, so a tab entry cannot go on naming a document its active page has left. Every guest in the app is policy-attached through one door: a workspace document takes a restricted profile there rather than a separate installer beside it, so the attachment bookkeeping that door owns — what registration refuses, and what teardown frees — covers a preview on the same terms as a browsing page, and a preview takes none of the browsing machinery that door installs. That authority answers from the moment the embedder hands the guest over rather than only after a later navigation: the guest binds to the grant it is already showing, so the tools reach the document the reader opened and not just one they navigated to. A read the host reports as truncated or over-cap is refused rather than served partially, and a document outside the paired worktree is refused with a message naming that boundary instead of a bare read failure. The rendered document reaches nothing off-machine on its own: every served response carries a self-only content security policy, the preview session cancels any request that is not in-document, subframes cannot navigate outside the grant, a guest no document has yet bound to a grant may not navigate at all, the guest gathers no ICE candidates, and an SSH path that canonicalizes outside the grant root is refused before it is read. The one route out is a link the reader presses: a trusted click on an anchor, reported by the preview's own preload from a guest still bound to a live grant, leaves through the configured browser destination and captured source route — and only after the reader confirms the exact destination URL, so a document cannot spend a single stray press exfiltrating what it can read into a link it authored. The preview hands its guest that focus itself whenever it is the surface the reader is in — a browsing page gets it from the chrome around it, and a preview has no chrome to get it from — and it does so only then, so a preview mounted behind a terminal or an editor never takes the keyboard from what the reader is actually in. It offers again when the window itself takes focus back and nothing in the embedder has claimed that focus, because another app coming to the front lands focus on the embedder rather than the guest and the route out would otherwise stay shut until something remounted the pane — while the same window focus also arrives when the reader presses a tab, that being the guest's own blur returning, and taking focus back from there would fight the reader for their own click. Nothing else does. A navigation or popup the document starts by itself is swallowed whatever else is happening, including immediately after a genuine press elsewhere in the document, so a page that can read its grant cannot hand it to a browser tab; a middle click opens nothing; and a fragment link is answered inside the document. A preview attach carries the preview preload and no renderer-supplied one, and no other attach path can acquire it. A subresource the workspace will not send degrades the document to a notice naming that file, never to a failure panel over a page that rendered. A grant outlives neither the tab that owns it nor the renderer document that minted it, and only the trusted renderer can mint or revoke one. For the browser creations this gate still owns, owner-pinned creation returns the canonical host page identity before navigation readiness; delayed navigation cannot turn a created page into an unidentifiable failure or a duplicate retry. Capability rejection before host mutation must preserve the original error, issue no RPC, surface a failure toast, and remove only a caller-declared newly-created empty split. Post-create reconciliation failure requires exact rollback; ambiguous rollback rejects without local fallback.", - "oracle": "Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit3832 deliberately retires76 authored/79 finite cases:75 runtime compatibility cases/78 finite cases across14 fragments, plus one localization extractor default-flag case. Three whole runtime fragments are deleted;27 authored/30 finite cases remain across the reviewed sources. This gate retains only its own selected scope; no equivalent replacement or fresh runtime/native/remote evidence is claimed. Runtime component A: Audit3828 composes3822 with independent3824: deliberately retires49 authored/52 finite cases from seven compatibility fragments, leaving15 authored/18 finite cases and deleting two entire fragments. Accepted losses: positive folder-worker recovery/materialization and reveal deadline; persisted-key normalization and legacy split/group/focus projection; fixed stale CAS refusal; occupied/alias/restored/preallocated terminal-handle variants; fixed OpenCode/Cursor/Claude/Codex/Antigravity classification, readiness, title and management examples; direct private-map browser authority projections; browser-focus and OMP title projection; already-aborted claim cleanup. Additional3824 loss: src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts :: does not poll a wrapper foreground for a speculative CLI prompt send :: Speculative retryForegroundWrappers:false check must return false on a wrapper after one foreground read, without polling the supplied later codex response. These real bounded alarms are deliberately retired for low marginal value. Retained callbacks are unchanged and provide only their own bounded scope, not equivalent replacement. Historical receipts do not validate reduced callbacks. No fresh runtime/native/SSH/WSL/phone/browser evidence or full transitive closure is claimed. Runtime component B: Audit3834 deliberately retires26 authored/26 finite cases from seven fresh compatibility fragments, leaving10/10 and deleting the one-case saved-binding reattachment fragment. Original position58 is excluded: its existing substantive3578 KEEP7 review remains historical, with no fresh credit. Accepted losses: fixed hook/provider-session identities and stale metadata refusal; decorative/pre-title foreground ordering variants; saved-binding surface reattachment; saved-row exit ghost removal and silent activation selection; unsupported headless wake; positive pending materialization/group projections; per-caller navigation selection; positive SSH hydration/read partition; laptop mobile publication/buffer and background/pending/status projections; abnormal/unregistered SSH grace, normal-exit refusal, persisted SSH hydration, positive serve reattachment, pending-agent launch arguments and direct seeded running-launch admission guard. These are real bounded alarms deliberately retired for low marginal value. Retained cases preserve their own distinct deferred foreground coalescing, usable handle continuity, stale inventory refresh, concurrent browser snapshot preservation, renderer graph fencing, caller dedup isolation, SSH partition writes, runtime split lifetime, independent relay-ready publication, lease admission/state/expiry. The direct running-launch no-spawn guard alarm is deliberately retired; no remaining owning-launch refusal coverage is claimed. Historical runs do not validate reduced callbacks. No equivalent replacement, runtime/native/SSH/WSL/phone/browser result or full transitive closure is claimed. Additional extractor loss: config/scripts/localization/source-extraction/audit-localization-native-dialogs.test.mjs :: does not change the existing renderer scan by default :: Default options must omit the five native-only fields in this supplied snippet. No equivalent replacement is claimed. Historical prior account (preserved verbatim): Audit3814 deliberately retires60 authored/60 finite cases:53runtime compatibility cases,4native XCTest methods and3Python clipboard methods, including the entire StableElementIndexes suite. Clipboard cuts retire the one-over-cap sample, incoming-offer destruction trace and sequential20-copy replay; actual wire, FD/pipe, startup and Xvfb/GTK boundaries remain without equivalent replacement claims. Accepted losses include narrow terminal-send payload/provider projections, legacy and direct no-op/error permutations, timing/work-count examples, private state/title/activity projections and fixture-driven readiness examples, individually enumerated below. These include real bounded production alarms consciously retired for marginal value; retained failed writes, duplicate submission, stale capture, transcript/ring and allocation fences are not equivalent replacements. No fresh native/remote/browser execution or complete transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3806 deliberately retires40 authored/40 finite runtime compatibility cases, including the terminal-side-effect-facts-part03 headless-snapshots-part02 and agent-status-and-waits-part03 fragments, plus20 scalar Swift precondition sites. Lost runtime alarms include status/title/attention projection examples, simple renderer/headless frame restoration and status waiting outcomes detailed in the accepted-loss ledger. Swift cuts retire duplicate generation-map/schema/navigation/bridge and notification-wrapper assertions; no standalone native program is deleted. These include real bounded production alarms consciously retired for marginal value. Retained races, pending writes/reflow, namespace and waiter ownership are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3798 deliberately retires21 authored/24 finite compatibility cases, including the entire SSH-worktree-lifecycle and repository-project-operations fragments. Accepted losses include navigation-only settings acknowledgement, browser session cleanup and host preservation projections, window positive/policy-state examples, terminal recovery/reload and no-incarnation remint examples, terminal listing compatibility/malformed IDs, directory browse/sort/Windows path smoke, SSH create refusal/manual lineage, recursive parent-folder creation and fork/origin/avatar/icon projections. Real bounded production alarms are consciously retired for marginal value; retained authority races, cleanup/clone ownership, pending waiters, nested-folder and scan invalidation cases are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3460 final-v2 composes accepted AUTHOR3454/PEER3455 on actual post263 main: intentionally removes99 authored/106 potential expanded cases across16 selected drivers, including7 whole suites, retaining24 authored/26 potential cases. No equivalent replacement or fresh runtime is claimed. The complete mocked session-close routing suite is removed, including the explicit cross-worktree cleanup alarm. Remove its active file, command token and assertion reference; historical selectors and receipts retain their original scope. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3342 retires the complete mobile editor/diff tab-publication projection suite: editor/diff serialization, workspace-document privacy withholding, pending/focus and capability/options projections are intentionally lost without equivalent replacement. The surviving focused selectors are unexecuted in this source composition. Six complete compound macOS receipts whose command fields select the changed source are retired verbatim as history; their other selected tests receive no promoted evidence. Other dated receipts keep their original scope; no fresh runtime/UI/mobile/mixed-version or cross-platform validation is claimed. Audit3335 retires the complete three-case browser-tabs snapshot assembly suite: canonical snapshot replay/placement/focus, local host-page adoption and unstamped host echo leaving a local page untouched alarms are intentionally lost without equivalent replacement. The surviving focused selector is unexecuted in this source composition. Unrelated dated receipts keep their original scope; no fresh runtime/network, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Audit 3301 removes the caller-chat-target precedence over host selection example from web-session-tabs-sync-focus-intent.test.ts. The snapshot-before-RPC replay and split-sibling-first exact-leaf focus cases remain unchanged and match the existing assertion reference. Preserve current selectors, assertion references, unrelated active receipts and complete archived history. These mocked state-composition survivors provide no equivalent replacement, rendered, native, network or fresh execution proof. Audit3108: doc-preview-grants.test.ts now retains only the stale grant-rejection race: a late rejected grant request must not evict a newer grant registry entry, witnessed by later revocation of grant-2. Retire stable minted-location and outside-workspace POSIX/Windows request-projection alarms without replacement. The direct nonempty grant selector remains unchanged; no real grant-server/file authorization, SSH/HTML delivery or native-focus result is claimed. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2043: Remove the registration-wait, webview-security, preview-authorization, guest-lifecycle and grant-IPC unit suites and the sibling-directory assertion reference. Runtime and browser capability consumers also lose removed imported examples. Remaining document-policy, file-reader and grant-registry assertions do not replace those alarms. Preserve the 27 independent dated receipts at their original unchanged selectors; reduced prospective unit selectors have no fresh result or equivalent replacement claim. Historical prior account (preserved verbatim): Audit1973: Delete the browser RPC forwarding/schema/scalar suite and its prospective selector. Preserve all27 unrelated dated receipts; no actual browser operation alarm is replaced. 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): Audit1925 (sources1922/1923): The complete terminal-file-link-actions suite is removed. Lose supplied local/remote menu-row inventories, browser label/order/download/reveal callback forwarding, platform-copy and source-group pinning examples. No OS reveal/download, real remote preview or browser navigation was exercised; the other real document-preview sources are not equivalent replacements. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1709 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: Audit1687 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: Audit1421 narrows renderer unit coverage as recorded in coverageNotes. Prior oracle descriptions are historical for the changed suite. 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): Retained unchanged-selector receipts are the only current execution evidence. Reduced-source assertions await validation. Historical prior oracle: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): In paired Electron, write an HTML fixture that declares its own title on the host, invoke the Explorer preview action on the client, and require the document text to be readable out of the orca-preview guest before judging any absence. With that presence established, require the client to hold exactly one browser workspace more than its baseline and that workspace to be the document one: page and tab url blank, the document path mirrored onto both, the tab named by the document's title, the chip naming the file, no editor row of the retired preview species anywhere, and the guest URL carrying the orca-preview scheme. Ask the host through its own page registry as well as through the tab snapshot, and in the same run open an ordinary URL browser tab from the same client and require that one to arrive in both — the presence precondition without which “the host gained nothing” is satisfied just as well by an oracle that cannot see browser pages at all. Require the preview to sit in a group other than the source editor's while the active group and tab remain the source editor's. Then click away to the terminal, click the preview tab, require it to reactivate and still render, close it with its own X, and require the document tab to be gone while the host still holds only the URL tab and the source group, source editor and terminal survive. Quit the client with a document tab open and relaunch it on the same profile: require the same workspace row to come back, blank and named by the document, rendering the document again over a grant URL that differs from the one that was quit, with no preview-scheme or document-named page anywhere in what the host holds. Prove the halves are live by flipping one product property at a time and requiring the run to fail: publish document workspaces to the host like ordinary ones, and stop mirroring the document onto the workspace row. Have the fixture document attempt its own egress on every load — an unattended window.open and location.href to an off-machine URL, plus an inline ICE gathering probe — and require the same baseline counts and a candidate count of zero, so the document's own attempts are measured rather than assumed. Then, as a separate phase after the close oracle has already run, bring the client window to the front, press the document's heading with a real mouse event, and require the document to report that the same press drove it to attempt a second window.open and location.href while both browser counts stay at that phase's baseline and nothing routes — the case a recent-input gate cannot distinguish from the press's own effect. Only then press the target=_blank link with a real mouse event and require both a recorded routing call that returned success and a browser count above that baseline, with the preview tab still open. Drive the preload's click policy as a unit oracle over a real document: a dispatched click, a trusted press on an external anchor, an anchor reached through what it wraps, an SVG animated href, a sibling preview link, fragment and percent-encoded fragment targets, a bare hash, and a middle click. Create a browser page located by a workspace document, handing creation a live grant URL, and require its stored url, its mirrored tab url and the written session payload all to be blank with no orca-preview string anywhere in what was written, while an ordinary page created the same way keeps the URL it was given and asks for the address bar the document page never does. Parse the written page and tab through the session schema and require the document to survive both halves. Hydrate them back and require the document page to return blank and still named — including when its page row was salvaged away and only the tab's own copy remains, and when a foreign session carried a grant URL into both rows. Drive the mirror across a page switch out of the document and back, and across a repair in which the document is the only mirrored field that differs. Name a document page from its document and require the tab to take that name, name it with an empty title and require the file, name it with a live grant URL and require the file again with no preview scheme anywhere in the written session, and require an ordinary blank browser tab beside it to still be called New Tab. Dispatch a title update out of a rendered preview's own guest and require it to reach the page state while the identity chip still reads the document's workspace-relative path. Attach a browsing guest and a workspace-document guest through the same method in one run and require the browsing one to take clicked-link routing, popup handling and auth-identity detach tracking while the document guest takes none of them, stays inside the grant it is showing, denies every window it asks for, and is dropped from the page-keyed document registry by the same teardown that frees its id for a later attach. Register a browsing guest and attach a workspace-document guest in one run against the real manager, require the one door to answer each page with the guest of its own half, and require the document page to be absent from the browsing map and from its enumeration. Drive both browsing registration entry points with a page the document half already holds and require them to register nothing, and drive the mint channel with a page the browsing half already holds and require it to refuse; and drive the offscreen one with a guest that is missing and with one already destroyed, requiring the same refusal. Arm a grab on a live preview target, drive the unregister channel at that same target in the window before the queued operation runs, and require the grab to reach the guest anyway — then drive the same sequence for an ordinary browser page and require its grab state to be disposed after all. Hold one viewport-bridge op open, queue a second behind it, swap the page's guest while that second op waits, and require the injection to land in the guest the page has then. Revoke a grant after a tool has run against its page and require that page's grab state to be cancelled and disposed. Ask a tool for a document page whose guest has not attached, require the request to park in the registration wait, attach the guest, and require the same request to arm on it; require a page nothing ever renders to answer not-ready once that wait elapses. With a document open, ask a tool for a browsing page id and require it to be answered by the browsing half or not at all, with the same channel reaching the document guest under the page it really renders. Drive open-externally for a document whose per-file owner is remote while the workspace-scoped owner is unresolved, for a runtime-owned worktree whose preview tab carries no runtime id of its own, and for a worktree that resolves no runtime owner while the tab still carries one, requiring the download route in each; and for an owner that cannot be resolved at all, and for an unknown workspace root while nothing names another host, requiring a refusal that neither opens nor downloads. Drive the headless backend with a page the document half already holds and require it to reject, destroy the window, and unregister nothing — then shut the backend down and require it still to have unregistered nothing. Navigate a bound preview guest at a second grant through both latch events and require it to stay on the grant it bound to. Mount a preview while a renderer drag is already in flight and require its guest to be click-through at the moment it is appended, not a turn later. Render the editor panel shell in each remaining tab mode and require the path header exactly where the surface does not already name itself. Drive the preview action and require a browser tab located by the document rather than an editor tab, require a second open of the same document to activate the tab it is already in, and require closing that tab to revoke its grant while a URL tab closed beside it revokes none. Publish a worktree holding a document tab and a URL tab and require only the URL tab to reach the mobile snapshot. Install the shared partition policies for a preview partition and for an ordinary browsing partition in the same run, fire each one's own will-download listener, and require the preview's to cancel while the browsing one still reaches the download router — then require the preview protocol installer to be what asks for that deny. In the same run, require the cancelled download to raise a reader-facing notice and the routed one to raise none. require the guest registry to name the bound grant for a live preview guest and nothing for a contents that is not one, has committed no document, or is gone. Drive the shell with a refusal and require one fixed sentence, still one row after three more refusals, standing beside an asset failure rather than being counted with it, gone behind the failure panel, and ignored when it names another preview's grant. Drive the main-side report gate directly for a sender that is no preview guest, a guest with no bound or a revoked grant, a genuine press Electron's webview focus flag misreports as unfocused, and non-web URLs; drive the reader-facing confirmation for accept, cancel, and a confirmed tab the browser refuses; and drive will-attach-webview in both preload directions. Run the per-owner reader, grant-containment, scheme-admission, guest-policy, and plan-routing contracts as unit oracles, including a host-reported truncation, an over-cap binary, and an out-of-worktree paired path. Drive the reader-facing component with the payloads the reader can actually produce — the entry document fails only as truncated or unreadable, a subresource additionally as a refused format — and require the asset case to leave the guest mounted. Drive the closed-tab cleanup hook, the window installer, and the grant IPC handlers directly, requiring the grant to be released when the preview tab closes, cleared at window creation and on a cross-document main-frame navigation, and refused to any sender that is not the trusted renderer. For the browser creations this gate still owns, run the unchanged contract oracle for direct create and side-preview callers with absent status, unknown capabilities, and a mixed-version host, requiring the original unsupported error or visible toast, zero RPCs, and no retained new split; hold a real navigation response beyond the 15-second client deadline after host creation and require the first RPC to return the exact host inventory page ID, one host page, and no retry; repeat reconciliation faults against headless serve and retain the separate exact-page reconciliation rollback oracle. Audit2452 removes the whole fake-effect browser-close routing suite. Active selectors and assertion references no longer select it. Its requested-worktree default close, sibling-page close and explicit missing-page typed reply alarms are intentionally retired without equivalent replacement. Prior dated receipts remain unchanged and scoped to their original sources; no fresh execution of the reduced gate, rendered browser, live remote, mobile or cross-platform validation is claimed.", + "oracle": "Audit5910 retires the complete use-doc-preview-guest-tools suite: token-scoped pending-card position after inner scroll, load reset and detached guest listener cleanup alarms are intentionally lost without equivalent replacement. Narrow three compound selectors and remove its testFiles entry. All remaining assertions/selectors and complete dated evidenceRuns retain only their original scope; no fresh validation or replacement claim. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit3832 deliberately retires76 authored/79 finite cases:75 runtime compatibility cases/78 finite cases across14 fragments, plus one localization extractor default-flag case. Three whole runtime fragments are deleted;27 authored/30 finite cases remain across the reviewed sources. This gate retains only its own selected scope; no equivalent replacement or fresh runtime/native/remote evidence is claimed. Runtime component A: Audit3828 composes3822 with independent3824: deliberately retires49 authored/52 finite cases from seven compatibility fragments, leaving15 authored/18 finite cases and deleting two entire fragments. Accepted losses: positive folder-worker recovery/materialization and reveal deadline; persisted-key normalization and legacy split/group/focus projection; fixed stale CAS refusal; occupied/alias/restored/preallocated terminal-handle variants; fixed OpenCode/Cursor/Claude/Codex/Antigravity classification, readiness, title and management examples; direct private-map browser authority projections; browser-focus and OMP title projection; already-aborted claim cleanup. Additional3824 loss: src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts :: does not poll a wrapper foreground for a speculative CLI prompt send :: Speculative retryForegroundWrappers:false check must return false on a wrapper after one foreground read, without polling the supplied later codex response. These real bounded alarms are deliberately retired for low marginal value. Retained callbacks are unchanged and provide only their own bounded scope, not equivalent replacement. Historical receipts do not validate reduced callbacks. No fresh runtime/native/SSH/WSL/phone/browser evidence or full transitive closure is claimed. Runtime component B: Audit3834 deliberately retires26 authored/26 finite cases from seven fresh compatibility fragments, leaving10/10 and deleting the one-case saved-binding reattachment fragment. Original position58 is excluded: its existing substantive3578 KEEP7 review remains historical, with no fresh credit. Accepted losses: fixed hook/provider-session identities and stale metadata refusal; decorative/pre-title foreground ordering variants; saved-binding surface reattachment; saved-row exit ghost removal and silent activation selection; unsupported headless wake; positive pending materialization/group projections; per-caller navigation selection; positive SSH hydration/read partition; laptop mobile publication/buffer and background/pending/status projections; abnormal/unregistered SSH grace, normal-exit refusal, persisted SSH hydration, positive serve reattachment, pending-agent launch arguments and direct seeded running-launch admission guard. These are real bounded alarms deliberately retired for low marginal value. Retained cases preserve their own distinct deferred foreground coalescing, usable handle continuity, stale inventory refresh, concurrent browser snapshot preservation, renderer graph fencing, caller dedup isolation, SSH partition writes, runtime split lifetime, independent relay-ready publication, lease admission/state/expiry. The direct running-launch no-spawn guard alarm is deliberately retired; no remaining owning-launch refusal coverage is claimed. Historical runs do not validate reduced callbacks. No equivalent replacement, runtime/native/SSH/WSL/phone/browser result or full transitive closure is claimed. Additional extractor loss: config/scripts/localization/source-extraction/audit-localization-native-dialogs.test.mjs :: does not change the existing renderer scan by default :: Default options must omit the five native-only fields in this supplied snippet. No equivalent replacement is claimed. Historical prior account (preserved verbatim): Audit3814 deliberately retires60 authored/60 finite cases:53runtime compatibility cases,4native XCTest methods and3Python clipboard methods, including the entire StableElementIndexes suite. Clipboard cuts retire the one-over-cap sample, incoming-offer destruction trace and sequential20-copy replay; actual wire, FD/pipe, startup and Xvfb/GTK boundaries remain without equivalent replacement claims. Accepted losses include narrow terminal-send payload/provider projections, legacy and direct no-op/error permutations, timing/work-count examples, private state/title/activity projections and fixture-driven readiness examples, individually enumerated below. These include real bounded production alarms consciously retired for marginal value; retained failed writes, duplicate submission, stale capture, transcript/ring and allocation fences are not equivalent replacements. No fresh native/remote/browser execution or complete transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3806 deliberately retires40 authored/40 finite runtime compatibility cases, including the terminal-side-effect-facts-part03 headless-snapshots-part02 and agent-status-and-waits-part03 fragments, plus20 scalar Swift precondition sites. Lost runtime alarms include status/title/attention projection examples, simple renderer/headless frame restoration and status waiting outcomes detailed in the accepted-loss ledger. Swift cuts retire duplicate generation-map/schema/navigation/bridge and notification-wrapper assertions; no standalone native program is deleted. These include real bounded production alarms consciously retired for marginal value. Retained races, pending writes/reflow, namespace and waiter ownership are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3798 deliberately retires21 authored/24 finite compatibility cases, including the entire SSH-worktree-lifecycle and repository-project-operations fragments. Accepted losses include navigation-only settings acknowledgement, browser session cleanup and host preservation projections, window positive/policy-state examples, terminal recovery/reload and no-incarnation remint examples, terminal listing compatibility/malformed IDs, directory browse/sort/Windows path smoke, SSH create refusal/manual lineage, recursive parent-folder creation and fork/origin/avatar/icon projections. Real bounded production alarms are consciously retired for marginal value; retained authority races, cleanup/clone ownership, pending waiters, nested-folder and scan invalidation cases are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3460 final-v2 composes accepted AUTHOR3454/PEER3455 on actual post263 main: intentionally removes99 authored/106 potential expanded cases across16 selected drivers, including7 whole suites, retaining24 authored/26 potential cases. No equivalent replacement or fresh runtime is claimed. The complete mocked session-close routing suite is removed, including the explicit cross-worktree cleanup alarm. Remove its active file, command token and assertion reference; historical selectors and receipts retain their original scope. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3342 retires the complete mobile editor/diff tab-publication projection suite: editor/diff serialization, workspace-document privacy withholding, pending/focus and capability/options projections are intentionally lost without equivalent replacement. The surviving focused selectors are unexecuted in this source composition. Six complete compound macOS receipts whose command fields select the changed source are retired verbatim as history; their other selected tests receive no promoted evidence. Other dated receipts keep their original scope; no fresh runtime/UI/mobile/mixed-version or cross-platform validation is claimed. Audit3335 retires the complete three-case browser-tabs snapshot assembly suite: canonical snapshot replay/placement/focus, local host-page adoption and unstamped host echo leaving a local page untouched alarms are intentionally lost without equivalent replacement. The surviving focused selector is unexecuted in this source composition. Unrelated dated receipts keep their original scope; no fresh runtime/network, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Audit 3301 removes the caller-chat-target precedence over host selection example from web-session-tabs-sync-focus-intent.test.ts. The snapshot-before-RPC replay and split-sibling-first exact-leaf focus cases remain unchanged and match the existing assertion reference. Preserve current selectors, assertion references, unrelated active receipts and complete archived history. These mocked state-composition survivors provide no equivalent replacement, rendered, native, network or fresh execution proof. Audit3108: doc-preview-grants.test.ts now retains only the stale grant-rejection race: a late rejected grant request must not evict a newer grant registry entry, witnessed by later revocation of grant-2. Retire stable minted-location and outside-workspace POSIX/Windows request-projection alarms without replacement. The direct nonempty grant selector remains unchanged; no real grant-server/file authorization, SSH/HTML delivery or native-focus result is claimed. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2043: Remove the registration-wait, webview-security, preview-authorization, guest-lifecycle and grant-IPC unit suites and the sibling-directory assertion reference. Runtime and browser capability consumers also lose removed imported examples. Remaining document-policy, file-reader and grant-registry assertions do not replace those alarms. Preserve the 27 independent dated receipts at their original unchanged selectors; reduced prospective unit selectors have no fresh result or equivalent replacement claim. Historical prior account (preserved verbatim): Audit1973: Delete the browser RPC forwarding/schema/scalar suite and its prospective selector. Preserve all27 unrelated dated receipts; no actual browser operation alarm is replaced. 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): Audit1925 (sources1922/1923): The complete terminal-file-link-actions suite is removed. Lose supplied local/remote menu-row inventories, browser label/order/download/reveal callback forwarding, platform-copy and source-group pinning examples. No OS reveal/download, real remote preview or browser navigation was exercised; the other real document-preview sources are not equivalent replacements. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1709 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: Audit1687 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: Audit1421 narrows renderer unit coverage as recorded in coverageNotes. Prior oracle descriptions are historical for the changed suite. 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): Retained unchanged-selector receipts are the only current execution evidence. Reduced-source assertions await validation. Historical prior oracle: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): In paired Electron, write an HTML fixture that declares its own title on the host, invoke the Explorer preview action on the client, and require the document text to be readable out of the orca-preview guest before judging any absence. With that presence established, require the client to hold exactly one browser workspace more than its baseline and that workspace to be the document one: page and tab url blank, the document path mirrored onto both, the tab named by the document's title, the chip naming the file, no editor row of the retired preview species anywhere, and the guest URL carrying the orca-preview scheme. Ask the host through its own page registry as well as through the tab snapshot, and in the same run open an ordinary URL browser tab from the same client and require that one to arrive in both — the presence precondition without which “the host gained nothing” is satisfied just as well by an oracle that cannot see browser pages at all. Require the preview to sit in a group other than the source editor's while the active group and tab remain the source editor's. Then click away to the terminal, click the preview tab, require it to reactivate and still render, close it with its own X, and require the document tab to be gone while the host still holds only the URL tab and the source group, source editor and terminal survive. Quit the client with a document tab open and relaunch it on the same profile: require the same workspace row to come back, blank and named by the document, rendering the document again over a grant URL that differs from the one that was quit, with no preview-scheme or document-named page anywhere in what the host holds. Prove the halves are live by flipping one product property at a time and requiring the run to fail: publish document workspaces to the host like ordinary ones, and stop mirroring the document onto the workspace row. Have the fixture document attempt its own egress on every load — an unattended window.open and location.href to an off-machine URL, plus an inline ICE gathering probe — and require the same baseline counts and a candidate count of zero, so the document's own attempts are measured rather than assumed. Then, as a separate phase after the close oracle has already run, bring the client window to the front, press the document's heading with a real mouse event, and require the document to report that the same press drove it to attempt a second window.open and location.href while both browser counts stay at that phase's baseline and nothing routes — the case a recent-input gate cannot distinguish from the press's own effect. Only then press the target=_blank link with a real mouse event and require both a recorded routing call that returned success and a browser count above that baseline, with the preview tab still open. Drive the preload's click policy as a unit oracle over a real document: a dispatched click, a trusted press on an external anchor, an anchor reached through what it wraps, an SVG animated href, a sibling preview link, fragment and percent-encoded fragment targets, a bare hash, and a middle click. Create a browser page located by a workspace document, handing creation a live grant URL, and require its stored url, its mirrored tab url and the written session payload all to be blank with no orca-preview string anywhere in what was written, while an ordinary page created the same way keeps the URL it was given and asks for the address bar the document page never does. Parse the written page and tab through the session schema and require the document to survive both halves. Hydrate them back and require the document page to return blank and still named — including when its page row was salvaged away and only the tab's own copy remains, and when a foreign session carried a grant URL into both rows. Drive the mirror across a page switch out of the document and back, and across a repair in which the document is the only mirrored field that differs. Name a document page from its document and require the tab to take that name, name it with an empty title and require the file, name it with a live grant URL and require the file again with no preview scheme anywhere in the written session, and require an ordinary blank browser tab beside it to still be called New Tab. Dispatch a title update out of a rendered preview's own guest and require it to reach the page state while the identity chip still reads the document's workspace-relative path. Attach a browsing guest and a workspace-document guest through the same method in one run and require the browsing one to take clicked-link routing, popup handling and auth-identity detach tracking while the document guest takes none of them, stays inside the grant it is showing, denies every window it asks for, and is dropped from the page-keyed document registry by the same teardown that frees its id for a later attach. Register a browsing guest and attach a workspace-document guest in one run against the real manager, require the one door to answer each page with the guest of its own half, and require the document page to be absent from the browsing map and from its enumeration. Drive both browsing registration entry points with a page the document half already holds and require them to register nothing, and drive the mint channel with a page the browsing half already holds and require it to refuse; and drive the offscreen one with a guest that is missing and with one already destroyed, requiring the same refusal. Arm a grab on a live preview target, drive the unregister channel at that same target in the window before the queued operation runs, and require the grab to reach the guest anyway — then drive the same sequence for an ordinary browser page and require its grab state to be disposed after all. Hold one viewport-bridge op open, queue a second behind it, swap the page's guest while that second op waits, and require the injection to land in the guest the page has then. Revoke a grant after a tool has run against its page and require that page's grab state to be cancelled and disposed. Ask a tool for a document page whose guest has not attached, require the request to park in the registration wait, attach the guest, and require the same request to arm on it; require a page nothing ever renders to answer not-ready once that wait elapses. With a document open, ask a tool for a browsing page id and require it to be answered by the browsing half or not at all, with the same channel reaching the document guest under the page it really renders. Drive open-externally for a document whose per-file owner is remote while the workspace-scoped owner is unresolved, for a runtime-owned worktree whose preview tab carries no runtime id of its own, and for a worktree that resolves no runtime owner while the tab still carries one, requiring the download route in each; and for an owner that cannot be resolved at all, and for an unknown workspace root while nothing names another host, requiring a refusal that neither opens nor downloads. Drive the headless backend with a page the document half already holds and require it to reject, destroy the window, and unregister nothing — then shut the backend down and require it still to have unregistered nothing. Navigate a bound preview guest at a second grant through both latch events and require it to stay on the grant it bound to. Mount a preview while a renderer drag is already in flight and require its guest to be click-through at the moment it is appended, not a turn later. Render the editor panel shell in each remaining tab mode and require the path header exactly where the surface does not already name itself. Drive the preview action and require a browser tab located by the document rather than an editor tab, require a second open of the same document to activate the tab it is already in, and require closing that tab to revoke its grant while a URL tab closed beside it revokes none. Publish a worktree holding a document tab and a URL tab and require only the URL tab to reach the mobile snapshot. Install the shared partition policies for a preview partition and for an ordinary browsing partition in the same run, fire each one's own will-download listener, and require the preview's to cancel while the browsing one still reaches the download router — then require the preview protocol installer to be what asks for that deny. In the same run, require the cancelled download to raise a reader-facing notice and the routed one to raise none. require the guest registry to name the bound grant for a live preview guest and nothing for a contents that is not one, has committed no document, or is gone. Drive the shell with a refusal and require one fixed sentence, still one row after three more refusals, standing beside an asset failure rather than being counted with it, gone behind the failure panel, and ignored when it names another preview's grant. Drive the main-side report gate directly for a sender that is no preview guest, a guest with no bound or a revoked grant, a genuine press Electron's webview focus flag misreports as unfocused, and non-web URLs; drive the reader-facing confirmation for accept, cancel, and a confirmed tab the browser refuses; and drive will-attach-webview in both preload directions. Run the per-owner reader, grant-containment, scheme-admission, guest-policy, and plan-routing contracts as unit oracles, including a host-reported truncation, an over-cap binary, and an out-of-worktree paired path. Drive the reader-facing component with the payloads the reader can actually produce — the entry document fails only as truncated or unreadable, a subresource additionally as a refused format — and require the asset case to leave the guest mounted. Drive the closed-tab cleanup hook, the window installer, and the grant IPC handlers directly, requiring the grant to be released when the preview tab closes, cleared at window creation and on a cross-document main-frame navigation, and refused to any sender that is not the trusted renderer. For the browser creations this gate still owns, run the unchanged contract oracle for direct create and side-preview callers with absent status, unknown capabilities, and a mixed-version host, requiring the original unsupported error or visible toast, zero RPCs, and no retained new split; hold a real navigation response beyond the 15-second client deadline after host creation and require the first RPC to return the exact host inventory page ID, one host page, and no retry; repeat reconciliation faults against headless serve and retain the separate exact-page reconciliation rollback oracle. Audit2452 removes the whole fake-effect browser-close routing suite. Active selectors and assertion references no longer select it. Its requested-worktree default close, sibling-page close and explicit missing-page typed reply alarms are intentionally retired without equivalent replacement. Prior dated receipts remain unchanged and scoped to their original sources; no fresh execution of the reduced gate, rendered browser, live remote, mobile or cross-platform validation is claimed.", "commands": [ "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/browser/client-pages/orca-runtime-browser.test.ts src/renderer/src/runtime/web-session-tabs-sync/navigation/web-session-tabs-sync-focus-intent.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/document-preview/doc-preview-file-reader.test.ts src/main/browser/document-preview/doc-preview-guest-policy.test.ts src/shared/document-preview/doc-preview-scheme.test.ts src/renderer/src/components/browser-pane/workspace-doc/doc-preview-external-link-confirmation.test.ts", @@ -4147,10 +4139,10 @@ "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/store/slices/browser/pages/browser-workspace-doc-location.test.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx src/shared/document-preview/doc-preview-scheme.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/store/slices/browser/pages/browser-workspace-doc-location.test.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx", "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/document-preview/doc-preview-guest-policy.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/guest-lifecycle/manager/viewport/browser-manager-annotation-bridge.test.ts src/shared/document-preview/doc-preview-scheme.test.ts src/renderer/src/components/browser-pane/workspace-doc/use-doc-preview-guest-tools.test.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx", - "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/guest-lifecycle/manager/viewport/browser-manager-annotation-bridge.test.ts src/main/browser/backends/offscreen-browser-backend-lifecycle.test.ts src/main/browser/document-preview/doc-preview-guest-policy.test.ts src/shared/document-preview/doc-preview-scheme.test.ts src/renderer/src/components/browser-pane/workspace-doc/use-doc-preview-guest-tools.test.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx", + "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/guest-lifecycle/manager/viewport/browser-manager-annotation-bridge.test.ts src/shared/document-preview/doc-preview-scheme.test.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx", + "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/guest-lifecycle/manager/viewport/browser-manager-annotation-bridge.test.ts src/main/browser/backends/offscreen-browser-backend-lifecycle.test.ts src/main/browser/document-preview/doc-preview-guest-policy.test.ts src/shared/document-preview/doc-preview-scheme.test.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx", "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/link-actions/LinkActionPopover.test.tsx", - "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/guest-lifecycle/manager/viewport/browser-manager-annotation-bridge.test.ts src/main/browser/backends/offscreen-browser-backend-lifecycle.test.ts src/main/browser/document-preview/doc-preview-guest-policy.test.ts src/shared/document-preview/doc-preview-scheme.test.ts src/renderer/src/components/browser-pane/workspace-doc/use-doc-preview-guest-tools.test.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx", + "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/guest-lifecycle/manager/viewport/browser-manager-annotation-bridge.test.ts src/main/browser/backends/offscreen-browser-backend-lifecycle.test.ts src/main/browser/document-preview/doc-preview-guest-policy.test.ts src/shared/document-preview/doc-preview-scheme.test.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx", "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/store/slices/browser/pages/browser-page-conversion.test.ts src/renderer/src/runtime/sync-runtime-graph/sync-runtime-graph-conversion-publish.test.ts src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx", "SKIP_BUILD=1 ORCA_E2E_WEB_CLIENT=1 ORCA_E2E_FORCE_HEADFUL=1 pnpm exec playwright test tests/e2e/paired-preview-address-bar-convergence.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1 --reporter=list", "SKIP_BUILD=1 ORCA_E2E_WEB_CLIENT=1 ORCA_E2E_FORCE_HEADFUL=1 pnpm exec playwright test tests/e2e/paired-remote-html-preview-local-render.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1 --reporter=line", @@ -4171,7 +4163,6 @@ "src/renderer/src/store/slices/browser/pages/browser-workspace-doc-location.test.ts", "src/main/browser/guest-lifecycle/manager/viewport/browser-manager-annotation-bridge.test.ts", "src/main/browser/backends/offscreen-browser-backend-lifecycle.test.ts", - "src/renderer/src/components/browser-pane/workspace-doc/use-doc-preview-guest-tools.test.ts", "src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx", "src/shared/document-preview/doc-preview-scheme.test.ts", "src/renderer/src/components/browser-pane/workspace-doc/doc-preview-external-link-confirmation.test.ts", @@ -4568,7 +4559,8 @@ "Audit3832 deliberately retires76 authored/79 finite cases:75 runtime compatibility cases/78 finite cases across14 fragments, plus one localization extractor default-flag case. Three whole runtime fragments are deleted;27 authored/30 finite cases remain across the reviewed sources. This gate retains only its own selected scope; no equivalent replacement or fresh runtime/native/remote evidence is claimed. Runtime component A: Audit3828 composes3822 with independent3824: deliberately retires49 authored/52 finite cases from seven compatibility fragments, leaving15 authored/18 finite cases and deleting two entire fragments. Accepted losses: positive folder-worker recovery/materialization and reveal deadline; persisted-key normalization and legacy split/group/focus projection; fixed stale CAS refusal; occupied/alias/restored/preallocated terminal-handle variants; fixed OpenCode/Cursor/Claude/Codex/Antigravity classification, readiness, title and management examples; direct private-map browser authority projections; browser-focus and OMP title projection; already-aborted claim cleanup. Additional3824 loss: src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts :: does not poll a wrapper foreground for a speculative CLI prompt send :: Speculative retryForegroundWrappers:false check must return false on a wrapper after one foreground read, without polling the supplied later codex response. These real bounded alarms are deliberately retired for low marginal value. Retained callbacks are unchanged and provide only their own bounded scope, not equivalent replacement. Historical receipts do not validate reduced callbacks. No fresh runtime/native/SSH/WSL/phone/browser evidence or full transitive closure is claimed. Runtime component B: Audit3834 deliberately retires26 authored/26 finite cases from seven fresh compatibility fragments, leaving10/10 and deleting the one-case saved-binding reattachment fragment. Original position58 is excluded: its existing substantive3578 KEEP7 review remains historical, with no fresh credit. Accepted losses: fixed hook/provider-session identities and stale metadata refusal; decorative/pre-title foreground ordering variants; saved-binding surface reattachment; saved-row exit ghost removal and silent activation selection; unsupported headless wake; positive pending materialization/group projections; per-caller navigation selection; positive SSH hydration/read partition; laptop mobile publication/buffer and background/pending/status projections; abnormal/unregistered SSH grace, normal-exit refusal, persisted SSH hydration, positive serve reattachment, pending-agent launch arguments and direct seeded running-launch admission guard. These are real bounded alarms deliberately retired for low marginal value. Retained cases preserve their own distinct deferred foreground coalescing, usable handle continuity, stale inventory refresh, concurrent browser snapshot preservation, renderer graph fencing, caller dedup isolation, SSH partition writes, runtime split lifetime, independent relay-ready publication, lease admission/state/expiry. The direct running-launch no-spawn guard alarm is deliberately retired; no remaining owning-launch refusal coverage is claimed. Historical runs do not validate reduced callbacks. No equivalent replacement, runtime/native/SSH/WSL/phone/browser result or full transitive closure is claimed. Additional extractor loss: config/scripts/localization/source-extraction/audit-localization-native-dialogs.test.mjs :: does not change the existing renderer scan by default :: Default options must omit the five native-only fields in this supplied snippet. No equivalent replacement is claimed.", "Audit5583 exact prior command before retired suite selector removal: pnpm exec vitest run --config config/vitest.config.ts src/main/browser/document-preview/doc-preview-file-reader.test.ts src/main/browser/document-preview/doc-preview-guest-policy.test.ts src/shared/document-preview/doc-preview-scheme.test.ts src/renderer/src/lib/browser/documents/doc-preview-grants.test.ts src/renderer/src/components/browser-pane/workspace-doc/doc-preview-external-link-confirmation.test.ts", "Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. ", - "Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. " + "Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. ", + "Audit5910 retires the complete use-doc-preview-guest-tools suite: token-scoped pending-card position after inner scroll, load reset and detached guest listener cleanup alarms are intentionally lost without equivalent replacement. Narrow three compound selectors and remove its testFiles entry. All remaining assertions/selectors and complete dated evidenceRuns retain only their original scope; no fresh validation or replacement claim." ], "demotionRule": "Demote if a paired HTML preview creates a browser workspace on either side, renders from anything other than the orca-preview scheme, serves a read the host reported as truncated or over-cap, serves a document without the self-only content security policy, lets the preview session carry an off-machine request, reads an SSH path that canonicalizes outside its grant root, steals focus from the source editor when it opens, removes unrelated editor or terminal state on close, hides a document that rendered because one subresource was refused, leaves a grant readable after the tab or renderer that owns it is gone, mints one for a sender that is not the trusted renderer, opens a browser tab for a navigation the document started with no one at the keyboard, or lets the guest gather an ICE candidate; or if a paired browser creation this gate still owns produces duplicate client or host identities or loses its requested split." }, @@ -10151,7 +10143,7 @@ "providers": ["local", "daemon", "ssh", "wsl", "remote-runtime"], "coveredPlatforms": ["macos"], "coveredProviders": [], - "coverageNotes": "Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit3994 retires two authored callbacks imported by the shared construction test driver: split OSC 9999 carry and rendererless status ownership, plus OpenCode permission text taking priority in status and tui-idle refusal. Remaining imports and selectors keep their scope. No equivalent replacement or fresh gate execution is claimed. CLI ownership cleanup retires low-value test cases, including explicit-current no-read, legacy success/idempotent acceptance, and caller-pane routing examples. Retained refusal and recovery assertions are listed below; dated receipts keep their original scopes. Audit3429 composes root-adopted3426/independent3427: intentionally removes168 authored/205 potential expanded cases across16 semantic sources, deleting11 whole suites and one304line unused assertion helper. Five authored/five potential cases remain; the duplicate500k graph row is dropped while its50k row and callback remain. No equivalent replacement or fresh execution is claimed. The complete federation-lifecycle-settlement suite is removed, losing its fake remote settlement/protocol/acknowledgment examples. Its exact standalone command, testFiles entry and complete assertionRef are retired and prior fields archived. Existing receipts select unrelated migration and compiled CLI journeys and retain original scopes. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3390 composes root-adopted3382/independent3383 and3386/independent3387 and3388/independent3389: intentionally retires216 authored registrations/230 expanded cases in42 whole authored suites plus5 zero-case registration drivers, without equivalent replacement. Lost local alarms include fake PTY identity/routing/startup/replay/mode/title/mouse/IME/scroll matrices, broad startup identity and file-open wiring, mock mailbox title recovery, mobile row parity and whole-v-selective save parity. Retained24 registrations/26 expanded cases in22 suites preserve actual xterm Windows buffer/wrap/scroll, typed TOML scalar, real Promise cancellation/settlement, HTTP Codex scanner/projector semantics, durable recovery admission/newer-schema bytes, federation completion/ACK/SQLite atomicity and failed stale-run-write versus imported durable history. Additional retained clock-domain scheduling, durable freeze/ACK/checkpoint ordering, ABA dirty intent, SQL atomicity, folder-domain retier/last-note deletion, scrollback durable no-sync staging, PanelBridge subscriber lifetime and reserved-send publication preserve narrower concrete behaviors. Current finite owner drift assessed in bounded defining bodies; retained callback bytes unchanged. Historical notes and complete dated receipts keep their original exact scopes. No new execution, equivalent replacement, native focus/device/pixel, live remote or global mixed-version guarantee is claimed. Audit2923 accepts loss of the first/replayed attested legacy worker_done CLI acceptance alarms, including exact send parameters, sender pane proof, lifecycle-wait flag and minted mutation identity. The removed fixture supplied settled runtime verdicts; it did not execute settlement authority, durable replay or outage recovery. Reduced selectors have no new execution, fault-control or equivalent replacement credit. 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. 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. 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. NEXT136 retains only unchanged execution receipts at their original scopes. Reduced-source selectors and retained static assertions have no new execution or equivalent replacement credit. CLI command/orchestration owner cleanup intentionally retires three registrations selected by this gate: two mock-supplied lifecycle/Run-home rejection projection examples and the complete manually assembled JSON failure-envelope example. The JSON-envelope suite, its exact command token/testFiles entry and whole assertion reference are removed; the retired Run-home relay assertion is removed from the retained lifecycle suite. These boundary projection alarms are lost without equivalent replacement. Retained fail-closed settlement and mutation-recovery cases keep their own scope. Pure owner moves do not invalidate unrelated dated receipts, which retain their exact original bytes; no fresh reduced-selector execution, native or remote evidence is claimed.", + "coverageNotes": "Audit5912 deletes the complete federation acknowledgment migration suite. Its invented v26-schema default, migration-start and imported-cursor alarms are intentionally lost. The sole migration command, testFiles and assertionRef are retired. No equivalent replacement or fresh whole-gate pass is claimed. Complete prior account retained verbatim: Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit3994 retires two authored callbacks imported by the shared construction test driver: split OSC 9999 carry and rendererless status ownership, plus OpenCode permission text taking priority in status and tui-idle refusal. Remaining imports and selectors keep their scope. No equivalent replacement or fresh gate execution is claimed. CLI ownership cleanup retires low-value test cases, including explicit-current no-read, legacy success/idempotent acceptance, and caller-pane routing examples. Retained refusal and recovery assertions are listed below; dated receipts keep their original scopes. Audit3429 composes root-adopted3426/independent3427: intentionally removes168 authored/205 potential expanded cases across16 semantic sources, deleting11 whole suites and one304line unused assertion helper. Five authored/five potential cases remain; the duplicate500k graph row is dropped while its50k row and callback remain. No equivalent replacement or fresh execution is claimed. The complete federation-lifecycle-settlement suite is removed, losing its fake remote settlement/protocol/acknowledgment examples. Its exact standalone command, testFiles entry and complete assertionRef are retired and prior fields archived. Existing receipts select unrelated migration and compiled CLI journeys and retain original scopes. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3390 composes root-adopted3382/independent3383 and3386/independent3387 and3388/independent3389: intentionally retires216 authored registrations/230 expanded cases in42 whole authored suites plus5 zero-case registration drivers, without equivalent replacement. Lost local alarms include fake PTY identity/routing/startup/replay/mode/title/mouse/IME/scroll matrices, broad startup identity and file-open wiring, mock mailbox title recovery, mobile row parity and whole-v-selective save parity. Retained24 registrations/26 expanded cases in22 suites preserve actual xterm Windows buffer/wrap/scroll, typed TOML scalar, real Promise cancellation/settlement, HTTP Codex scanner/projector semantics, durable recovery admission/newer-schema bytes, federation completion/ACK/SQLite atomicity and failed stale-run-write versus imported durable history. Additional retained clock-domain scheduling, durable freeze/ACK/checkpoint ordering, ABA dirty intent, SQL atomicity, folder-domain retier/last-note deletion, scrollback durable no-sync staging, PanelBridge subscriber lifetime and reserved-send publication preserve narrower concrete behaviors. Current finite owner drift assessed in bounded defining bodies; retained callback bytes unchanged. Historical notes and complete dated receipts keep their original exact scopes. No new execution, equivalent replacement, native focus/device/pixel, live remote or global mixed-version guarantee is claimed. Audit2923 accepts loss of the first/replayed attested legacy worker_done CLI acceptance alarms, including exact send parameters, sender pane proof, lifecycle-wait flag and minted mutation identity. The removed fixture supplied settled runtime verdicts; it did not execute settlement authority, durable replay or outage recovery. Reduced selectors have no new execution, fault-control or equivalent replacement credit. 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. 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. 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. NEXT136 retains only unchanged execution receipts at their original scopes. Reduced-source selectors and retained static assertions have no new execution or equivalent replacement credit. CLI command/orchestration owner cleanup intentionally retires three registrations selected by this gate: two mock-supplied lifecycle/Run-home rejection projection examples and the complete manually assembled JSON failure-envelope example. The JSON-envelope suite, its exact command token/testFiles entry and whole assertion reference are removed; the retired Run-home relay assertion is removed from the retained lifecycle suite. These boundary projection alarms are lost without equivalent replacement. Retained fail-closed settlement and mutation-recovery cases keep their own scope. Pure owner moves do not invalidate unrelated dated receipts, which retain their exact original bytes; no fresh reduced-selector execution, native or remote evidence is claimed.", "motivatingLinks": [ "https://github.com/stablyai/orca/pull/11107#discussion_r3663321387", "https://github.com/stablyai/orca/issues/13858", @@ -10161,13 +10153,12 @@ "https://linear.app/stably/issue/STA-4022" ], "invariant": "Starting a worker in the coordinator's current workspace must materialize one inactive terminal tab before worker-start returns, preserve coordinator focus, and remain exactly once after workspace re-entry. After an app update or restart, an exact live legacy worker must fence automatic provider resume, adopt its original PTY into its original background pane, retain readable output, and clear the resume record without spawning, writing, signalling, interrupting, replacing, or focusing the worker. A current-contract worker whose renderer graph identity is temporarily absent must retain its Dispatch capability and settle exactly once from exact hook-attested handle, pane, and process evidence; otherwise only an exact attested coordinator may take over. A worker_done caller may report success only after the owning runtime returns an explicit lifecycle verdict or authoritative reads prove that the exact Task, Dispatch, and worker report receipt settled the expected outcome. Federated terminal settlement must remain replay-eligible until the worker durably acknowledges it, and identical same-outcome retries must converge idempotently. Independently updated clients and worker servers must preserve the negotiated protocol: current peers use Run-home lifecycle settlement, while protocol v1/v2 peers retain their legacy completion path without receiving newer-only fields. A federated worker may accept only the authority defined by its negotiated protocol. An exact existing target workspace must receive a discoverable tab without stealing coordinator focus; if renderer reveal fails, worker-start must expose that the live worker remains background-only. Run and Dispatch checks must resolve through the caller's stable pane identity when a terminal handle is reminted, while a live handle outranks mismatched pane metadata. A nested worker's creator edge requires the current creator pane, process incarnation, and owning Run generation; reminting and rebinding that pane to another Run must remove the stale edge. Explicit legacy terminal inspection remains handle-scoped, and remote or headless worker presentation remains background-only.", - "oracle": "Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit3832 deliberately retires76 authored/79 finite cases:75 runtime compatibility cases/78 finite cases across14 fragments, plus one localization extractor default-flag case. Three whole runtime fragments are deleted;27 authored/30 finite cases remain across the reviewed sources. This gate retains only its own selected scope; no equivalent replacement or fresh runtime/native/remote evidence is claimed. Runtime component A: Audit3828 composes3822 with independent3824: deliberately retires49 authored/52 finite cases from seven compatibility fragments, leaving15 authored/18 finite cases and deleting two entire fragments. Accepted losses: positive folder-worker recovery/materialization and reveal deadline; persisted-key normalization and legacy split/group/focus projection; fixed stale CAS refusal; occupied/alias/restored/preallocated terminal-handle variants; fixed OpenCode/Cursor/Claude/Codex/Antigravity classification, readiness, title and management examples; direct private-map browser authority projections; browser-focus and OMP title projection; already-aborted claim cleanup. Additional3824 loss: src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts :: does not poll a wrapper foreground for a speculative CLI prompt send :: Speculative retryForegroundWrappers:false check must return false on a wrapper after one foreground read, without polling the supplied later codex response. These real bounded alarms are deliberately retired for low marginal value. Retained callbacks are unchanged and provide only their own bounded scope, not equivalent replacement. Historical receipts do not validate reduced callbacks. No fresh runtime/native/SSH/WSL/phone/browser evidence or full transitive closure is claimed. Runtime component B: Audit3834 deliberately retires26 authored/26 finite cases from seven fresh compatibility fragments, leaving10/10 and deleting the one-case saved-binding reattachment fragment. Original position58 is excluded: its existing substantive3578 KEEP7 review remains historical, with no fresh credit. Accepted losses: fixed hook/provider-session identities and stale metadata refusal; decorative/pre-title foreground ordering variants; saved-binding surface reattachment; saved-row exit ghost removal and silent activation selection; unsupported headless wake; positive pending materialization/group projections; per-caller navigation selection; positive SSH hydration/read partition; laptop mobile publication/buffer and background/pending/status projections; abnormal/unregistered SSH grace, normal-exit refusal, persisted SSH hydration, positive serve reattachment, pending-agent launch arguments and direct seeded running-launch admission guard. These are real bounded alarms deliberately retired for low marginal value. Retained cases preserve their own distinct deferred foreground coalescing, usable handle continuity, stale inventory refresh, concurrent browser snapshot preservation, renderer graph fencing, caller dedup isolation, SSH partition writes, runtime split lifetime, independent relay-ready publication, lease admission/state/expiry. The direct running-launch no-spawn guard alarm is deliberately retired; no remaining owning-launch refusal coverage is claimed. Historical runs do not validate reduced callbacks. No equivalent replacement, runtime/native/SSH/WSL/phone/browser result or full transitive closure is claimed. Additional extractor loss: config/scripts/localization/source-extraction/audit-localization-native-dialogs.test.mjs :: does not change the existing renderer scan by default :: Default options must omit the five native-only fields in this supplied snippet. No equivalent replacement is claimed. Historical prior account (preserved verbatim): Audit3814 deliberately retires60 authored/60 finite cases:53runtime compatibility cases,4native XCTest methods and3Python clipboard methods, including the entire StableElementIndexes suite. Clipboard cuts retire the one-over-cap sample, incoming-offer destruction trace and sequential20-copy replay; actual wire, FD/pipe, startup and Xvfb/GTK boundaries remain without equivalent replacement claims. Accepted losses include narrow terminal-send payload/provider projections, legacy and direct no-op/error permutations, timing/work-count examples, private state/title/activity projections and fixture-driven readiness examples, individually enumerated below. These include real bounded production alarms consciously retired for marginal value; retained failed writes, duplicate submission, stale capture, transcript/ring and allocation fences are not equivalent replacements. No fresh native/remote/browser execution or complete transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3806 deliberately retires40 authored/40 finite runtime compatibility cases, including the terminal-side-effect-facts-part03 headless-snapshots-part02 and agent-status-and-waits-part03 fragments, plus20 scalar Swift precondition sites. Lost runtime alarms include status/title/attention projection examples, simple renderer/headless frame restoration and status waiting outcomes detailed in the accepted-loss ledger. Swift cuts retire duplicate generation-map/schema/navigation/bridge and notification-wrapper assertions; no standalone native program is deleted. These include real bounded production alarms consciously retired for marginal value. Retained races, pending writes/reflow, namespace and waiter ownership are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3798 deliberately retires21 authored/24 finite compatibility cases, including the entire SSH-worktree-lifecycle and repository-project-operations fragments. Accepted losses include navigation-only settings acknowledgement, browser session cleanup and host preservation projections, window positive/policy-state examples, terminal recovery/reload and no-incarnation remint examples, terminal listing compatibility/malformed IDs, directory browse/sort/Windows path smoke, SSH create refusal/manual lineage, recursive parent-folder creation and fork/origin/avatar/icon projections. Real bounded production alarms are consciously retired for marginal value; retained authority races, cleanup/clone ownership, pending waiters, nested-folder and scan invalidation cases are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3429 composes root-adopted3426/independent3427: intentionally removes168 authored/205 potential expanded cases across16 semantic sources, deleting11 whole suites and one304line unused assertion helper. Five authored/five potential cases remain; the duplicate500k graph row is dropped while its50k row and callback remain. No equivalent replacement or fresh execution is claimed. The complete federation-lifecycle-settlement suite is removed, losing its fake remote settlement/protocol/acknowledgment examples. Its exact standalone command, testFiles entry and complete assertionRef are retired and prior fields archived. Existing receipts select unrelated migration and compiled CLI journeys and retain original scopes. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3390 composes root-adopted3382/independent3383 and3386/independent3387 and3388/independent3389: intentionally retires216 authored registrations/230 expanded cases in42 whole authored suites plus5 zero-case registration drivers, without equivalent replacement. Lost local alarms include fake PTY identity/routing/startup/replay/mode/title/mouse/IME/scroll matrices, broad startup identity and file-open wiring, mock mailbox title recovery, mobile row parity and whole-v-selective save parity. Retained24 registrations/26 expanded cases in22 suites preserve actual xterm Windows buffer/wrap/scroll, typed TOML scalar, real Promise cancellation/settlement, HTTP Codex scanner/projector semantics, durable recovery admission/newer-schema bytes, federation completion/ACK/SQLite atomicity and failed stale-run-write versus imported durable history. Additional retained clock-domain scheduling, durable freeze/ACK/checkpoint ordering, ABA dirty intent, SQL atomicity, folder-domain retier/last-note deletion, scrollback durable no-sync staging, PanelBridge subscriber lifetime and reserved-send publication preserve narrower concrete behaviors. Current finite owner drift assessed in bounded defining bodies; retained callback bytes unchanged. Historical notes and complete dated receipts keep their original exact scopes. No new execution, equivalent replacement, native focus/device/pixel, live remote or global mixed-version guarantee is claimed. Audit2923 accepts loss of the first/replayed attested legacy worker_done CLI acceptance alarms, including exact send parameters, sender pane proof, lifecycle-wait flag and minted mutation identity. The removed fixture supplied settled runtime verdicts; it did not execute settlement authority, durable replay or outage recovery. Reduced selectors have no new execution, fault-control or equivalent replacement credit. 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. 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. 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. Retained assertion references and unchanged receipts keep their original scopes; retired callbacks and archived receipts provide no current coverage.", + "oracle": "Audit5912 deletes the complete federation acknowledgment migration suite. Its invented v26-schema default, migration-start and imported-cursor alarms are intentionally lost. The sole migration command, testFiles and assertionRef are retired. No equivalent replacement or fresh whole-gate pass is claimed. Complete prior oracle retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit3832 deliberately retires76 authored/79 finite cases:75 runtime compatibility cases/78 finite cases across14 fragments, plus one localization extractor default-flag case. Three whole runtime fragments are deleted;27 authored/30 finite cases remain across the reviewed sources. This gate retains only its own selected scope; no equivalent replacement or fresh runtime/native/remote evidence is claimed. Runtime component A: Audit3828 composes3822 with independent3824: deliberately retires49 authored/52 finite cases from seven compatibility fragments, leaving15 authored/18 finite cases and deleting two entire fragments. Accepted losses: positive folder-worker recovery/materialization and reveal deadline; persisted-key normalization and legacy split/group/focus projection; fixed stale CAS refusal; occupied/alias/restored/preallocated terminal-handle variants; fixed OpenCode/Cursor/Claude/Codex/Antigravity classification, readiness, title and management examples; direct private-map browser authority projections; browser-focus and OMP title projection; already-aborted claim cleanup. Additional3824 loss: src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts :: does not poll a wrapper foreground for a speculative CLI prompt send :: Speculative retryForegroundWrappers:false check must return false on a wrapper after one foreground read, without polling the supplied later codex response. These real bounded alarms are deliberately retired for low marginal value. Retained callbacks are unchanged and provide only their own bounded scope, not equivalent replacement. Historical receipts do not validate reduced callbacks. No fresh runtime/native/SSH/WSL/phone/browser evidence or full transitive closure is claimed. Runtime component B: Audit3834 deliberately retires26 authored/26 finite cases from seven fresh compatibility fragments, leaving10/10 and deleting the one-case saved-binding reattachment fragment. Original position58 is excluded: its existing substantive3578 KEEP7 review remains historical, with no fresh credit. Accepted losses: fixed hook/provider-session identities and stale metadata refusal; decorative/pre-title foreground ordering variants; saved-binding surface reattachment; saved-row exit ghost removal and silent activation selection; unsupported headless wake; positive pending materialization/group projections; per-caller navigation selection; positive SSH hydration/read partition; laptop mobile publication/buffer and background/pending/status projections; abnormal/unregistered SSH grace, normal-exit refusal, persisted SSH hydration, positive serve reattachment, pending-agent launch arguments and direct seeded running-launch admission guard. These are real bounded alarms deliberately retired for low marginal value. Retained cases preserve their own distinct deferred foreground coalescing, usable handle continuity, stale inventory refresh, concurrent browser snapshot preservation, renderer graph fencing, caller dedup isolation, SSH partition writes, runtime split lifetime, independent relay-ready publication, lease admission/state/expiry. The direct running-launch no-spawn guard alarm is deliberately retired; no remaining owning-launch refusal coverage is claimed. Historical runs do not validate reduced callbacks. No equivalent replacement, runtime/native/SSH/WSL/phone/browser result or full transitive closure is claimed. Additional extractor loss: config/scripts/localization/source-extraction/audit-localization-native-dialogs.test.mjs :: does not change the existing renderer scan by default :: Default options must omit the five native-only fields in this supplied snippet. No equivalent replacement is claimed. Historical prior account (preserved verbatim): Audit3814 deliberately retires60 authored/60 finite cases:53runtime compatibility cases,4native XCTest methods and3Python clipboard methods, including the entire StableElementIndexes suite. Clipboard cuts retire the one-over-cap sample, incoming-offer destruction trace and sequential20-copy replay; actual wire, FD/pipe, startup and Xvfb/GTK boundaries remain without equivalent replacement claims. Accepted losses include narrow terminal-send payload/provider projections, legacy and direct no-op/error permutations, timing/work-count examples, private state/title/activity projections and fixture-driven readiness examples, individually enumerated below. These include real bounded production alarms consciously retired for marginal value; retained failed writes, duplicate submission, stale capture, transcript/ring and allocation fences are not equivalent replacements. No fresh native/remote/browser execution or complete transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3806 deliberately retires40 authored/40 finite runtime compatibility cases, including the terminal-side-effect-facts-part03 headless-snapshots-part02 and agent-status-and-waits-part03 fragments, plus20 scalar Swift precondition sites. Lost runtime alarms include status/title/attention projection examples, simple renderer/headless frame restoration and status waiting outcomes detailed in the accepted-loss ledger. Swift cuts retire duplicate generation-map/schema/navigation/bridge and notification-wrapper assertions; no standalone native program is deleted. These include real bounded production alarms consciously retired for marginal value. Retained races, pending writes/reflow, namespace and waiter ownership are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3798 deliberately retires21 authored/24 finite compatibility cases, including the entire SSH-worktree-lifecycle and repository-project-operations fragments. Accepted losses include navigation-only settings acknowledgement, browser session cleanup and host preservation projections, window positive/policy-state examples, terminal recovery/reload and no-incarnation remint examples, terminal listing compatibility/malformed IDs, directory browse/sort/Windows path smoke, SSH create refusal/manual lineage, recursive parent-folder creation and fork/origin/avatar/icon projections. Real bounded production alarms are consciously retired for marginal value; retained authority races, cleanup/clone ownership, pending waiters, nested-folder and scan invalidation cases are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3429 composes root-adopted3426/independent3427: intentionally removes168 authored/205 potential expanded cases across16 semantic sources, deleting11 whole suites and one304line unused assertion helper. Five authored/five potential cases remain; the duplicate500k graph row is dropped while its50k row and callback remain. No equivalent replacement or fresh execution is claimed. The complete federation-lifecycle-settlement suite is removed, losing its fake remote settlement/protocol/acknowledgment examples. Its exact standalone command, testFiles entry and complete assertionRef are retired and prior fields archived. Existing receipts select unrelated migration and compiled CLI journeys and retain original scopes. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3390 composes root-adopted3382/independent3383 and3386/independent3387 and3388/independent3389: intentionally retires216 authored registrations/230 expanded cases in42 whole authored suites plus5 zero-case registration drivers, without equivalent replacement. Lost local alarms include fake PTY identity/routing/startup/replay/mode/title/mouse/IME/scroll matrices, broad startup identity and file-open wiring, mock mailbox title recovery, mobile row parity and whole-v-selective save parity. Retained24 registrations/26 expanded cases in22 suites preserve actual xterm Windows buffer/wrap/scroll, typed TOML scalar, real Promise cancellation/settlement, HTTP Codex scanner/projector semantics, durable recovery admission/newer-schema bytes, federation completion/ACK/SQLite atomicity and failed stale-run-write versus imported durable history. Additional retained clock-domain scheduling, durable freeze/ACK/checkpoint ordering, ABA dirty intent, SQL atomicity, folder-domain retier/last-note deletion, scrollback durable no-sync staging, PanelBridge subscriber lifetime and reserved-send publication preserve narrower concrete behaviors. Current finite owner drift assessed in bounded defining bodies; retained callback bytes unchanged. Historical notes and complete dated receipts keep their original exact scopes. No new execution, equivalent replacement, native focus/device/pixel, live remote or global mixed-version guarantee is claimed. Audit2923 accepts loss of the first/replayed attested legacy worker_done CLI acceptance alarms, including exact send parameters, sender pane proof, lifecycle-wait flag and minted mutation identity. The removed fixture supplied settled runtime verdicts; it did not execute settlement authority, durable replay or outage recovery. Reduced selectors have no new execution, fault-control or equivalent replacement credit. 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. 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. 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. Retained assertion references and unchanged receipts keep their original scopes; retired callbacks and archived receipts provide no current coverage.", "commands": [ "ORCA_BACKGROUND_LAUNCH=1 npx vitest run --config config/vitest.config.ts src/main/runtime/rpc/methods/orchestration/messaging/check-worker-federated-attachment.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/cli/orchestration/orchestration.test.ts src/cli/orchestration/messages/orchestration-check-identity.test.ts src/main/runtime/rpc/methods/orchestration/worker/start/worker-start-composition.test.ts src/main/runtime/rpc/methods/orchestration/messaging/check.test.ts src/main/runtime/rpc/methods/orchestration/messaging/send.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/cli/orchestration/recovery/orchestration-lifecycle-rejection.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/methods/orchestration/federation/federation.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orchestration/db/federation/federation-acknowledgment-migration.test.ts --reporter=dot", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/construction/orca-runtime.test.ts", "pnpm run test:e2e -- tests/e2e/orchestration-worker-terminal-visibility.spec.ts --workers=1", "pnpm run build:cli && SKIP_BUILD=1 pnpm exec playwright test tests/e2e/orchestration-worker-settlement-release-cli.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1" @@ -10182,7 +10173,6 @@ "src/main/runtime/rpc/methods/orchestration/messaging/check.test.ts", "src/main/runtime/rpc/methods/orchestration/messaging/send.test.ts", "src/main/runtime/rpc/methods/orchestration/federation/federation.test.ts", - "src/main/runtime/orchestration/db/federation/federation-acknowledgment-migration.test.ts", "tests/e2e/orchestration-worker-terminal-visibility.spec.ts", "tests/e2e/orchestration-worker-settlement-release-cli.spec.ts" ], @@ -10219,14 +10209,6 @@ "Dispatch delivery resolves through a stable worker pane after handle remint" ] }, - { - "file": "src/main/runtime/orchestration/db/federation/federation-acknowledgment-migration.test.ts", - "assertions": [ - "a v26 database gains a zeroed durable home-to-worker acknowledgment watermark", - "a complete v26 database starts migration at v26 rather than replaying v7-v26", - "the migration advances schema version without losing the imported relay cursor" - ] - }, { "file": "tests/e2e/orchestration-worker-terminal-visibility.spec.ts", "assertions": [ @@ -10249,16 +10231,6 @@ } ], "evidenceRuns": [ - { - "date": "2026-08-12", - "runner": "local", - "platform": "macos", - "command": "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orchestration/federation-acknowledgment-migration.test.ts --reporter=dot", - "result": "passed", - "durationSeconds": 0.47, - "summary": "A complete v26 database resolved migration start at v26, upgraded to v27, retained its imported cursor, and initialized the durable acknowledgment watermark to zero.", - "currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orchestration/db/federation/federation-acknowledgment-migration.test.ts --reporter=dot" - }, { "date": "2026-08-12", "runner": "local", @@ -10353,7 +10325,8 @@ "CLI ownership cleanup intentionally removes the retired success, routing and work-count alarms without replacement. Prior CLI assertion references: [{\"file\":\"src/cli/handlers/orchestration-lifecycle-rejection.test.ts\",\"assertions\":[\"an explicit current worker_done verdict completes without a compatibility read\",\"a worker_done response without a lifecycle verdict checks the exact authoritative Dispatch and report receipt\",\"legacy succeeded and failed reports require matching terminal Task and Dispatch state\",\"stopped or stale Dispatches cannot impersonate report settlement\",\"an idempotent retry accepts the first authoritative report from the same worker\",\"a Run-home relay rejection reaches the CLI error boundary\"]},{\"file\":\"src/cli/handlers/orchestration-check-identity.test.ts\",\"assertions\":[\"implicit check carries the caller pane key with a potentially stale environment handle\",\"explicit legacy terminal inspection does not inherit the caller pane key\"]}]", "Audit3832 deliberately retires76 authored/79 finite cases:75 runtime compatibility cases/78 finite cases across14 fragments, plus one localization extractor default-flag case. Three whole runtime fragments are deleted;27 authored/30 finite cases remain across the reviewed sources. This gate retains only its own selected scope; no equivalent replacement or fresh runtime/native/remote evidence is claimed. Runtime component A: Audit3828 composes3822 with independent3824: deliberately retires49 authored/52 finite cases from seven compatibility fragments, leaving15 authored/18 finite cases and deleting two entire fragments. Accepted losses: positive folder-worker recovery/materialization and reveal deadline; persisted-key normalization and legacy split/group/focus projection; fixed stale CAS refusal; occupied/alias/restored/preallocated terminal-handle variants; fixed OpenCode/Cursor/Claude/Codex/Antigravity classification, readiness, title and management examples; direct private-map browser authority projections; browser-focus and OMP title projection; already-aborted claim cleanup. Additional3824 loss: src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts :: does not poll a wrapper foreground for a speculative CLI prompt send :: Speculative retryForegroundWrappers:false check must return false on a wrapper after one foreground read, without polling the supplied later codex response. These real bounded alarms are deliberately retired for low marginal value. Retained callbacks are unchanged and provide only their own bounded scope, not equivalent replacement. Historical receipts do not validate reduced callbacks. No fresh runtime/native/SSH/WSL/phone/browser evidence or full transitive closure is claimed. Runtime component B: Audit3834 deliberately retires26 authored/26 finite cases from seven fresh compatibility fragments, leaving10/10 and deleting the one-case saved-binding reattachment fragment. Original position58 is excluded: its existing substantive3578 KEEP7 review remains historical, with no fresh credit. Accepted losses: fixed hook/provider-session identities and stale metadata refusal; decorative/pre-title foreground ordering variants; saved-binding surface reattachment; saved-row exit ghost removal and silent activation selection; unsupported headless wake; positive pending materialization/group projections; per-caller navigation selection; positive SSH hydration/read partition; laptop mobile publication/buffer and background/pending/status projections; abnormal/unregistered SSH grace, normal-exit refusal, persisted SSH hydration, positive serve reattachment, pending-agent launch arguments and direct seeded running-launch admission guard. These are real bounded alarms deliberately retired for low marginal value. Retained cases preserve their own distinct deferred foreground coalescing, usable handle continuity, stale inventory refresh, concurrent browser snapshot preservation, renderer graph fencing, caller dedup isolation, SSH partition writes, runtime split lifetime, independent relay-ready publication, lease admission/state/expiry. The direct running-launch no-spawn guard alarm is deliberately retired; no remaining owning-launch refusal coverage is claimed. Historical runs do not validate reduced callbacks. No equivalent replacement, runtime/native/SSH/WSL/phone/browser result or full transitive closure is claimed. Additional extractor loss: config/scripts/localization/source-extraction/audit-localization-native-dialogs.test.mjs :: does not change the existing renderer scan by default :: Default options must omit the five native-only fields in this supplied snippet. No equivalent replacement is claimed.", "Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. ", - "Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. " + "Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. ", + "Audit5912 deletes the complete federation acknowledgment migration suite. Its invented v26-schema default, migration-start and imported-cursor alarms are intentionally lost. The sole migration command, testFiles and assertionRef are retired. No equivalent replacement or fresh whole-gate pass is claimed. Retired complete dated evidenceRuns (historical only): [{\"date\":\"2026-08-12\",\"runner\":\"local\",\"platform\":\"macos\",\"command\":\"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orchestration/federation-acknowledgment-migration.test.ts --reporter=dot\",\"result\":\"passed\",\"durationSeconds\":0.47,\"summary\":\"A complete v26 database resolved migration start at v26, upgraded to v27, retained its imported cursor, and initialized the durable acknowledgment watermark to zero.\",\"currentCommand\":\"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orchestration/db/federation/federation-acknowledgment-migration.test.ts --reporter=dot\"}]" ], "demotionRule": "Keep experimental or demote if either Electron journey flakes without a product or harness defect, if local worker-start can return before tab materialization without an explicit reveal warning, if focus moves to the worker, if restart or workspace re-entry spawns/resumes/duplicates/interferes with the worker, if retained output becomes unreadable, or if pane-stable delivery reads the wrong mailbox." }, @@ -10486,7 +10459,7 @@ "providers": ["local", "daemon", "ssh", "wsl", "remote-runtime"], "coveredPlatforms": ["macos"], "coveredProviders": [], - "coverageNotes": "Audit3899 intentionally removes the seeded accepted-worker-start receipt callback from the retained orchestration mutation-ledger test suite, without equivalent replacement. It used an in-memory database and no restart or actual worker launch. The lost alarm is operation_unknown with accepted Dispatch recovery guidance and no second handler invocation. The separate independent-database pending-ask recovery callback remains byte-identical. Existing selectors remain executable but reduced source bytes have no fresh execution in this static audit; the complete dated worker-release CLI receipt retains its original unchanged scope and does not validate these reduced ledger bytes. Historical prior account (preserved verbatim): Audit3678 current-source reassessment removes20 authored/24 finite root-unit cases across7 retained test sources; all10 selected current drivers80 authored/93 finite were read, leaving60 authored/69 finite unchanged. Removed alarms are the in-memory WAL PRAGMA constant, ordinary latest-dispatch/gate-creation inventories, self-reported-failure and explicit-terminal retry policy rows, SSH/unsupported-provider output fallback labels, legacy typing no-op/retain-before-report/manual scheduling rows, exited output status and copied resume-session metadata, incomplete inventory deferral/reset cascade inventory, and nominal release/active-state/corrupt external history/stopped-abandoned outcome/generic close-exception rows. These are intentional coverage losses, not replaced alarms. Retained source includes actual SQLite rollback/custody, mutable transcript/deletion and saved-copy compatibility, cursor mutation, clear lineage, auto-release timing/restart/admission and concurrent recovery seams. Historical KEEP decisions are consciously superseded where stated in decisions.json. Source-only evidence; no runtime, CI, native, provider, remote, mobile/folder or global completion credit. Previous account (preserved verbatim): Audit3437 composes ROOT-adopted3431/independent3432: intentionally removes127 authored/174 potential expanded cases across12 sources, deleting7 whole suites and one267line unused helper without test credit. Retain8 authored/13 potential cases. No equivalent replacement or fresh execution is claimed. Lose the complete completed-worker-retirement-resume suite: exact terminal-close resume-record revocation, PTY-exit recovery retention and settled-worker release examples. Remove its exact command token or standalone command, testFiles entry and assertionRef, archiving complete prior fields. Independent receipts retain original scopes. Audit2003: Remove3 preexisting unsupported320-live-PTY,400-retirement/256-history and replacement-lifecycle aliases from the inventory driver: neither its frozen original imported registrars nor proposed candidate owns those callbacks. This metadata correction adds no test-removal credit. The driver loses the empty-worktree-publication suite and3 folder-host/unverifiable scalar examples while retaining concurrent inventory freshness and provider-failure verdict fences. The retained inventory callbacks are not terminal-release, historical-cache capacity or performance-budget replacement coverage. Preserve the independent compiled-CLI Electron receipt exactly. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Remove unsupported user-taken-over, transferred-owner, exact-reuse, host-scope, immutable-transcript, legacy-ambiguity, reset and50-worker aliases from their claimed sources. Remove the deleted pending-release ledger replay alias. Narrow surviving external-retention and recovery aliases to actual retained callbacks; no transfer to another file or process-restart proof. Preserve the independent receipt. 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): Audit1959 (sources 1955:34): Pruning removes unsupported-provider/out-of-range scalar refusals and the single Grok happy decoder fixture. Retain actual file cursor append/paging, same-inode checkpoint invalidation, opaque IDs and oversized-line progress. Retire the complete dated 3.48s combined receipt through its effective currentCommand, without changing its original command or transferring its 56-test result. Unchanged CLI/Electron receipt retains its independent scope. No historical passed receipt is narrowed or transferred to changed source bytes. No fresh execution, equivalent replacement, physical provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed by this metadata packet. Historical prior account (preserved verbatim): Audit1379 changes src/main/runtime/orca-runtime-process-incarnation-liveness.test.ts (7 authored registrations removed; 0 retained). Intentional losses: Loses supplied host lists and record states mapped to liveness enums and routing counts; no live/dead process evidence. No equivalent replacement coverage is claimed. Remaining exact receipts validate only their unchanged selectors. Historical coverage account: Only Keep open keeps a worker; a phone or desktop names it by handle, pane or session, and older clients' typing reports record nothing. Host byte lanes perform zero orchestration SQL work; local and injected SSH Keep open tests fence release. Deterministic service tests cover release-versus-reuse ordering, transactional retain and takeover cancellation, exact host/pane/process identity, dead external/user-owned/transferred/stopped/abandoned reconciliation, host-partition persistence and legacy retirement replay with an absent web-terminal layout map, conservative unknown provider and legacy metadata handling, immutable transcript and bounded terminal archives, mutation restart, reset cleanup, replay idempotency, and 50-resource accounting. A macOS Electron journey invokes the freshly compiled worker-release CLI after the worker process disappears, then independently checks released SQLite state and coordinator liveness. Injected inventories cover local and SSH provider routing; live SSH, WSL, Windows, paired-runtime, and provider-close lost-ack journeys remain explicit gaps. Audit1396: src/main/runtime/rpc/methods/orchestration/worker/worker-release-mobile-report.test.ts reduced. Retires unary/stream no-database-work call counts and three mobile RPC allowlist membership checks. Ancillary input delivery assertions in the budget registration intentionally lost without equivalence 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.", + "coverageNotes": "Audit5912 deletes the entire worker-release-mobile-report suite. Fake worker Keep open/report/release alarms are intentionally lost; its compound command is narrowed to the surviving incarnation suite and its testFiles entry removed. The unchanged compiled-CLI receipt retains only its original scope; no equivalent replacement or fresh whole-gate pass is claimed. Complete prior account retained verbatim: Audit3899 intentionally removes the seeded accepted-worker-start receipt callback from the retained orchestration mutation-ledger test suite, without equivalent replacement. It used an in-memory database and no restart or actual worker launch. The lost alarm is operation_unknown with accepted Dispatch recovery guidance and no second handler invocation. The separate independent-database pending-ask recovery callback remains byte-identical. Existing selectors remain executable but reduced source bytes have no fresh execution in this static audit; the complete dated worker-release CLI receipt retains its original unchanged scope and does not validate these reduced ledger bytes. Historical prior account (preserved verbatim): Audit3678 current-source reassessment removes20 authored/24 finite root-unit cases across7 retained test sources; all10 selected current drivers80 authored/93 finite were read, leaving60 authored/69 finite unchanged. Removed alarms are the in-memory WAL PRAGMA constant, ordinary latest-dispatch/gate-creation inventories, self-reported-failure and explicit-terminal retry policy rows, SSH/unsupported-provider output fallback labels, legacy typing no-op/retain-before-report/manual scheduling rows, exited output status and copied resume-session metadata, incomplete inventory deferral/reset cascade inventory, and nominal release/active-state/corrupt external history/stopped-abandoned outcome/generic close-exception rows. These are intentional coverage losses, not replaced alarms. Retained source includes actual SQLite rollback/custody, mutable transcript/deletion and saved-copy compatibility, cursor mutation, clear lineage, auto-release timing/restart/admission and concurrent recovery seams. Historical KEEP decisions are consciously superseded where stated in decisions.json. Source-only evidence; no runtime, CI, native, provider, remote, mobile/folder or global completion credit. Previous account (preserved verbatim): Audit3437 composes ROOT-adopted3431/independent3432: intentionally removes127 authored/174 potential expanded cases across12 sources, deleting7 whole suites and one267line unused helper without test credit. Retain8 authored/13 potential cases. No equivalent replacement or fresh execution is claimed. Lose the complete completed-worker-retirement-resume suite: exact terminal-close resume-record revocation, PTY-exit recovery retention and settled-worker release examples. Remove its exact command token or standalone command, testFiles entry and assertionRef, archiving complete prior fields. Independent receipts retain original scopes. Audit2003: Remove3 preexisting unsupported320-live-PTY,400-retirement/256-history and replacement-lifecycle aliases from the inventory driver: neither its frozen original imported registrars nor proposed candidate owns those callbacks. This metadata correction adds no test-removal credit. The driver loses the empty-worktree-publication suite and3 folder-host/unverifiable scalar examples while retaining concurrent inventory freshness and provider-failure verdict fences. The retained inventory callbacks are not terminal-release, historical-cache capacity or performance-budget replacement coverage. Preserve the independent compiled-CLI Electron receipt exactly. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Remove unsupported user-taken-over, transferred-owner, exact-reuse, host-scope, immutable-transcript, legacy-ambiguity, reset and50-worker aliases from their claimed sources. Remove the deleted pending-release ledger replay alias. Narrow surviving external-retention and recovery aliases to actual retained callbacks; no transfer to another file or process-restart proof. Preserve the independent receipt. 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): Audit1959 (sources 1955:34): Pruning removes unsupported-provider/out-of-range scalar refusals and the single Grok happy decoder fixture. Retain actual file cursor append/paging, same-inode checkpoint invalidation, opaque IDs and oversized-line progress. Retire the complete dated 3.48s combined receipt through its effective currentCommand, without changing its original command or transferring its 56-test result. Unchanged CLI/Electron receipt retains its independent scope. No historical passed receipt is narrowed or transferred to changed source bytes. No fresh execution, equivalent replacement, physical provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed by this metadata packet. Historical prior account (preserved verbatim): Audit1379 changes src/main/runtime/orca-runtime-process-incarnation-liveness.test.ts (7 authored registrations removed; 0 retained). Intentional losses: Loses supplied host lists and record states mapped to liveness enums and routing counts; no live/dead process evidence. No equivalent replacement coverage is claimed. Remaining exact receipts validate only their unchanged selectors. Historical coverage account: Only Keep open keeps a worker; a phone or desktop names it by handle, pane or session, and older clients' typing reports record nothing. Host byte lanes perform zero orchestration SQL work; local and injected SSH Keep open tests fence release. Deterministic service tests cover release-versus-reuse ordering, transactional retain and takeover cancellation, exact host/pane/process identity, dead external/user-owned/transferred/stopped/abandoned reconciliation, host-partition persistence and legacy retirement replay with an absent web-terminal layout map, conservative unknown provider and legacy metadata handling, immutable transcript and bounded terminal archives, mutation restart, reset cleanup, replay idempotency, and 50-resource accounting. A macOS Electron journey invokes the freshly compiled worker-release CLI after the worker process disappears, then independently checks released SQLite state and coordinator liveness. Injected inventories cover local and SSH provider routing; live SSH, WSL, Windows, paired-runtime, and provider-close lost-ack journeys remain explicit gaps. Audit1396: src/main/runtime/rpc/methods/orchestration/worker/worker-release-mobile-report.test.ts reduced. Retires unary/stream no-database-work call counts and three mobile RPC allowlist membership checks. Ancillary input delivery assertions in the budget registration intentionally lost without equivalence 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.", "motivatingLinks": [ "https://github.com/stablyai/orca/pull/12355", "https://github.com/stablyai/orca/issues/13860", @@ -10495,9 +10468,9 @@ "STA-5122" ], "invariant": "A settled Dispatch may close only its one coordinator-created terminal lease. Explicit reuse, Keep open, retain, identity or host change, ambiguity, and another resource for the same exact host/pane/process must fence closure. Once the authoritative owning provider positively excludes the resource's exact immutable process incarnation, even an external, user-owned, or transferred dead resource must converge to released without any process close. Unknown host scope, missing incarnation metadata, or unavailable inventory must remain retained. Exact terminal-close persistence must settle when a host partition omits renderer-owned layout state. Output preservation and the requested-to-releasing transition are atomic, archives remain readable without the provider file, retries resume idempotently, and orchestration reset removes archive and authority state.", - "oracle": "Audit3899 intentionally removes the seeded accepted-worker-start receipt callback from the retained orchestration mutation-ledger test suite, without equivalent replacement. It used an in-memory database and no restart or actual worker launch. The lost alarm is operation_unknown with accepted Dispatch recovery guidance and no second handler invocation. The separate independent-database pending-ask recovery callback remains byte-identical. Existing selectors remain executable but reduced source bytes have no fresh execution in this static audit; the complete dated worker-release CLI receipt retains its original unchanged scope and does not validate these reduced ledger bytes. Historical prior account (preserved verbatim): Audit3678 current-source reassessment removes20 authored/24 finite root-unit cases across7 retained test sources; all10 selected current drivers80 authored/93 finite were read, leaving60 authored/69 finite unchanged. Removed alarms are the in-memory WAL PRAGMA constant, ordinary latest-dispatch/gate-creation inventories, self-reported-failure and explicit-terminal retry policy rows, SSH/unsupported-provider output fallback labels, legacy typing no-op/retain-before-report/manual scheduling rows, exited output status and copied resume-session metadata, incomplete inventory deferral/reset cascade inventory, and nominal release/active-state/corrupt external history/stopped-abandoned outcome/generic close-exception rows. These are intentional coverage losses, not replaced alarms. Retained source includes actual SQLite rollback/custody, mutable transcript/deletion and saved-copy compatibility, cursor mutation, clear lineage, auto-release timing/restart/admission and concurrent recovery seams. Historical KEEP decisions are consciously superseded where stated in decisions.json. Source-only evidence; no runtime, CI, native, provider, remote, mobile/folder or global completion credit. Previous oracle (preserved verbatim): Audit3437 composes ROOT-adopted3431/independent3432: intentionally removes127 authored/174 potential expanded cases across12 sources, deleting7 whole suites and one267line unused helper without test credit. Retain8 authored/13 potential cases. No equivalent replacement or fresh execution is claimed. Lose the complete completed-worker-retirement-resume suite: exact terminal-close resume-record revocation, PTY-exit recovery retention and settled-worker release examples. Remove its exact command token or standalone command, testFiles entry and assertionRef, archiving complete prior fields. Independent receipts retain original scopes. Audit2003: Remove3 preexisting unsupported320-live-PTY,400-retirement/256-history and replacement-lifecycle aliases from the inventory driver: neither its frozen original imported registrars nor proposed candidate owns those callbacks. This metadata correction adds no test-removal credit. The driver loses the empty-worktree-publication suite and3 folder-host/unverifiable scalar examples while retaining concurrent inventory freshness and provider-failure verdict fences. The retained inventory callbacks are not terminal-release, historical-cache capacity or performance-budget replacement coverage. Preserve the independent compiled-CLI Electron receipt exactly. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Remove unsupported user-taken-over, transferred-owner, exact-reuse, host-scope, immutable-transcript, legacy-ambiguity, reset and50-worker aliases from their claimed sources. Remove the deleted pending-release ledger replay alias. Narrow surviving external-retention and recovery aliases to actual retained callbacks; no transfer to another file or process-restart proof. Preserve the independent receipt. 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): Audit1959 (sources 1955:34): Pruning removes unsupported-provider/out-of-range scalar refusals and the single Grok happy decoder fixture. Retain actual file cursor append/paging, same-inode checkpoint invalidation, opaque IDs and oversized-line progress. Retire the complete dated 3.48s combined receipt through its effective currentCommand, without changing its original command or transferring its 56-test result. Unchanged CLI/Electron receipt retains its independent scope. No historical passed receipt is narrowed or transferred to changed source bytes. No fresh execution, equivalent replacement, physical provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed by this metadata packet. Historical prior account (preserved verbatim): Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Surviving unchanged-source receipts are the current oracle; changed-source assertions await validation. Historical oracle account: Record release intent for a settled owner, attempt exact reuse before close, and require worker-start to fail with terminal_release_in_progress while the terminal stays open; then release the original owner exactly once. Race retain against a controlled archive promise and require no committed archive or close. Rebase a closed web-terminal host partition without terminalLayoutsByTabId and require the persistence write to complete while preserving host-authoritative membership; replay a valid legacy retirement under the same omission and require exact membership removal plus revision advancement. For retained external, user-owned, transferred, stopped, and abandoned resources, run one fresh inventory against the exact local/WSL or SSH provider: an exact live incarnation and every unknown inventory shape stay retained, while positive absence atomically sets ownership_state and release_state to released with processAction none and zero closeTerminal calls. Change host or process identity and inject duplicate resource evidence to require retention. Freeze a structured transcript, delete its source file, and require archived worker-read to return the same bounded redacted messages. Restart a pending mutation, reset orchestration state, and create 50 resources while asserting replay convergence, zero orphan rows, two-query worker listing, and no unrelated close.", + "oracle": "Audit5912 deletes the entire worker-release-mobile-report suite. Fake worker Keep open/report/release alarms are intentionally lost; its compound command is narrowed to the surviving incarnation suite and its testFiles entry removed. The unchanged compiled-CLI receipt retains only its original scope; no equivalent replacement or fresh whole-gate pass is claimed. Complete prior oracle retained verbatim: Audit3899 intentionally removes the seeded accepted-worker-start receipt callback from the retained orchestration mutation-ledger test suite, without equivalent replacement. It used an in-memory database and no restart or actual worker launch. The lost alarm is operation_unknown with accepted Dispatch recovery guidance and no second handler invocation. The separate independent-database pending-ask recovery callback remains byte-identical. Existing selectors remain executable but reduced source bytes have no fresh execution in this static audit; the complete dated worker-release CLI receipt retains its original unchanged scope and does not validate these reduced ledger bytes. Historical prior account (preserved verbatim): Audit3678 current-source reassessment removes20 authored/24 finite root-unit cases across7 retained test sources; all10 selected current drivers80 authored/93 finite were read, leaving60 authored/69 finite unchanged. Removed alarms are the in-memory WAL PRAGMA constant, ordinary latest-dispatch/gate-creation inventories, self-reported-failure and explicit-terminal retry policy rows, SSH/unsupported-provider output fallback labels, legacy typing no-op/retain-before-report/manual scheduling rows, exited output status and copied resume-session metadata, incomplete inventory deferral/reset cascade inventory, and nominal release/active-state/corrupt external history/stopped-abandoned outcome/generic close-exception rows. These are intentional coverage losses, not replaced alarms. Retained source includes actual SQLite rollback/custody, mutable transcript/deletion and saved-copy compatibility, cursor mutation, clear lineage, auto-release timing/restart/admission and concurrent recovery seams. Historical KEEP decisions are consciously superseded where stated in decisions.json. Source-only evidence; no runtime, CI, native, provider, remote, mobile/folder or global completion credit. Previous oracle (preserved verbatim): Audit3437 composes ROOT-adopted3431/independent3432: intentionally removes127 authored/174 potential expanded cases across12 sources, deleting7 whole suites and one267line unused helper without test credit. Retain8 authored/13 potential cases. No equivalent replacement or fresh execution is claimed. Lose the complete completed-worker-retirement-resume suite: exact terminal-close resume-record revocation, PTY-exit recovery retention and settled-worker release examples. Remove its exact command token or standalone command, testFiles entry and assertionRef, archiving complete prior fields. Independent receipts retain original scopes. Audit2003: Remove3 preexisting unsupported320-live-PTY,400-retirement/256-history and replacement-lifecycle aliases from the inventory driver: neither its frozen original imported registrars nor proposed candidate owns those callbacks. This metadata correction adds no test-removal credit. The driver loses the empty-worktree-publication suite and3 folder-host/unverifiable scalar examples while retaining concurrent inventory freshness and provider-failure verdict fences. The retained inventory callbacks are not terminal-release, historical-cache capacity or performance-budget replacement coverage. Preserve the independent compiled-CLI Electron receipt exactly. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Remove unsupported user-taken-over, transferred-owner, exact-reuse, host-scope, immutable-transcript, legacy-ambiguity, reset and50-worker aliases from their claimed sources. Remove the deleted pending-release ledger replay alias. Narrow surviving external-retention and recovery aliases to actual retained callbacks; no transfer to another file or process-restart proof. Preserve the independent receipt. 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): Audit1959 (sources 1955:34): Pruning removes unsupported-provider/out-of-range scalar refusals and the single Grok happy decoder fixture. Retain actual file cursor append/paging, same-inode checkpoint invalidation, opaque IDs and oversized-line progress. Retire the complete dated 3.48s combined receipt through its effective currentCommand, without changing its original command or transferring its 56-test result. Unchanged CLI/Electron receipt retains its independent scope. No historical passed receipt is narrowed or transferred to changed source bytes. No fresh execution, equivalent replacement, physical provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed by this metadata packet. Historical prior account (preserved verbatim): Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Surviving unchanged-source receipts are the current oracle; changed-source assertions await validation. Historical oracle account: Record release intent for a settled owner, attempt exact reuse before close, and require worker-start to fail with terminal_release_in_progress while the terminal stays open; then release the original owner exactly once. Race retain against a controlled archive promise and require no committed archive or close. Rebase a closed web-terminal host partition without terminalLayoutsByTabId and require the persistence write to complete while preserving host-authoritative membership; replay a valid legacy retirement under the same omission and require exact membership removal plus revision advancement. For retained external, user-owned, transferred, stopped, and abandoned resources, run one fresh inventory against the exact local/WSL or SSH provider: an exact live incarnation and every unknown inventory shape stay retained, while positive absence atomically sets ownership_state and release_state to released with processAction none and zero closeTerminal calls. Change host or process identity and inject duplicate resource evidence to require retention. Freeze a structured transcript, delete its source file, and require archived worker-read to return the same bounded redacted messages. Restart a pending mutation, reset orchestration state, and create 50 resources while asserting replay convergence, zero orphan rows, two-query worker listing, and no unrelated close.", "commands": [ - "ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/methods/orchestration/worker/release/worker-release-mobile-report.test.ts src/main/runtime/terminal/identity/orca-runtime-terminal-handle-incarnation.test.ts", + "ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/terminal/identity/orca-runtime-terminal-handle-incarnation.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/terminal/query/runtime-terminal-inventory-contracts.test.ts src/main/runtime/terminal/surface/mobile-session-terminal-persistence-retirement.test.ts src/main/runtime/rpc/methods/orchestration/worker/release/worker-release.test.ts src/main/runtime/rpc/methods/orchestration/worker/release/worker-release-recovery.test.ts src/main/runtime/rpc/orchestration/mutations/orchestration-mutation-ledger.test.ts src/main/runtime/orchestration/workers/transcripts/worker-transcript-read.test.ts --reporter=dot", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/terminal/surface/mobile-session-terminal-persistence-retirement.test.ts src/main/runtime/rpc/methods/orchestration/worker/release/worker-release.test.ts src/main/runtime/rpc/methods/orchestration/worker/release/worker-release-recovery.test.ts src/main/runtime/rpc/orchestration/mutations/orchestration-mutation-ledger.test.ts src/main/runtime/orchestration/workers/transcripts/worker-transcript-read.test.ts --reporter=dot", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/methods/orchestration/worker/release/worker-release.test.ts src/main/runtime/rpc/methods/orchestration/worker/release/worker-release-recovery.test.ts src/main/runtime/rpc/orchestration/mutations/orchestration-mutation-ledger.test.ts src/main/runtime/orchestration/workers/transcripts/worker-transcript-read.test.ts --reporter=dot", @@ -10505,7 +10478,6 @@ "pnpm run build:cli && SKIP_BUILD=1 pnpm exec playwright test tests/e2e/orchestration-worker-settlement-release-cli.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1" ], "testFiles": [ - "src/main/runtime/rpc/methods/orchestration/worker/release/worker-release-mobile-report.test.ts", "src/main/runtime/terminal/query/runtime-terminal-inventory-contracts.test.ts", "src/main/runtime/terminal/surface/mobile-session-terminal-persistence-retirement.test.ts", "src/main/runtime/rpc/methods/orchestration/worker/release/worker-release.test.ts", @@ -10599,7 +10571,8 @@ "Audit3437 complete prior commands before completed-worker-retirement-resume retirement: [\"ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/methods/orchestration/worker/worker-release-mobile-report.test.ts src/main/runtime/terminal/identity/orca-runtime-terminal-handle-incarnation.test.ts\",\"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/terminal/query/runtime-terminal-inventory-contracts.test.ts src/main/runtime/terminal/surface/mobile-session-terminal-persistence-retirement.test.ts src/main/runtime/rpc/methods/orchestration/worker/worker-release.test.ts src/main/runtime/rpc/methods/orchestration/worker/worker-release-recovery.test.ts src/main/runtime/rpc/orchestration-mutation-ledger.test.ts src/main/runtime/orchestration/workers/transcripts/worker-transcript-read.test.ts --reporter=dot\",\"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/terminal/surface/mobile-session-terminal-persistence-retirement.test.ts src/main/runtime/rpc/methods/orchestration/worker/worker-release.test.ts src/main/runtime/rpc/methods/orchestration/worker/worker-release-recovery.test.ts src/main/runtime/rpc/orchestration-mutation-ledger.test.ts src/main/runtime/orchestration/workers/transcripts/worker-transcript-read.test.ts --reporter=dot\",\"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/methods/orchestration/worker/worker-release.test.ts src/main/runtime/rpc/methods/orchestration/worker/worker-release-recovery.test.ts src/main/runtime/rpc/orchestration-mutation-ledger.test.ts src/main/runtime/orchestration/workers/transcripts/worker-transcript-read.test.ts --reporter=dot\",\"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/methods/orchestration/worker/worker-release.test.ts src/main/runtime/rpc/methods/orchestration/worker/worker-release-recovery.test.ts src/main/runtime/rpc/orchestration-mutation-ledger.test.ts src/main/runtime/orchestration/workers/transcripts/worker-transcript-read.test.ts --reporter=dot\",\"pnpm exec vitest run --config config/vitest.config.ts tests/e2e/completed-worker-retirement-resume.unit.test.ts --reporter=verbose\",\"pnpm run build:cli && SKIP_BUILD=1 pnpm exec playwright test tests/e2e/orchestration-worker-settlement-release-cli.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1\"]", "Audit3437 complete prior testFiles before completed-worker-retirement-resume retirement: [\"src/main/runtime/rpc/methods/orchestration/worker/worker-release-mobile-report.test.ts\",\"src/main/runtime/terminal/query/runtime-terminal-inventory-contracts.test.ts\",\"src/main/runtime/terminal/surface/mobile-session-terminal-persistence-retirement.test.ts\",\"src/main/runtime/rpc/methods/orchestration/worker/worker-release.test.ts\",\"src/main/runtime/rpc/methods/orchestration/worker/worker-release-recovery.test.ts\",\"src/main/runtime/rpc/orchestration-mutation-ledger.test.ts\",\"src/main/runtime/orchestration/workers/transcripts/worker-transcript-read.test.ts\",\"tests/e2e/completed-worker-retirement-resume.unit.test.ts\",\"tests/e2e/orchestration-worker-settlement-release-cli.spec.ts\"]", "Audit3437 complete prior assertionRefs before completed-worker-retirement-resume retirement: [{\"file\":\"src/main/runtime/terminal/surface/mobile-session-terminal-persistence-retirement.test.ts\",\"assertions\":[\"rebases a host partition that no longer carries the closed web-terminal layout\",\"replays a legacy retirement when its host partition omits terminal layouts\"]},{\"file\":\"tests/e2e/completed-worker-retirement-resume.unit.test.ts\",\"assertions\":[\"an already-exited succeeded Dispatch reaches released while its late exact close revokes the missing tab's stale resume record\"]},{\"file\":\"src/main/runtime/rpc/methods/orchestration/worker/worker-release.test.ts\",\"assertions\":[\"retains a dead external terminal without closing a process\",\"releases a dead stopped or abandoned worker without closing a process\",\"lets an explicit retain cancel a release while output capture is pending\"]},{\"file\":\"src/main/runtime/rpc/methods/orchestration/worker/worker-release-recovery.test.ts\",\"assertions\":[\"finishes a requested release after restart-style interruption within the same runtime and database\",\"coalesces reconciliation joining an interactive release into one recorded recovery attempt and one terminal close\"]},{\"file\":\"tests/e2e/orchestration-worker-settlement-release-cli.spec.ts\",\"assertions\":[\"compiled worker-release reconciles a dead external retained resource to released\",\"the CLI reports processAction none instead of closing a process\",\"SQLite independently records released ownership and release state\",\"the unrelated coordinator terminal remains live\"]}]", - "Audit3899 intentionally removes the seeded accepted-worker-start receipt callback from the retained orchestration mutation-ledger test suite, without equivalent replacement. It used an in-memory database and no restart or actual worker launch. The lost alarm is operation_unknown with accepted Dispatch recovery guidance and no second handler invocation. The separate independent-database pending-ask recovery callback remains byte-identical. Existing selectors remain executable but reduced source bytes have no fresh execution in this static audit; the complete dated worker-release CLI receipt retains its original unchanged scope and does not validate these reduced ledger bytes." + "Audit3899 intentionally removes the seeded accepted-worker-start receipt callback from the retained orchestration mutation-ledger test suite, without equivalent replacement. It used an in-memory database and no restart or actual worker launch. The lost alarm is operation_unknown with accepted Dispatch recovery guidance and no second handler invocation. The separate independent-database pending-ask recovery callback remains byte-identical. Existing selectors remain executable but reduced source bytes have no fresh execution in this static audit; the complete dated worker-release CLI receipt retains its original unchanged scope and does not validate these reduced ledger bytes.", + "Audit5912 deletes the entire worker-release-mobile-report suite. Fake worker Keep open/report/release alarms are intentionally lost; its compound command is narrowed to the surviving incarnation suite and its testFiles entry removed. The unchanged compiled-CLI receipt retains only its original scope; no equivalent replacement or fresh whole-gate pass is claimed. " ], "demotionRule": "Keep experimental or demote if release can overlap exact reuse, close a conflicting lease, lose immutable output, retain reset archives, fan out per worker, or any focused ordering test flakes without a product or harness defect." }, diff --git a/config/scripts/ci/sharding/ci-shard-timings.json b/config/scripts/ci/sharding/ci-shard-timings.json index 1c68b98716d..53af3253407 100644 --- a/config/scripts/ci/sharding/ci-shard-timings.json +++ b/config/scripts/ci/sharding/ci-shard-timings.json @@ -77,7 +77,6 @@ "config/scripts/preflight/changed-checks/lint-staged-worktree-backup.test.mjs": 278, "config/scripts/localization/source-extraction/localization-extraction-call-syntax.test.mjs": 317, "config/scripts/localization/extraction-policy/localization-extraction-change-scope.test.mjs": 732, - "config/scripts/performance/macos-computer-owner/macos-computer-helper-owner-loss-processes.test.mjs": 52, "config/scripts/desktop-distribution/macos/macos-folder-usage-descriptions.test.mjs": 147, "config/scripts/desktop-distribution/macos/macos-shipit-scheduling.test.mjs": 38, "config/scripts/macos/terminal-host-bundle/macos-terminal-host-bundle.test.mjs": 182, @@ -88,30 +87,23 @@ "config/scripts/mobile-web-app/shell/mobile-web-app-agent-icon-render.test.mjs": 591, "config/scripts/mobile-web-app/shell/mobile-web-app-browser-pane-render.test.mjs": 239, "config/scripts/mobile-web-app/shell/mobile-web-app-clipboard-image-resize-render.test.mjs": 422, - "config/scripts/mobile-web-app/shell/mobile-web-app-composer-sizing-render.test.mjs": 252, - "config/scripts/mobile-web-app/shell/mobile-web-app-drawer-render.test.mjs": 253, "config/scripts/mobile-web-app/workspace/mobile-web-app-files-external-links.test.mjs": 126, "config/scripts/mobile-web-app/workspace/mobile-web-app-files-render.test.mjs": 214, "config/scripts/mobile-web-app/shell/mobile-web-app-frame-budget-sweep.test.ts": 210, - "config/scripts/mobile-web-app/shell/mobile-web-app-handoff-grants-render.test.mjs": 258, "config/scripts/mobile-web-app/shell/mobile-web-app-held-press-render.test.mjs": 570, "config/scripts/mobile-web-app/session/mobile-web-app-mermaid-render.test.mjs": 498, "config/scripts/mobile-web-app/routing/mobile-web-app-module-closure-entrypoints.test.mjs": 109, "config/scripts/mobile-web-app/session/mobile-web-app-native-chat-visual-links.test.mjs": 220, - "config/scripts/mobile-web-app/shell/mobile-web-app-native-parity-render.test.mjs": 253, "config/scripts/mobile-web-app/routing/mobile-web-app-page-closure-families.test.mjs": 71, "config/scripts/mobile-web-app/routing/mobile-web-app-page-grant-call-sites.test.mjs": 164, "config/scripts/mobile-web-app/routing/mobile-web-app-push-subsystem-closure.test.mjs": 57, "config/scripts/mobile-web-app/shell/mobile-web-app-render.test.mjs": 254, "config/scripts/mobile-web-app/session/mobile-web-app-rich-markdown-render.test.mjs": 356, - "config/scripts/mobile-web-app/shell/mobile-web-app-safe-area-render.test.mjs": 314, "config/scripts/mobile-web-app/session/mobile-web-app-screencast-lane-grant.test.mjs": 70, "config/scripts/mobile-web-app/session/mobile-web-app-session-dictation-capture.test.mjs": 123, "config/scripts/mobile-web-app/session/mobile-web-app-session-external-links.test.mjs": 142, "config/scripts/mobile-web-app/session/mobile-web-app-session-media-picker.test.mjs": 164, - "config/scripts/mobile-web-app/session/mobile-web-app-session-render.test.mjs": 327, "config/scripts/mobile-web-app/terminal/mobile-web-app-session-terminal-closure.test.mjs": 63, - "config/scripts/mobile-web-app/terminal/mobile-web-app-session-terminal-init.test.mjs": 221, "config/scripts/mobile-web-app/session/mobile-web-app-session-webview-consumers.test.mjs": 55, "config/scripts/mobile-web-app/workspace/mobile-web-app-source-control-external-links.test.mjs": 125, "config/scripts/mobile-web-app/workspace/mobile-web-app-source-control-keyboard.test.mjs": 59, @@ -126,8 +118,6 @@ "config/scripts/mobile-web-app/shell/mobile-web-app-text-input-discovery.test.mjs": 113, "config/scripts/mobile-web-app/shell/mobile-web-app-working-spinner-render.test.mjs": 232, "config/scripts/mobile-web-app/preview/mobile-web-app-html-preview-render.test.mjs": 333, - "config/scripts/mobile-web-app/preview/mobile-web-app-media-preview-render.test.mjs": 196, - "config/scripts/mobile-web-app/preview/mobile-web-app-svg-preview-render.test.mjs": 340, "config/scripts/build/mobile-web-app/mobile-web-bundle-manifest.test.mjs": 126, "config/scripts/build/mobile-web-app/mobile-web-bundle-serializer-parity.test.mjs": 112, "config/scripts/build/mobile-web-app/mobile-web-page-routes.test.mjs": 129, @@ -793,7 +783,6 @@ "src/main/claude-accounts/profiles/wsl/claude-profile-wsl-router.test.ts": 919, "src/main/claude-accounts/sign-in/claude-sign-in-browser.test.ts": 314, "src/main/claude-accounts/runtime-auth/keychain-config-directory-aliases.test.ts": 51, - "src/main/claude-usage/claude-usage-report-aggregation.test.ts": 57, "src/main/claude-usage/persisted-source-authority.test.ts": 491, "src/main/claude-usage/scanner-long-context.test.ts": 186, "src/main/claude-usage/scanner-scan.test.ts": 295, @@ -972,7 +961,6 @@ "src/main/codex/hooks/reconciliation/codex-real-home-hook-entries.test.ts": 543, "src/main/codex/hooks/definitions/codex-real-home-hook-key-spellings.test.ts": 408, "src/main/codex/hooks/reconciliation/codex-real-home-hook-removal.test.ts": 388, - "src/main/codex/configuration/homes/codex-real-home-path.test.ts": 76, "src/main/codex/history/backfill/codex-session-backfill.test.ts": 310, "src/main/codex/history/bridges/codex-session-bridge.test.ts": 118, "src/main/codex/history/index/codex-session-index-heal.test.ts": 2722, @@ -1579,7 +1567,6 @@ "src/main/ipc/pty/pty-controller-ownership-routing.test.ts": 4067, "src/main/ipc/pty/pty-controller-spawn-admission.test.ts": 4904, "src/main/ipc/pty/pty-daemon-spawn-session-identity.test.ts": 5120, - "src/main/ipc/pty/pty-management-async-io-health.test.ts": 423, "src/main/ipc/pty/pty-pane-reservation-settlement.test.ts": 4089, "src/main/ipc/pty/pty-pane-restart-replace.test.ts": 4301, "src/main/ipc/pty/pty-runtime-kill-and-exit.test.ts": 4173, @@ -1716,7 +1703,6 @@ "src/main/managed-server/install/orcad-remote-decommission.test.ts": 434, "src/main/managed-server/install/orcad-remote-launch-file-modes.test.ts": 400, "src/main/managed-server/install/orcad-remote-launch-setsid.test.ts": 342, - "src/main/managed-server/install/orcad-remote-launch.test.ts": 319, "src/main/managed-server/install/orcad-remote-node-runtime.test.ts": 248, "src/main/managed-server/install/orcad-remote-readiness-wait.test.ts": 9063, "src/main/managed-server/install/orcad-remote-runtime.test.ts": 488, @@ -1769,7 +1755,6 @@ "src/main/native-chat/agent-session-timeline/provider-timeline-assembler-restart.test.ts": 576, "src/main/native-chat/agent-session-timeline/provider-timeline-assembler-streams.test.ts": 757, "src/main/native-chat/agent-session-timeline/provider-timeline-assembler-turns.test.ts": 809, - "src/main/native-chat/agent-session-timeline/provider-timeline-identity.test.ts": 52, "src/main/native-chat/agent-session-wire/observations/testing/agent-session-current-requests.test.ts": 271, "src/main/native-chat/agent-session-wire/publication/subscribers/testing/agent-session-delta-coalescer.test.ts": 61, "src/main/native-chat/agent-session-wire/publication/history/testing/agent-session-history-byte-limits.test.ts": 858, @@ -2034,7 +2019,6 @@ "src/main/persistence/tracking-repos/repo-update-host-guard.test.ts": 478, "src/main/persistence/tracking-repos/worktree-identity-migration-field-coverage.test.ts": 505, "src/main/persistence/window-save-sleep-records.test.ts": 60, - "src/main/pi/managed-extensions/agent-status/agent-status-extension-nested-run-settlement.test.ts": 335, "src/main/pi/managed-extensions/agent-status/agent-status-extension-session-change.test.ts": 613, "src/main/pi/managed-extensions/agent-status/agent-status-input-redaction.test.ts": 573, "src/main/pi/managed-extensions/agent-status/omp-model-command-source.test.ts": 640, @@ -2279,7 +2263,6 @@ "src/main/runtime/session-graph/graph-sync-deletion-fence.test.ts": 4552, "src/main/runtime/session-tabs/graph-sync-mobile-snapshot-gating.test.ts": 4333, "src/main/runtime/terminal/surface/headless-create-terminal-handle-main.test.ts": 3873, - "src/main/runtime/terminal/output/headless-terminal-dispose-write-ordering.test.ts": 4309, "src/main/runtime/terminal/recovery/held-pane-reopen-layout-owner.test.ts": 5093, "src/main/runtime/terminal/wait/hermes-slash-readiness-transcript.test.ts": 4931, "src/main/runtime/terminal/surface/host-pane-remount-terminal-handle.test.ts": 5293, @@ -2298,7 +2281,6 @@ "src/main/runtime/mobile-cloud-relay/control-channel/relay-control-client.test.ts": 701, "src/main/runtime/mobile-cloud-relay/relay-control-origin.test.ts": 147, "src/main/runtime/mobile-cloud-relay/control-channel/relay-host-proof.test.ts": 122, - "src/main/runtime/mobile-cloud-relay/director/relay-http-client.test.ts": 175, "src/main/runtime/mobile-cloud-relay/pairing/relay-revoke-outbox.test.ts": 73, "src/main/runtime/mobile-cloud-relay/relay-session-broker.test.ts": 804, "src/main/runtime/mobile-desktop-relay/mobile-desktop-relay.integration.test.ts": 11377, @@ -2307,7 +2289,6 @@ "src/main/runtime/mobile-desktop-relay/mobile-relay-host-catalog.test.ts": 430, "src/main/runtime/mobile-desktop-relay/on-demand-server-worktree-rows.test.ts": 383, "src/main/runtime/mobile-desktop-relay/relayed-phone-frames.test.ts": 1022, - "src/main/runtime/push/notifications/mobile-notification-dismissal-read-failure.test.ts": 181, "src/main/runtime/push/notifications/mobile-notification-dismissal-store.test.ts": 214, "src/main/runtime/rpc/server/pairing/mobile-pairing-userdata-path.test.ts": 171, "src/main/runtime/terminal/layout/mobile-presence-lock.test.ts": 25928, @@ -2402,12 +2383,10 @@ "src/main/runtime/orchestration/db/schema/dispatch-consumer-generation-migration.test.ts": 640, "src/main/runtime/orchestration/db/dispatch-context/dispatch-failure-idempotency.test.ts": 544, "src/main/runtime/orchestration/federation/synchronization/federation-acknowledgment-integrity.test.ts": 557, - "src/main/runtime/orchestration/db/federation/federation-acknowledgment-migration.test.ts": 566, "src/main/runtime/orchestration/federation/synchronization/federation-sync.test.ts": 5264, "src/main/runtime/orchestration/workers/lifecycle/lifecycle-caller-edges.test.ts": 522, "src/main/runtime/orchestration/workers/lifecycle/lifecycle-reconciliation.test.ts": 884, "src/main/runtime/orchestration/workers/reports/lightweight-run-worker-exit-escalation.test.ts": 5194, - "src/main/runtime/orchestration/db/messages/mailbox-pointer-release-query.test.ts": 658, "src/main/runtime/orchestration/mailbox/terminal-pointer/mailbox-pointer-stage.test.ts": 739, "src/main/runtime/orchestration/mailbox/terminal-pointer/mailbox-pointer-submit.test.ts": 1513, "src/main/runtime/orchestration/db/messages/message-batch-atomicity.test.ts": 639, @@ -2576,7 +2555,6 @@ "src/main/runtime/rpc/methods/orchestration/worker/output/worker-output.test.ts": 541, "src/main/runtime/rpc/methods/orchestration/worker/release/worker-release-authority-contracts.test.ts": 3949, "src/main/runtime/rpc/methods/orchestration/worker/release/worker-release-evidence-contracts.test.ts": 4491, - "src/main/runtime/rpc/methods/orchestration/worker/release/worker-release-mobile-report.test.ts": 4562, "src/main/runtime/rpc/methods/orchestration/worker/release/worker-release-recovery.test.ts": 5889, "src/main/runtime/rpc/methods/orchestration/worker/release/worker-release.test.ts": 4766, "src/main/runtime/rpc/methods/orchestration/worker/worker-start-budgets.test.ts": 45, @@ -2622,7 +2600,6 @@ "src/main/runtime/rpc/methods/workspace-layout/workspace-layout-apply.test.ts": 5949, "src/main/runtime/rpc/methods/workspace-layout/workspace-layout.test.ts": 3391, "src/main/runtime/rpc/methods/workspaces/worktree-catalog-snapshot-method.test.ts": 1590, - "src/main/runtime/rpc/methods/workspaces/worktree-runtime-routing.test.ts": 1735, "src/main/runtime/rpc/methods/workspaces/worktree.test.ts": 1645, "src/main/runtime/rpc/mobile-clipboard-image-provenance.test.ts": 52, "src/main/runtime/rpc/mobile-e2ee-outbound-memory-budget.test.ts": 61, @@ -2740,7 +2717,6 @@ "src/main/runtime/workspaces/creation/runtime-provisioned-root-adoption.test.ts": 537, "src/main/runtime/workspaces/references/runtime-reference-agents.test.ts": 207, "src/main/runtime/workspaces/references/runtime-reference-find.test.ts": 245, - "src/main/runtime/repositories/runtime-repo-update-worktree-refresh.test.ts": 4375, "src/main/runtime/repositories/runtime-repository-clone-host-dedupe.test.ts": 874, "src/main/runtime/repositories/runtime-repository-registration-controller.test.ts": 742, "src/main/runtime/rpc/server/runtime-rpc-browser-host-admission.test.ts": 4402, @@ -2793,7 +2769,6 @@ "src/main/runtime/sidebar-inputs/workspace-rows/paired-server-rows-producer.test.ts": 340, "src/main/runtime/sidebar-inputs/repo-icons/repo-icon-data-urls.test.ts": 250, "src/main/runtime/sidebar-inputs/repo-icon-remote-fetch.test.ts": 101, - "src/main/runtime/sidebar-inputs/sidebar-clock.test.ts": 45, "src/main/runtime/sidebar-inputs/sidebar-inputs-feed-announcements.test.ts": 1954, "src/main/runtime/sidebar-inputs/sidebar-inputs-feed-domains.test.ts": 496, "src/main/runtime/sidebar-inputs/feed/sidebar-inputs-feed-pages.test.ts": 162, @@ -2805,7 +2780,6 @@ "src/main/runtime/sidebar-inputs/workspace-rows/workspace-rows-producer.test.ts": 4181, "src/main/runtime/sidebar-inputs/temporal/workspace-viewers.test.ts": 65, "src/main/runtime/terminal/output/stale-title-display-surfaces.test.ts": 4456, - "src/main/runtime/agent-session/lifecycle/structured-agent-cli-writers.test.ts": 140, "src/main/runtime/agent-session/lifecycle/structured-agent-session-history-close-race.test.ts": 5020, "src/main/runtime/agent-session/naming/structured-agent-session-provider-naming-shutdown.test.ts": 1987, "src/main/runtime/agent-session/environment/structured-agent-shell-environment-catalog.test.ts": 720, @@ -3039,7 +3013,6 @@ "src/main/star-nag/service-threshold-prompt.test.ts": 307, "src/main/startup/agent-hooks-uninstall-preflight-real-removers.test.ts": 597, "src/main/startup/codex-account-restart-resume.test.ts": 465, - "src/main/startup/configure-process-macports-path.test.ts": 159, "src/main/startup/configure-process.test.ts": 255, "src/main/startup/e2e-external-open-guard.test.ts": 44, "src/main/startup/first-window-startup-services.test.ts": 54, @@ -3114,7 +3087,6 @@ "src/main/updater/mac-install/shipit-leftover-recovery.test.ts": 136, "src/main/usage/reporting/token-usage/analytics-session-id-store.test.ts": 195, "src/main/usage/source-input/jsonl/jsonl-file-reader.test.ts": 112, - "src/main/usage/rollups/usage-breakdown-scaling.test.ts": 84, "src/main/usage/cache/usage-source-cache-file.test.ts": 94, "src/main/warp-themes/index.test.ts": 678, "src/main/window/clipboard-agent-session-attachment-paste.test.ts": 585, @@ -3349,7 +3321,6 @@ "src/renderer/src/components/browser-pane/workspace-doc/HtmlDocPreview.toolbar.test.tsx": 4357, "src/renderer/src/components/browser-pane/workspace-doc/doc-preview-external-link-confirmation.test.ts": 1057, "src/renderer/src/components/browser-pane/workspace-doc/doc-preview-webview-attach.test.ts": 200, - "src/renderer/src/components/browser-pane/workspace-doc/use-doc-preview-guest-tools.test.ts": 439, "src/renderer/src/components/cmd-j/palette-focus-restore-target.test.ts": 186, "src/renderer/src/components/cmd-j/task-search-activation.test.ts": 1880, "src/renderer/src/components/confirmation-dialog.test.tsx": 1231, @@ -3600,7 +3571,6 @@ "src/renderer/src/components/native-chat/session/status/structured-chat-sleep-startup.test.tsx": 2285, "src/renderer/src/components/native-chat/attachments/chips/use-native-chat-composer-attachments.test.tsx": 2467, "src/renderer/src/components/native-chat/attachments/intake/use-native-chat-external-attachments.test.tsx": 797, - "src/renderer/src/components/native-chat/session/terminal/read/use-native-chat-live-session-pending.test.ts": 2063, "src/renderer/src/components/native-chat/session/terminal/read/use-native-chat-live-session-visibility.test.ts": 2047, "src/renderer/src/components/native-chat/session/terminal/read/use-native-chat-live-session.test.ts": 2218, "src/renderer/src/components/native-chat/composer/pickers/use-native-chat-mention-files.test.tsx": 2162, @@ -3633,7 +3603,6 @@ "src/renderer/src/components/pull-request-page/page/use-details.test.tsx": 745, "src/renderer/src/components/quick-open-file-list-host-name-filter.react.test.tsx": 1941, "src/renderer/src/components/quick-open-file-list.test.ts": 54, - "src/renderer/src/components/right-sidebar/ai-vault/session-list/AiVaultSessionVirtualList.measurement.test.tsx": 3117, "src/renderer/src/components/right-sidebar/FolderWorkspaceWorktreesPanel.test.tsx": 461, "src/renderer/src/components/right-sidebar/plugin-panels/PluginPanel.test.tsx": 2710, "src/renderer/src/components/right-sidebar/PortsPanel.test.tsx": 1618, @@ -3703,7 +3672,6 @@ "src/renderer/src/components/sidebar/CommentMarkdown.unknown-html.test.tsx": 3140, "src/renderer/src/components/sidebar/CommentMarkdown.word-fade.test.tsx": 2113, "src/renderer/src/components/sidebar/HostRemoveDialog.test.tsx": 6650, - "src/renderer/src/components/sidebar/host-path-browser/RemoteFileBrowser.keyboard.test.tsx": 825, "src/renderer/src/components/sidebar/Sidebar.test.tsx": 833, "src/renderer/src/components/sidebar/SidebarAgentsList.test.tsx": 2985, "src/renderer/src/components/sidebar/workspace-card/surface/WorktreeCard.single-reference-details.test.tsx": 2032, @@ -3970,7 +3938,6 @@ "src/renderer/src/hooks/ipc-events/agent-status-terminal-title-tab-write.test.ts": 2247, "src/renderer/src/hooks/ipc-events/browser-request-ipc-bridge.owner.test.ts": 623, "src/renderer/src/hooks/ipc-events/browser-state-open-link-profile.test.ts": 934, - "src/renderer/src/hooks/ipc-events/mobile-terminal-close-ipc-bridge-reveal.test.ts": 1764, "src/renderer/src/hooks/ipc-events/mobile-terminal-close-ipc-bridge.test.ts": 2200, "src/renderer/src/hooks/ipc-events/quit-and-stop-all-sessions-ipc-bridge.test.ts": 398, "src/renderer/src/hooks/ipc-events/runtime-client-ipc-bridge-ownership.test.ts": 2068, @@ -4043,7 +4010,6 @@ "src/renderer/src/lib/automation-terminal-ownership.test.ts": 1795, "src/renderer/src/lib/browser/navigation/browser-link-open.test.ts": 2215, "src/renderer/src/lib/browser/navigation/browser-link-profile-isolation.test.ts": 2511, - "src/renderer/src/lib/browser/palette/browser-palette-page-entries.test.ts": 480, "src/renderer/src/lib/skills/runtime/bundled-skill-target.test.ts": 54, "src/renderer/src/lib/source-control/checks/check-run-details-log-normalization-performance.test.ts": 846, "src/renderer/src/lib/source-control/checks/check-run-details-log-normalization.test.ts": 75, @@ -4059,7 +4025,6 @@ "src/renderer/src/lib/agent-session/launch/background/launch-agent-background-session-launch-parity.test.ts": 2792, "src/renderer/src/lib/agent-session/launch/background/launch-agent-background-session.test.ts": 1040, "src/renderer/src/lib/agent-session/launch/new-tab/launch-agent-new-tab-host-route-readiness.test.ts": 489, - "src/renderer/src/lib/agent-session/launch/continuation/launch-agent-session-continuation-toast.test.tsx": 2347, "src/renderer/src/lib/workspace/creation/work-item/launch-work-item-direct-defaults.test.ts": 1594, "src/renderer/src/lib/work-items/linear/linear-issue-workspace-attachment.test.ts": 99, "src/renderer/src/lib/work-items/linked-work-item-context.test.ts": 64, @@ -4112,7 +4077,6 @@ "src/renderer/src/lib/workspace/activation/worktree-reactivation-preserved-pane-replacement.test.ts": 2268, "src/renderer/src/lib/workspace/activation/worktree-reactivation-tab-forkbomb.test.ts": 4131, "src/renderer/src/lib/workspace/ownership/worktree-runtime-owner.test.ts": 380, - "src/renderer/src/lib/workspace/persistence/wsl-move-renderer-store-rewrites.test.ts": 1072, "src/renderer/src/runtime/rpc/calls/abortable-runtime-environment-call.test.ts": 189, "src/renderer/src/runtime/web-session-tabs-sync/closing/close-mirrored-editor-tab.test.ts": 397, "src/renderer/src/runtime/files/mutations/file-explorer-delete-owner-provenance.test.ts": 1878, @@ -4154,7 +4118,6 @@ "src/renderer/src/runtime/web-session-tabs-sync/subscriptions/web-session-tabs-sync-visibility-collision.test.tsx": 2699, "src/renderer/src/runtime/web-session-tabs-sync/subscriptions/web-session-tabs-sync-window-visibility.test.tsx": 2589, "src/renderer/src/runtime/web-session-tabs-sync/subscriptions/web-session-tabs-sync-worktree-switch.test.tsx": 2625, - "src/renderer/src/runtime/web-session-tabs-sync/navigation/web-session-tabs-sync.test.ts": 1006, "src/renderer/src/runtime/hosted-terminals/recovery/web-session-terminal-orphan-mixed-version.test.ts": 923, "src/renderer/src/runtime/hosted-terminals/recovery/panes/web-session-terminal-pending-handle-recovery.test.ts": 723, "src/renderer/src/runtime/hosted-terminals/recovery/evidence/web-session-terminal-retirement-proof-ledger.test.ts": 685, @@ -4180,7 +4143,6 @@ "src/renderer/src/store/slices/agent-status/agent-status-row-order-origin.test.ts": 2205, "src/renderer/src/store/slices/agent-status/agent-status-ssh-connection-clear.test.ts": 1681, "src/renderer/src/store/slices/agent-status/agent-status.test.ts": 2129, - "src/renderer/src/store/repos/all-host-catalog-settlement.test.ts": 1955, "src/renderer/src/store/slices/browser/annotations/browser-annotation-retention.test.ts": 8178, "src/renderer/src/store/slices/browser/pages/browser-page-conversion.test.ts": 1777, "src/renderer/src/store/slices/browser/hosts/browser-session-host-selection.test.ts": 988, @@ -4232,7 +4194,6 @@ "src/renderer/src/store/slices/runtime-status/set-runtime-environments-purge-wiring.test.ts": 1683, "src/renderer/src/store/slices/settings/settings-terminal-quick-commands.test.ts": 1734, "src/renderer/src/store/terminals/store-create-tab-start-in-main.test.ts": 1801, - "src/renderer/src/store/slices/tabs/store-open-to-side-layout-owner.test.ts": 1919, "src/renderer/src/store/terminals/store-sleep-exact-runtime-stop.test.ts": 1842, "src/renderer/src/store/terminals/store-sleep-pane-hibernation.test.ts": 1932, "src/renderer/src/store/slices/tabs/tabs-close-dangling-group.test.ts": 1849, @@ -4253,7 +4214,6 @@ "src/renderer/src/store/slices/worktrees/teardown/worktrees-always-force-delete.test.ts": 1611, "src/renderer/src/store/slices/worktrees/create/worktrees-create-captured-host.test.ts": 1148, "src/renderer/src/store/slices/worktrees/listing/worktrees-fetch-refresh-coalescing.test.ts": 1226, - "src/renderer/src/store/slices/worktrees/metadata/worktrees-fetch-remote-lineage.test.ts": 1221, "src/renderer/src/store/slices/worktrees/listing/worktrees-fetch-removal-purge.test.ts": 1207, "src/renderer/src/store/slices/worktrees/listing/worktrees-fetch-stale-catalog-version.test.ts": 1337, "src/renderer/src/store/slices/worktrees/metadata/worktrees-git-identity-branch-title.test.ts": 1181, @@ -4410,7 +4370,6 @@ "src/shared/claude-agent-view-launch.test.ts": 55, "src/shared/claude-background-run-isolation.test.ts": 43, "src/shared/agent-hook-listener/normalization/claude-background-task-status.test.ts": 315, - "src/shared/claude-shell-function.test.ts": 220, "src/shared/cloud-service-url.test.ts": 37, "src/shared/coalescing-keyed-runner.test.ts": 119, "src/shared/codebuddy-agent.test.ts": 301, @@ -4557,7 +4516,6 @@ "src/shared/node-bounded-file-reader-sync.test.ts": 56, "src/shared/node-bounded-file-reader-window.test.ts": 63, "src/shared/node-bounded-file-reader.test.ts": 67, - "src/shared/node-cli-command-async-resolution.test.ts": 77, "src/shared/node-readable-text.test.ts": 45, "src/shared/node-source-copy-content-equality.test.ts": 52, "src/shared/nvm-default-alias.test.ts": 81, @@ -4723,7 +4681,6 @@ "src/shared/sidebar-list/sidebar-inputs-feed-installer.test.ts": 100, "src/shared/sidebar-list/smart-sort.test.ts": 131, "src/shared/sleeping-record-legacy-pane-key.test.ts": 59, - "src/shared/source-control/listing/source-control-discard-all-sequence.test.ts": 50, "src/shared/source-scan/source-tree-scan.test.ts": 50, "src/shared/source-scan/source-tree-walk.test.ts": 62, "src/shared/ssh-pty-id.test.ts": 51, @@ -4781,7 +4738,6 @@ "src/shared/windows-command-line-budget.test.ts": 105, "src/shared/windows-interactive-login-spawn.test.ts": 54, "src/shared/windows-private-credential-file.test.ts": 77, - "src/shared/windows-secure-dacl.test.ts": 65, "src/shared/windows-security-addon.win32.test.ts": 73, "src/shared/windows-transient-lock-removal.test.ts": 198, "src/shared/worker-auto-close.test.ts": 60, @@ -4823,7 +4779,6 @@ "src/shared/workspace-layout/editor-tabs/workspace-layout-workspace-move.test.ts": 181, "src/shared/workspace-attachments/workspace-linked-item-source-context.test.ts": 65, "src/shared/workspace-attachments/workspace-reference-identity.test.ts": 82, - "src/shared/workspace-review-checks.test.ts": 82, "src/shared/workspace-session/workspace-session-salvage.test.ts": 930, "src/shared/workspace-session/workspace-session-schema.sleeping-agent.test.ts": 337, "src/shared/workspace-session/workspace-session-terminal-buffers.test.ts": 294, diff --git a/config/scripts/ci/unit-selection/dependency-graph/ci-unit-files.mjs b/config/scripts/ci/unit-selection/dependency-graph/ci-unit-files.mjs index 2c152231fda..741072253c8 100644 --- a/config/scripts/ci/unit-selection/dependency-graph/ci-unit-files.mjs +++ b/config/scripts/ci/unit-selection/dependency-graph/ci-unit-files.mjs @@ -43,7 +43,6 @@ export const UNIT_EXCLUDE = [ 'src/shared/shell/wsl/fish-wsl-cwd-report.node-pty.test.ts', 'src/main/wsl/filesystem/wsl-sh-cwd-report.node-pty.test.ts', 'src/shared/terminal/pty/ingress/pty-reply-echo-shapes.node-pty.test.ts', - 'src/shared/shell/launch/startup-shell-portability.live-shell.test.ts', 'src/shared/shell/command-resolution/posix-command-path-lookup.test.ts', 'tests/e2e/relay-region-correction.unit.test.ts', 'src/main/browser/cookies/browser-google-cookie-clear.electron.test.ts', diff --git a/config/scripts/mobile-web-app/preview/mobile-web-app-html-file-preview-render.test.mjs b/config/scripts/mobile-web-app/preview/mobile-web-app-html-file-preview-render.test.mjs deleted file mode 100644 index 79c6f18256e..00000000000 --- a/config/scripts/mobile-web-app/preview/mobile-web-app-html-file-preview-render.test.mjs +++ /dev/null @@ -1,148 +0,0 @@ -// An HTML file opened on the file-preview route must paint as a page, not as its source text (iOS P0). -// Full bundle, real route, shipped CSP and document headers; WebKit stands in for WKWebView. -import { mkdir, mkdtemp, rm } from 'node:fs/promises' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { afterAll, beforeAll, describe, expect, it } from 'vitest' -import { chromium, webkit } from 'playwright-core' -import { buildMobileWebAppBundle } from '../../build/mobile-web-app/build-mobile-web-app-bundle.mjs' -import { mobileWebAppDependenciesPresent } from '../mobile-web-app-bundle-dependencies.mjs' -import { - createBundleServer, - installShellDouble, - readBridgeFaultGrant, - readBridgeProtocolVersion, - readShellCsp, - readShellDocumentHeaders -} from './mobile-web-app-render-harness.mjs' -import { probePreviewPixel } from './mobile-web-app-preview-frame-readings.mjs' -import { MOBILE_WEB_PAGE_ROUTES } from '../../build/mobile-web-app/mobile-web-page-routes.mjs' - -const MARKER = 'ORCA_HTML_FILE_RENDERED' -const PAINT_RGB = '0,128,255' -const HTML = ` - - -

${MARKER}

- -` -const host = { id: 'html-host', name: 'HTML Host', endpoint: 'ws://html-test', lastConnected: 1 } -const pattern = '/h/[hostId]/files/preview/[worktreeId]' -const pathname = '/h/html-host/files/preview/folder-project' -const bundles = mobileWebAppDependenciesPresent() -const shots = process.env.ORCA_MOBILE_HTML_FILE_SHOTS_DIR -const browsers = {} -let scratch, server, origin, version, faultGrant - -beforeAll(async () => { - if (!bundles) { - return - } - scratch = await mkdtemp(join(tmpdir(), 'orca-mobile-html-file-render-')) - const built = await buildMobileWebAppBundle({ outDir: join(scratch, 'bundle') }) - const policy = await readShellCsp() - const documentHeaders = await readShellDocumentHeaders() - version = await readBridgeProtocolVersion() - faultGrant = await readBridgeFaultGrant() - const served = await createBundleServer({ - outDir: built.outDir, - cspHeader: policy, - documentHeaders - }) - server = served.server - origin = served.origin - const executablePath = process.env.ORCA_MOBILE_WEB_RENDER_BROWSER - browsers.chromium = await chromium.launch({ - headless: true, - ...(executablePath ? { executablePath } : {}) - }) - browsers.webkit = await webkit.launch({ headless: true }) - if (shots) { - await mkdir(shots, { recursive: true }) - } -}, 240_000) - -afterAll(async () => { - await browsers.chromium?.close() - await browsers.webkit?.close() - await new Promise((resolve) => (server ? server.close(resolve) : resolve())) - if (scratch) { - await rm(scratch, { recursive: true, force: true }) - } -}) - -async function openHtmlFile(browser, { line, truncated = false, editable = false } = {}) { - const context = await browser.newContext({ - viewport: { width: 390, height: 844 }, - hasTouch: true - }) - const page = await context.newPage() - const errors = [] - page.on('pageerror', (error) => errors.push(error.message)) - const route = MOBILE_WEB_PAGE_ROUTES.find((entry) => entry.pathname === pattern) - await page.addInitScript(installShellDouble, { - version, - sessionId: 'html-session', - buildId: 'html-build', - route: { - pathname, - params: { - relativePath: 'index.html', - name: 'index.html', - worktreeName: 'Folder project', - ...(line ? { line } : {}), - ...(editable - ? { source: 'terminalArtifact', absolutePath: '/tmp/index.html', grantId: 'html-grant' } - : {}) - } - }, - host, - storage: {}, - faultGrant, - grants: [faultGrant, ...route.grants, ...(route.optionalGrants ?? [])], - pageRoutes: [pattern], - replies: { - [editable ? 'files.readTerminalArtifact' : 'files.read']: { - content: HTML, - byteLength: HTML.length, - truncated - } - } - }) - await page.goto(`${origin}/`) - return { context, page, errors } -} - -/** Pixel near the frame's bottom: engines refuse DOM reads inside the opaque frame, but not screenshots. */ -async function framePixel(page) { - const box = await page.locator('iframe').boundingBox() - return await probePreviewPixel(page, { - x: box.x + box.width / 2, - y: box.y + box.height - 40, - width: 4, - height: 4 - }) -} - -for (const engine of ['chromium', 'webkit']) { - const describeRender = bundles ? describe : describe.skip - describeRender(`an HTML file on the file-preview route on ${engine}`, () => { - it('renders unsaved HTML edits and retains them when returning to Source', async () => { - const { context, page, errors } = await openHtmlFile(browsers[engine], { editable: true }) - await page.locator('iframe').waitFor({ timeout: 60_000 }) - await page.getByRole('tab', { name: 'View HTML source' }).click() - const editor = page.getByRole('textbox', { name: 'index.html editor' }) - await editor.fill( - 'Draft' - ) - await page.getByRole('tab', { name: 'Preview rendered HTML' }).click() - await expect.poll(() => framePixel(page), { timeout: 10_000 }).toBe('255,0,128') - await page.getByRole('tab', { name: 'View HTML source' }).click() - expect(await editor.inputValue()).toBe( - 'Draft' - ) - expect(errors).toEqual([]) - await context.close() - }, 90_000) - }) -} diff --git a/config/scripts/mobile-web-app/preview/mobile-web-app-media-preview-render.test.mjs b/config/scripts/mobile-web-app/preview/mobile-web-app-media-preview-render.test.mjs deleted file mode 100644 index 3254d2c5119..00000000000 --- a/config/scripts/mobile-web-app/preview/mobile-web-app-media-preview-render.test.mjs +++ /dev/null @@ -1,157 +0,0 @@ -import { mkdtemp, rm } from 'node:fs/promises' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { afterAll, beforeAll, describe, expect, it } from 'vitest' -import { chromium } from 'playwright-core' -import { buildMobileWebAppBundle } from '../../build/mobile-web-app/build-mobile-web-app-bundle.mjs' -import { mobileWebAppDependenciesPresent } from '../mobile-web-app-bundle-dependencies.mjs' -import { - createBundleServer, - installShellDouble, - readBridgeFaultGrant, - readBridgeProtocolVersion, - readShellCsp -} from './mobile-web-app-render-harness.mjs' -import { MOBILE_WEB_PAGE_ROUTES } from '../../build/mobile-web-app/mobile-web-page-routes.mjs' - -// Two gray VP9 frames generated with ffmpeg, without audio or user content. -const WEBM = - 'GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAH6EU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHWTbuMU6uEElTDZ1OsggEjTbuMU6uEHFO7a1OsggHk7AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmsCrXsYMPQkBNgIxMYXZmNjIuMy4xMDBXQYxMYXZmNjIuMy4xMDBEiYhAn0AAAAAAABZUrmvIrgEAAAAAAAA/14EBc8WIPYwl7RGcI1acgQAitZyDdW5kiIEAhoVWX1ZQOYOBASPjg4Q7msoA4JCwgSC6gSCagQJVsIRVuYEBElTDZ0B/c3OfY8CAZ8iZRaOHRU5DT0RFUkSHjExhdmY2Mi4zLjEwMHNz2mPAi2PFiD2MJe0RnCNWZ8ilRaOHRU5DT0RFUkSHmExhdmM2Mi4xMS4xMDAgbGlidnB4LXZwOWfIoUWjiERVUkFUSU9ORIeTMDA6MDA6MDIuMDAwMDAwMDAwAB9DtnW354EAo52BAACAgkmDQgAB8AH2ADgkHBhKAAAwYAAAItXAAKOTgQPoAIYAQJKcAFAAAANgAABDQBxTu2uRu4+zgQC3iveBAfGCAajwgQM=' -function wavFixture() { - const bytes = Buffer.alloc(44 + 8000 * 2 * 2) - bytes.write('RIFF') - bytes.writeUInt32LE(bytes.length - 8, 4) - bytes.write('WAVEfmt ', 8) - bytes.writeUInt32LE(16, 16) - bytes.writeUInt16LE(1, 20) - bytes.writeUInt16LE(1, 22) - bytes.writeUInt32LE(8000, 24) - bytes.writeUInt32LE(16000, 28) - bytes.writeUInt16LE(2, 32) - bytes.writeUInt16LE(16, 34) - bytes.write('data', 36) - bytes.writeUInt32LE(bytes.length - 44, 40) - return bytes -} -const host = { id: 'media-host', name: 'Media Host', endpoint: 'ws://media-test', lastConnected: 1 } -const pattern = '/h/[hostId]/files/preview/[worktreeId]' -const pathname = '/h/media-host/files/preview/folder-project' -const bundles = mobileWebAppDependenciesPresent() -let scratch, server, origin, browser, policy, version, faultGrant -beforeAll(async () => { - if (!bundles) { - return - } - scratch = await mkdtemp(join(tmpdir(), 'orca-mobile-media-render-')) - const built = await buildMobileWebAppBundle({ outDir: join(scratch, 'bundle') }) - policy = await readShellCsp() - version = await readBridgeProtocolVersion() - faultGrant = await readBridgeFaultGrant() - const served = await createBundleServer({ - outDir: built.outDir, - cspHeader: policy - }) - server = served.server - origin = served.origin - const executablePath = process.env.ORCA_MOBILE_WEB_RENDER_BROWSER - browser = await chromium.launch({ headless: true, ...(executablePath ? { executablePath } : {}) }) -}, 120_000) -afterAll(async () => { - await browser?.close() - await new Promise((resolve) => (server ? server.close(resolve) : resolve())) - if (scratch) { - await rm(scratch, { recursive: true, force: true }) - } -}) -async function openMedia(relativePath, bytes) { - const page = await browser.newPage({ viewport: { width: 390, height: 844 } }) - const errors = [] - page.on('pageerror', (error) => errors.push(error.message)) - const grants = MOBILE_WEB_PAGE_ROUTES.find((route) => route.pathname === pattern).grants - await page.addInitScript(installShellDouble, { - version, - sessionId: 'media-session', - buildId: 'media-build', - route: { - pathname, - params: { relativePath, name: relativePath, worktreeName: 'Folder project' } - }, - host, - storage: {}, - faultGrant, - grants: [faultGrant, ...grants], - pageRoutes: [pattern], - replies: { - 'files.stat': { size: bytes.length, isDirectory: false, mtime: 1 }, - 'files.readChunk': { - contentBase64: bytes.toString('base64'), - bytesRead: bytes.length, - eof: true - }, - 'files.read': { - content: 'Playback stopped after switching files', - byteLength: 43, - truncated: false - } - } - }) - await page.addInitScript(() => { - globalThis.__revokedMedia = [] - const revoke = URL.revokeObjectURL.bind(URL) - URL.revokeObjectURL = (uri) => { - globalThis.__revokedMedia.push(uri) - revoke(uri) - } - }) - await page.goto(`${origin}/`) - return { page, errors } -} -const describeRender = bundles ? describe : describe.skip -describeRender('mobile media under the shipped shell policy', () => { - it.each([ - ['music.wav', wavFixture(), 'audio'], - ['movie.webm', Buffer.from(WEBM, 'base64'), 'video'] - ])( - 'plays and seeks %s, then releases playback and its Blob on navigation', - async (name, bytes, tag) => { - const { page, errors } = await openMedia(name, bytes) - await page.waitForFunction((tag) => document.querySelector(tag)?.readyState >= 2, tag) - await page.evaluate(async (tag) => { - const media = document.querySelector(tag) - globalThis.__previousMedia = media - media.muted = true - media.currentTime = 1 - await media.play() - }, tag) - await page.waitForFunction((tag) => document.querySelector(tag).currentTime > 1, tag, { - timeout: 10_000 - }) - const playback = await page.evaluate((tag) => { - const media = document.querySelector(tag) - media.pause() - return { - duration: media.duration, - time: media.currentTime, - uri: media.currentSrc - } - }, tag) - expect(playback.duration).toBeCloseTo(2, 1) - expect(playback.time).toBeGreaterThan(1) - await page.evaluate((pathname) => { - history.pushState(null, '', `${pathname}?relativePath=README.md`) - dispatchEvent(new PopStateEvent('popstate')) - }, pathname) - await page.getByText('Playback stopped after switching files', { exact: true }).waitFor() - expect( - await page.evaluate(() => ({ - paused: globalThis.__previousMedia.paused, - src: globalThis.__previousMedia.getAttribute('src'), - revoked: globalThis.__revokedMedia - })) - ).toEqual({ paused: true, src: null, revoked: [playback.uri] }) - expect(errors).toEqual([]) - await page.close() - }, - 60_000 - ) -}) diff --git a/config/scripts/mobile-web-app/preview/mobile-web-app-svg-preview-render.test.mjs b/config/scripts/mobile-web-app/preview/mobile-web-app-svg-preview-render.test.mjs deleted file mode 100644 index 6da67b7a770..00000000000 --- a/config/scripts/mobile-web-app/preview/mobile-web-app-svg-preview-render.test.mjs +++ /dev/null @@ -1,139 +0,0 @@ -import { mkdir, mkdtemp, rm } from 'node:fs/promises' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { afterAll, beforeAll, describe, expect, it } from 'vitest' -import { chromium } from 'playwright-core' -import { buildMobileWebAppBundle } from '../../build/mobile-web-app/build-mobile-web-app-bundle.mjs' -import { mobileWebAppDependenciesPresent } from '../mobile-web-app-bundle-dependencies.mjs' -import { - createBundleServer, - installShellDouble, - readBridgeFaultGrant, - readBridgeProtocolVersion, - readShellCsp -} from './mobile-web-app-render-harness.mjs' -import { MOBILE_WEB_PAGE_ROUTES } from '../../build/mobile-web-app/mobile-web-page-routes.mjs' - -// viewBox only: browsers size this 300 x 60 unless the viewer reads the drawing's own extent. -const SVG = - '' -const host = { id: 'svg-host', name: 'SVG Host', endpoint: 'ws://svg-test', lastConnected: 1 } -const pattern = '/h/[hostId]/files/preview/[worktreeId]' -const pathname = '/h/svg-host/files/preview/folder-project' -const bundles = mobileWebAppDependenciesPresent() -const shots = process.env.ORCA_MOBILE_SVG_SHOTS_DIR -let scratch, server, origin, browser, policy, version, faultGrant -beforeAll(async () => { - if (!bundles) { - return - } - scratch = await mkdtemp(join(tmpdir(), 'orca-mobile-svg-render-')) - const built = await buildMobileWebAppBundle({ outDir: join(scratch, 'bundle') }) - policy = await readShellCsp() - version = await readBridgeProtocolVersion() - faultGrant = await readBridgeFaultGrant() - const served = await createBundleServer({ outDir: built.outDir, cspHeader: () => policy }) - server = served.server - origin = served.origin - const executablePath = process.env.ORCA_MOBILE_WEB_RENDER_BROWSER - browser = await chromium.launch({ headless: true, ...(executablePath ? { executablePath } : {}) }) - if (shots) { - await mkdir(shots, { recursive: true }) - } -}, 120_000) -afterAll(async () => { - await browser?.close() - await new Promise((resolve) => (server ? server.close(resolve) : resolve())) - if (scratch) { - await rm(scratch, { recursive: true, force: true }) - } -}) - -async function openSvg() { - const context = await browser.newContext({ - viewport: { width: 390, height: 844 }, - hasTouch: true - }) - const page = await context.newPage() - const errors = [] - page.on('pageerror', (error) => errors.push(error.message)) - const grants = MOBILE_WEB_PAGE_ROUTES.find((route) => route.pathname === pattern).grants - await page.addInitScript(installShellDouble, { - version, - sessionId: 'svg-session', - buildId: 'svg-build', - route: { - pathname, - params: { relativePath: 'logo.svg', name: 'logo.svg', worktreeName: 'Folder project' } - }, - host, - storage: {}, - faultGrant, - grants: [faultGrant, ...grants], - pageRoutes: [pattern], - replies: { 'files.read': { content: SVG, byteLength: SVG.length, truncated: false } } - }) - await page.goto(`${origin}/`) - return { context, page, errors } -} - -function drawing(page) { - return page.getByRole('img', { name: 'logo.svg drawing' }) -} - -async function touch(cdp, type, points) { - await cdp.send('Input.dispatchTouchEvent', { - type, - touchPoints: points.map(([x, y], id) => ({ x, y, id })) - }) -} - -const describeRender = bundles ? describe : describe.skip -describeRender('mobile SVG preview under the shipped shell policy', () => { - it('draws the SVG at its own aspect, pinches and double-taps to zoom, and keeps source', async () => { - const { context, page, errors } = await openSvg() - const img = drawing(page) - await page.waitForFunction( - () => document.querySelector('img[alt="logo.svg drawing"]')?.complete - ) - const fitted = await img.boundingBox() - // Fit fills the phone's width, so the 5:1 drawing is upscaled past the browser's 300 px guess. - expect(fitted.width).toBeGreaterThan(330) - expect(fitted.width / fitted.height).toBeCloseTo(5, 1) - expect( - await img.evaluate((element) => element.naturalWidth > 0 && element.naturalHeight > 0) - ).toBe(true) - if (shots) { - await page.screenshot({ path: join(shots, 'mobile-svg-fit.png') }) - } - - const cdp = await context.newCDPSession(page) - const y = fitted.y + fitted.height / 2 - const x = fitted.x + fitted.width / 2 - await touch(cdp, 'touchStart', [ - [x - 40, y], - [x + 40, y] - ]) - for (let step = 1; step <= 5; step++) { - await touch(cdp, 'touchMove', [ - [x - 40 - step * 20, y], - [x + 40 + step * 20, y] - ]) - } - await touch(cdp, 'touchEnd', []) - const pinched = await img.boundingBox() - expect(pinched.width).toBeGreaterThan(fitted.width * 2) - if (shots) { - await page.screenshot({ path: join(shots, 'mobile-svg-pinched.png') }) - } - - await page.touchscreen.tap(x, y) - await page.touchscreen.tap(x, y) - await expect.poll(async () => (await img.boundingBox()).width).toBeCloseTo(fitted.width, 0) - - await page.getByRole('tab', { name: 'View SVG source' }).click() - await page.getByText('viewBox="0 0 1200 240"', { exact: false }).waitFor() - expect(errors).toEqual([]) - await context.close() - }, 60_000) -}) diff --git a/config/scripts/mobile-web-app/session/mobile-web-app-session-render.test.mjs b/config/scripts/mobile-web-app/session/mobile-web-app-session-render.test.mjs deleted file mode 100644 index ea3838edbd9..00000000000 --- a/config/scripts/mobile-web-app/session/mobile-web-app-session-render.test.mjs +++ /dev/null @@ -1,175 +0,0 @@ -import { mkdtemp, rm } from 'node:fs/promises' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { afterAll, beforeAll, describe, expect, it } from 'vitest' -import { chromium } from 'playwright-core' -import { buildMobileWebAppBundle } from '../../build/mobile-web-app/build-mobile-web-app-bundle.mjs' -import { mobileWebAppDependenciesPresent } from '../mobile-web-app-bundle-dependencies.mjs' -import { MOBILE_WEB_PAGE_ROUTES } from '../../build/mobile-web-app/mobile-web-page-routes.mjs' -import { - createBundleServer, - installShellDouble, - readBridgeFaultGrant, - readBridgeProtocolVersion, - readShellCsp, - waitForRecordedRequests, - waitForPageFrames -} from '../preview/mobile-web-app-render-harness.mjs' - -const HOST_ROUTE = '/h/render-check-host' -const WORKTREE = 'wt-1' -const SESSION_ROUTE = `${HOST_ROUTE}/session/${WORKTREE}` -const SESSION_PATTERN = '/h/[hostId]/session/[worktreeId]' -const PAGE_ROUTE_PATTERNS = ['/h/[hostId]', SESSION_PATTERN] -const SHELL_SESSION_ID = 'session-render-session' -const SHELL_BUILD_ID = 'session-render-build' -const SHELL_HOST = { - id: 'render-check-host', - name: 'Render Check Host', - endpoint: 'ws://render-check', - lastConnected: 1 -} - -// Read grants from manifest so new route grants are exercised instead of silently omitted by copied fixture. -function sessionGrants() { - const declared = MOBILE_WEB_PAGE_ROUTES.find((route) => route.pathname === SESSION_PATTERN) - if (!declared) { - throw new Error(`${SESSION_PATTERN} is not registered`) - } - return declared.grants -} - -const bundles = mobileWebAppDependenciesPresent() -const describeRender = bundles ? describe : describe.skip - -let scratch -let server -let browser -let origin -let cspHeader = null -let bridgeVersion = null -let faultGrant = null - -beforeAll(async () => { - if (!bundles) { - return - } - cspHeader = await readShellCsp() - bridgeVersion = await readBridgeProtocolVersion() - faultGrant = await readBridgeFaultGrant() - scratch = await mkdtemp(join(tmpdir(), 'orca-mobile-web-app-session-')) - const built = await buildMobileWebAppBundle({ outDir: join(scratch, 'bundle') }) - const served = await createBundleServer({ outDir: built.outDir, cspHeader }) - server = served.server - origin = served.origin - const executablePath = process.env.ORCA_MOBILE_WEB_RENDER_BROWSER - browser = await chromium.launch({ headless: true, ...(executablePath ? { executablePath } : {}) }) -}, 240_000) - -afterAll(async () => { - await browser?.close() - server?.close() - if (scratch) { - await rm(scratch, { recursive: true, force: true }) - } -}) - -async function openPage(route, replies = {}, { domStorageOff = false } = {}) { - const page = await browser.newPage({ viewport: { width: 390, height: 844 } }) - if (domStorageOff) { - // Match Android WebView storage-off behavior: localStorage is null, not undefined; import-time push storage reads once threw getItem here. - await page.addInitScript(() => { - Object.defineProperty(window, 'localStorage', { configurable: true, get: () => null }) - }) - } - // Install channel at document start like native shell; entry reads it before load. - await page.addInitScript(installShellDouble, { - version: bridgeVersion, - sessionId: SHELL_SESSION_ID, - buildId: SHELL_BUILD_ID, - route: { pathname: route }, - host: SHELL_HOST, - storage: {}, - faultGrant, - grants: [faultGrant, ...sessionGrants()], - pageRoutes: PAGE_ROUTE_PATTERNS, - replies - }) - const errors = [] - const warnings = [] - page.on('pageerror', (error) => errors.push(`${error.name}: ${error.message}`)) - page.on('console', (message) => { - if (message.type() === 'error') { - errors.push(`console.error: ${message.text()}`) - } - // Track warnings separately: storage-write-dropped would evade error-only assertions. - if (message.type() === 'warning') { - warnings.push(message.text()) - } - }) - return { page, errors, warnings } -} - -// Wait for route content after mounted: deferred screen chunk may still be arriving. -async function waitForRoute({ page, errors }, route, awaitText) { - const named = (what) => - new Error(`${route} ${what}: ${errors.join(' | ') || 'no page or console error'}`) - try { - await page.waitForFunction(() => document.documentElement.dataset.orcaWebEntry === 'mounted', { - timeout: 60_000, - polling: 250 - }) - } catch { - throw named('never mounted') - } - try { - await page.waitForFunction((needle) => document.body.innerText.includes(needle), awaitText, { - timeout: 60_000, - polling: 250 - }) - } catch { - throw named(`mounted but never painted ${JSON.stringify(awaitText)}`) - } - // Report boundary-caught route fault directly instead of timing out on mount. - for (const fault of await page.evaluate(() => globalThis.__orcaRenderCheckFaults ?? [])) { - errors.push(`page fault: ${fault}`) - } -} - -async function openRoute(route, awaitText, replies = {}, options = {}) { - const opened = await openPage(route, replies, options) - await opened.page.goto(`${origin}/`, { waitUntil: 'load' }) - await waitForRoute(opened, route, awaitText) - return opened -} - -describeRender( - 'the session route in a real browser', - () => { - it('paints with DOM storage off, which is how the Android shell serves it', async () => { - // Null-storage arm reproduces Android import-time expo-notifications failure; shell owns push and pages must not load it. - const opened = await openRoute(SESSION_ROUTE, 'Terminal', {}, { domStorageOff: true }) - // Require all errors absent; filtering known push failure could hide other illegal storage users. - expect(opened.errors).toEqual([]) - await opened.page.close() - }, 120_000) - - it('writes no storage key it was never handed, on a mount that read the host status', async () => { - // Answer status.get: host-status-gates once wrote unlisted orca:host-app-version key only after readable reply, invisible to no-RPC cases. - const opened = await openRoute(SESSION_ROUTE, 'Terminal', { - 'status.get': { - protocolVersion: 9, - minCompatibleMobileVersion: 1, - appVersion: '1.4.191', - capabilities: [] - } - }) - await waitForRecordedRequests(opened.page, ['status.get']) - await waitForPageFrames(opened.page) - // Reject every dropped storage write, not just known key, to catch future unlisted writers. - expect(opened.warnings.filter((text) => text.includes('storage-write-dropped'))).toEqual([]) - await opened.page.close() - }, 120_000) - }, - 600_000 -) diff --git a/config/scripts/mobile-web-app/shell/mobile-web-app-composer-sizing-render.test.mjs b/config/scripts/mobile-web-app/shell/mobile-web-app-composer-sizing-render.test.mjs deleted file mode 100644 index 330d9052072..00000000000 --- a/config/scripts/mobile-web-app/shell/mobile-web-app-composer-sizing-render.test.mjs +++ /dev/null @@ -1,188 +0,0 @@ -import { mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises' -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' -import { afterAll, beforeAll, describe, expect, it } from 'vitest' -import * as esbuild from 'esbuild' -import { chromium, webkit } from 'playwright-core' -import { - MOBILE_WEB_APP_NATIVE_PARITY_STYLE, - MOBILE_WEB_APP_ROOT_RESET, - mobileWebAppBuildOptions -} from '../../build/mobile-web-app/build-mobile-web-app-bundle.mjs' -import { mobileWebAppDependenciesPresent } from '../mobile-web-app-bundle-dependencies.mjs' -import { createBundleServer, readShellCsp } from '../preview/mobile-web-app-render-harness.mjs' - -const mobileDir = fileURLToPath(new URL('../../../../mobile', import.meta.url)) -const engines = [ - { - name: 'chromium', - launch: () => { - const executablePath = process.env.ORCA_MOBILE_WEB_RENDER_BROWSER - return chromium.launch({ headless: true, ...(executablePath ? { executablePath } : {}) }) - } - }, - { name: 'webkit', launch: () => webkit.launch({ headless: true }) } -] - -const entry = ` -import { useState } from 'react' -import { createRoot } from 'react-dom/client' -import { View } from 'react-native' -import { MobileNativeChatComposerField } from './src/session/native-chat/composer/field/MobileNativeChatComposerField.web' -import { publishShellKeyboardSource } from './src/platform/keyboard/keyboard-occlusion' - -let keyboardHeight = 0 -const listeners = new Set() -if (location.hash !== '#browser') { - publishShellKeyboardSource({ - read: () => keyboardHeight, - subscribe: (listener) => { - listeners.add(listener) - return () => listeners.delete(listener) - } - }) -} -window.setShellKeyboard = (height) => { - keyboardHeight = height - listeners.forEach((listener) => listener(height)) -} -function Composer() { - const [state, setState] = useState({ value: '', placeholder: 'Message', dictationPreview: null }) - window.updateComposer = (patch) => setState((previous) => ({ ...previous, ...patch })) - return - setState((previous) => ({ ...previous, value }))} - /> - -} -createRoot(document.getElementById('root')).render() -` - -const bundles = mobileWebAppDependenciesPresent() -const describeSizing = bundles ? describe : describe.skip -const browsers = new Map() -let scratch -let server -let origin - -beforeAll(async () => { - if (!bundles) { - return - } - await mkdir(join(mobileDir, '.tmp'), { recursive: true }) - scratch = await mkdtemp(join(mobileDir, '.tmp', 'composer-sizing-')) - const outDir = join(scratch, 'bundle') - await esbuild.build({ - ...mobileWebAppBuildOptions([]), - entryPoints: undefined, - stdin: { contents: entry, resolveDir: mobileDir, loader: 'tsx', sourcefile: 'composer.tsx' }, - splitting: false, - write: true, - outdir: outDir, - entryNames: 'composer', - metafile: false - }) - await writeFile( - join(outDir, 'index.html'), - `${MOBILE_WEB_APP_ROOT_RESET}` + - `${MOBILE_WEB_APP_NATIVE_PARITY_STYLE}
` + - '' - ) - const served = await createBundleServer({ outDir, cspHeader: await readShellCsp() }) - server = served.server - origin = served.origin - for (const engine of engines) { - browsers.set(engine.name, await engine.launch()) - } -}, 180_000) - -afterAll(async () => { - for (const browser of browsers.values()) { - await browser.close() - } - server?.close() - if (scratch) { - await rm(scratch, { recursive: true, force: true }) - } -}) - -async function openPage(engine, mode = 'shell') { - const page = await browsers.get(engine.name).newPage({ viewport: { width: 390, height: 844 } }) - if (mode === 'browser') { - // Model iOS's shrinking visual viewport; RN Web and our keyboard subscription read it independently. - await page.addInitScript(() => { - let keyboard = 0 - const viewport = window.visualViewport - Object.defineProperty(viewport, 'height', { get: () => window.innerHeight - keyboard }) - window.setVisualKeyboard = (height) => { - keyboard = height - viewport.dispatchEvent(new Event('resize')) - } - }) - } - await page.goto(`${origin}/#${mode}`, { waitUntil: 'load' }) - const field = page.getByRole('textbox', { name: 'Message' }) - await field.waitFor({ state: 'visible' }) - return { page, field } -} - -function height(field) { - return field.evaluate((input) => input.getBoundingClientRect().height) -} - -describeSizing.each(engines)('web composer sizing in $name', (engine) => { - it('grows for newlines and wrapping, remeasures width, and shrinks without losing focus', async () => { - const { page, field } = await openPage(engine) - try { - await field.fill('Short draft') - const compact = await height(field) - await field.fill('First line\nSecond line\nThird line') - await expect.poll(() => height(field)).toBeGreaterThan(compact) - expect(await field.evaluate((input) => input.scrollHeight <= input.clientHeight)).toBe(true) - - await field.fill('Review the mobile composer and keep all draft text visible. '.repeat(4)) - await expect.poll(() => height(field)).toBeGreaterThan(compact * 2) - const narrow = await height(field) - await page.setViewportSize({ width: 844, height: 844 }) - await expect.poll(() => height(field)).toBeLessThan(narrow) - await expect - .poll(() => field.evaluate((input) => input.scrollHeight - input.clientHeight)) - .toBeLessThanOrEqual(1) - expect(await field.evaluate((input) => document.activeElement === input)).toBe(true) - - await field.fill('Short draft') - await expect.poll(() => height(field)).toBe(compact) - } finally { - await page.close() - } - }) - - it('grows for dictation without changing the draft or remounting the focused field', async () => { - const { page, field } = await openPage(engine) - try { - await field.fill('Existing draft') - const compact = await height(field) - await page.evaluate(() => - window.updateComposer({ - dictationPreview: { - before: 'Existing draft ', - text: 'Heard words '.repeat(12), - after: '' - } - }) - ) - await expect.poll(() => height(field)).toBeGreaterThan(compact) - expect(await field.inputValue()).toBe('Existing draft') - expect(await field.evaluate((input) => document.activeElement === input)).toBe(true) - await page.evaluate(() => window.updateComposer({ dictationPreview: null })) - await expect.poll(() => height(field)).toBe(compact) - } finally { - await page.close() - } - }) -}) diff --git a/config/scripts/mobile-web-app/shell/mobile-web-app-drawer-render.test.mjs b/config/scripts/mobile-web-app/shell/mobile-web-app-drawer-render.test.mjs deleted file mode 100644 index aa3782d8cf8..00000000000 --- a/config/scripts/mobile-web-app/shell/mobile-web-app-drawer-render.test.mjs +++ /dev/null @@ -1,163 +0,0 @@ -import { mkdtemp, rm } from 'node:fs/promises' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { afterAll, beforeAll, describe, expect, it } from 'vitest' -import { chromium, webkit } from 'playwright-core' -import { buildMobileWebAppBundle } from '../../build/mobile-web-app/build-mobile-web-app-bundle.mjs' -import { mobileWebAppDependenciesPresent } from '../mobile-web-app-bundle-dependencies.mjs' -import { - createBundleServer, - installShellDouble, - readBridgeBackNames, - readBridgeFaultGrant, - readBridgeProtocolVersion, - readShellCsp -} from '../preview/mobile-web-app-render-harness.mjs' - -const HOST_ROUTE = '/h/render-check-host' -const SHELL_HOST = { - id: 'render-check-host', - name: 'Render Check Host', - endpoint: 'ws://render-check', - lastConnected: 1 -} - -const VIEWPORT = { width: 390, height: 844 } - -// Without a dependency array, esbuild’s untransformed useAnimatedStyle has no Babel-written __closure, so Reanimated mapper runs only once. -// Both Chromium/WebKit must move; one-engine coverage could falsely support an engine-specific explanation. -const ENGINES = [ - { - name: 'chromium', - // Use runner Chrome override to avoid CI browser downloads. - launch: () => { - const executablePath = process.env.ORCA_MOBILE_WEB_RENDER_BROWSER - return chromium.launch({ - headless: true, - ...(executablePath ? { executablePath } : {}) - }) - } - }, - { name: 'webkit', launch: () => webkit.launch({ headless: true }) } -] - -const bundles = mobileWebAppDependenciesPresent() -const describeDrawer = bundles ? describe : describe.skip - -let scratch -let server -let origin -let cspHeader = null -let bridgeVersion = null -let faultGrant = null -let backNames = null - -beforeAll(async () => { - if (!bundles) { - return - } - cspHeader = await readShellCsp() - bridgeVersion = await readBridgeProtocolVersion() - faultGrant = await readBridgeFaultGrant() - backNames = await readBridgeBackNames() - scratch = await mkdtemp(join(tmpdir(), 'orca-mobile-web-app-drawer-')) - const { outDir } = await buildMobileWebAppBundle({ outDir: join(scratch, 'bundle') }) - const served = await createBundleServer({ outDir, cspHeader }) - server = served.server - origin = served.origin -}, 180_000) - -afterAll(async () => { - server?.close() - if (scratch) { - await rm(scratch, { recursive: true, force: true }) - } -}) - -/** The bottom bar's Workspace options button, by its own label. */ -function workspaceOptionsButton(page) { - return page.getByRole('button', { name: 'Workspace options', exact: true }) -} - -/** Every notify the page posted, by name, so a case can say what crossed and what did not. */ -function notifyNames() { - return globalThis.__orcaRenderCheckNotifies.map((frame) => frame.name) -} - -// Chromium matches Android WebView’s hardware Back; prove mounted page claims key over real bridge and closes animated sheet. WebKit has no hardware Back. -describeDrawer('the device Back key reaching a sheet on the page', () => { - it('closes the sheet instead of leaving the screen', async () => { - const browser = await ENGINES[0].launch() - try { - const page = await browser.newPage({ viewport: VIEWPORT, reducedMotion: 'no-preference' }) - const errors = [] - page.on('pageerror', (error) => errors.push(`${error.name}: ${error.message}`)) - await page.addInitScript(installShellDouble, { - version: bridgeVersion, - sessionId: 'render-check-session', - buildId: 'render-check-build', - route: { pathname: HOST_ROUTE }, - host: SHELL_HOST, - storage: {}, - faultGrant, - backFrame: backNames.frame - }) - await page.goto(`${origin}/`, { waitUntil: 'load' }) - await page.waitForFunction( - () => document.documentElement.dataset.orcaWebEntry === 'mounted', - undefined, - { timeout: 30_000, polling: 250 } - ) - // Closed sheet claims nothing; shell retains its existing pop fallback. - expect(await page.evaluate(notifyNames)).not.toContain(backNames.claim) - - await workspaceOptionsButton(page).click({ timeout: 30_000 }) - await page.waitForFunction( - () => document.querySelector('[aria-label="Dismiss drawer"]') !== null, - undefined, - { timeout: 10_000, polling: 100 } - ) - const claimed = await page.waitForFunction( - (name) => - globalThis.__orcaRenderCheckNotifies.find( - (frame) => frame.name === name && frame.claimed === true - ) ?? null, - backNames.claim, - { timeout: 10_000, polling: 100 } - ) - expect(await claimed.jsonValue(), errors.join(' | ')).toMatchObject({ claimed: true }) - - await page.evaluate(() => { - globalThis.__orcaRenderCheckSendBack() - }) - const closed = await page - .waitForFunction( - () => document.querySelector('[aria-label="Dismiss drawer"]') === null, - undefined, - { timeout: 10_000, polling: 100 } - ) - .then(() => true) - .catch(() => false) - expect( - closed, - `${errors.join(' | ')} | ${JSON.stringify(await page.evaluate(notifyNames))}` - ).toBe(true) - - // Consumed Back must not ask shell to pop session route as well as close sheet. - expect(await page.evaluate(notifyNames)).not.toContain(backNames.navigateBack) - // And the key goes back to the shell with the sheet, so the next press leaves the screen. - const claims = await page.evaluate( - (name) => - globalThis.__orcaRenderCheckNotifies - .filter((frame) => frame.name === name) - .map((frame) => frame.claimed), - backNames.claim - ) - expect(claims).toEqual([true, false]) - expect(errors).toEqual([]) - await page.close() - } finally { - await browser.close() - } - }, 120_000) -}) diff --git a/config/scripts/mobile-web-app/shell/mobile-web-app-handoff-grants-render.test.mjs b/config/scripts/mobile-web-app/shell/mobile-web-app-handoff-grants-render.test.mjs deleted file mode 100644 index 50365ea42f6..00000000000 --- a/config/scripts/mobile-web-app/shell/mobile-web-app-handoff-grants-render.test.mjs +++ /dev/null @@ -1,238 +0,0 @@ -import { mkdtemp, rm } from 'node:fs/promises' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { afterAll, beforeAll, describe, expect, it } from 'vitest' -import { chromium } from 'playwright-core' -import { buildMobileWebAppBundle } from '../../build/mobile-web-app/build-mobile-web-app-bundle.mjs' -import { mobileWebAppDependenciesPresent } from '../mobile-web-app-bundle-dependencies.mjs' -import { - createBundleServer, - installShellDouble, - readBridgeFaultGrant, - readBridgeProtocolVersion, - readShellCsp -} from '../preview/mobile-web-app-render-harness.mjs' - -// Wide sidebar pushes Tasks through useRouteHandoff; local navigation inherits opener grants and silently refuses copy actions. -// Browser check proves control is present/reachable and shell handoff leaves document in place. - -const HOST_ROUTE = '/h/render-check-host' -const HOST_PATTERN = '/h/[hostId]' -const TASKS_PATTERN = '/h/[hostId]/tasks' -/** The bundle key for the target route, so its chunk can be named rather than inferred. */ -const TASKS_ROUTE_KEY = './h/[hostId]/tasks.tsx' -const FILES_PATTERN = '/h/[hostId]/files/[worktreeId]' -const SHELL_SESSION_ID = 'render-check-session' -const SHELL_BUILD_ID = 'render-check-build' -const SHELL_HOST = { - id: 'render-check-host', - name: 'Render Check Host', - endpoint: 'ws://render-check', - lastConnected: 1 -} -/** The manifest's own pairs, as the shell would send them. */ -const PAGE_ROUTE_GRANTS = [ - { pathname: HOST_PATTERN, grants: ['navigate', 'storage', 'externalLink', 'haptics'] }, - { pathname: FILES_PATTERN, grants: ['navigate', 'storage', 'externalLink', 'haptics'] }, - { - pathname: TASKS_PATTERN, - grants: ['navigate', 'storage', 'externalLink', 'haptics', 'native.clipboard.write'] - } -] -/** Wide enough for `app/h/_layout.tsx` to render the sidebar beside the route. */ -const WIDE = { width: 1180, height: 820 } - -const bundles = mobileWebAppDependenciesPresent() -const describeRender = bundles ? describe : describe.skip - -let scratch -let server -let browser -let origin -let cspHeader = null -let bridgeVersion = null -let faultGrant = null -// Resolve target chunk from build; content-hash URLs cannot identify routes by name. -let tasksChunk = null - -beforeAll(async () => { - if (!bundles) { - return - } - cspHeader = await readShellCsp() - bridgeVersion = await readBridgeProtocolVersion() - faultGrant = await readBridgeFaultGrant() - scratch = await mkdtemp(join(tmpdir(), 'orca-mobile-web-app-handoff-')) - const built = await buildMobileWebAppBundle({ outDir: join(scratch, 'bundle') }) - tasksChunk = built.routeChunks[TASKS_ROUTE_KEY] - // Require resolvable target chunk or every absence assertion could pass on a typo. - expect(tasksChunk, `no chunk for ${TASKS_ROUTE_KEY}`).toBeTruthy() - const served = await createBundleServer({ outDir: built.outDir, cspHeader }) - server = served.server - origin = served.origin - const executablePath = process.env.ORCA_MOBILE_WEB_RENDER_BROWSER - browser = await chromium.launch({ headless: true, ...(executablePath ? { executablePath } : {}) }) -}, 180_000) - -afterAll(async () => { - await browser?.close() - server?.close() - if (scratch) { - await rm(scratch, { recursive: true, force: true }) - } -}) - -/** Opens the worktree list at a viewport, under a named set of session grants. */ -async function openHostRoute({ - viewport, - grants, - pageRouteGrants = PAGE_ROUTE_GRANTS, - route = HOST_ROUTE, - awaitText = SHELL_HOST.name, - ownsHostArea = false -}) { - const page = await browser.newPage({ viewport }) - await page.addInitScript(installShellDouble, { - version: bridgeVersion, - sessionId: SHELL_SESSION_ID, - buildId: SHELL_BUILD_ID, - route: { pathname: route }, - host: SHELL_HOST, - storage: {}, - faultGrant, - grants, - pageRoutes: [HOST_PATTERN, FILES_PATTERN, TASKS_PATTERN], - pageRouteGrants, - ownsHostArea - }) - const errors = [] - // Record every response status: failed chunk fetches must count as requests, not false evidence of no navigation. - const jsResponses = [] - page.on('pageerror', (error) => errors.push(`${error.name}: ${error.message}`)) - page.on('console', (message) => { - if (message.type() === 'error') { - errors.push(`console.error: ${message.text()}`) - } - }) - page.on('response', (response) => { - const path = new URL(response.url()).pathname - if (!path.endsWith('.js')) { - return - } - jsResponses.push({ status: response.status(), path }) - }) - await page.goto(`${origin}/`, { waitUntil: 'load' }) - await page.waitForFunction(() => document.documentElement.dataset.orcaWebEntry === 'mounted', { - timeout: 30_000, - polling: 250 - }) - await page.waitForFunction((needle) => document.body.innerText.includes(needle), awaitText, { - timeout: 30_000, - polling: 250 - }) - return { page, errors, jsResponses } -} - -/** Every `navigate` notify the page posted, in order. */ -function navigates(page) { - return page.evaluate(() => - (globalThis.__orcaRenderCheckNotifies ?? []).filter((frame) => frame.name === 'navigate') - ) -} - -// Race navigation wait with page errors; React Navigation throws once blanked document and hid behind a bare 30s timeout. -/** Tasks sits in the host header's ⋯ menu; open the menu and pick it, as a user does. */ -async function openTasksFromHeader( - page, - more = page.getByRole('button', { name: 'More actions', exact: true }).first() -) { - await more.click() - await page.getByRole('menuitem', { name: 'Tasks', exact: true }).click() -} - -async function waitForTasksRoute(page, opened, clickedAt) { - try { - await page.waitForFunction(() => location.pathname.endsWith('/tasks'), { - timeout: 30_000, - polling: 250 - }) - } catch (cause) { - const seen = await page.evaluate(() => ({ - pathname: location.pathname, - text: document.body.innerText.slice(0, 300) - })) - throw new Error( - [ - `the document never reached /tasks; pathname is ${seen.pathname}`, - `page errors: ${JSON.stringify(opened.errors)}`, - `navigate notifies: ${JSON.stringify(await navigates(page))}`, - `body text: ${JSON.stringify(seen.text)}`, - `js responses since the click: ${JSON.stringify(opened.jsResponses.slice(clickedAt))}` - ].join('\n'), - { cause } - ) - } -} - -describeRender('the sidebar hop to tasks, under the session it was opened with', () => { - it('hands the hop to the shell when the session cannot cover tasks', async () => { - const opened = await openHostRoute({ - viewport: WIDE, - grants: [faultGrant, 'navigate', 'storage', 'haptics'] - }) - const { page, errors, jsResponses } = opened - // The header's own menu, by the names a user reads; it is the sidebar's on a wide layout. - await openTasksFromHeader(page) - await expect - .poll(() => navigates(page)) - .toEqual([ - { v: bridgeVersion, type: 'notify', name: 'navigate', href: `${HOST_ROUTE}/tasks` } - ]) - expect(await navigates(page)).toEqual([ - { v: bridgeVersion, type: 'notify', name: 'navigate', href: `${HOST_ROUTE}/tasks` } - ]) - // Require original route and no target-chunk request at any status; opener chunks can still arrive after click and must not count as target navigation. - expect(await page.evaluate(() => location.pathname)).toBe(HOST_ROUTE) - expect(jsResponses.filter(({ path }) => path.endsWith(tasksChunk))).toEqual([]) - expect(errors).toEqual([]) - await page.close() - }, 60_000) - - it('keeps the hop in the document when the session covers tasks', async () => { - // Grant-positive control proves the same tap can navigate; absence alone could pass on an inert page. - const opened = await openHostRoute({ - viewport: WIDE, - grants: [ - faultGrant, - 'navigate', - 'storage', - 'externalLink', - 'haptics', - 'native.clipboard.write' - ] - }) - const { page, errors } = opened - const clickedAt = opened.jsResponses.length - await openTasksFromHeader(page) - await waitForTasksRoute(page, opened, clickedAt) - expect(await navigates(page)).toEqual([]) - expect(errors).toEqual([]) - await page.close() - }, 60_000) - - it('keeps the old behaviour when the shell sent no pairs at all', async () => { - // Older shells omit coverage field; absence must not force every hop into shell handoff. - const opened = await openHostRoute({ - viewport: WIDE, - grants: [faultGrant, 'navigate', 'storage', 'haptics'], - pageRouteGrants: null - }) - const { page, errors } = opened - const clickedAt = opened.jsResponses.length - await openTasksFromHeader(page) - await waitForTasksRoute(page, opened, clickedAt) - expect(await navigates(page)).toEqual([]) - expect(errors).toEqual([]) - await page.close() - }, 60_000) -}) diff --git a/config/scripts/mobile-web-app/shell/mobile-web-app-native-parity-render.test.mjs b/config/scripts/mobile-web-app/shell/mobile-web-app-native-parity-render.test.mjs deleted file mode 100644 index e3389b15c86..00000000000 --- a/config/scripts/mobile-web-app/shell/mobile-web-app-native-parity-render.test.mjs +++ /dev/null @@ -1,135 +0,0 @@ -// Measure the shipped hairline patch at phone density in both browser engines. -import { mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises' -import { join } from 'node:path' -import { fileURLToPath } from 'node:url' -import { afterAll, beforeAll, describe, expect, it } from 'vitest' -import * as esbuild from 'esbuild' -import { chromium, webkit } from 'playwright-core' -import pngjs from 'pngjs' -import { - MOBILE_WEB_APP_NATIVE_PARITY_STYLE, - MOBILE_WEB_APP_ROOT_RESET, - mobileWebAppBuildOptions -} from '../../build/mobile-web-app/build-mobile-web-app-bundle.mjs' -import { mobileWebAppDependenciesPresent } from '../mobile-web-app-bundle-dependencies.mjs' -import { createBundleServer, readShellCsp } from '../preview/mobile-web-app-render-harness.mjs' - -const mobileDir = fileURLToPath(new URL('../../../../mobile', import.meta.url)) - -// Android’s measured 480dpi is scale 3: Chromium launch flag preserves subpixel borders, unlike Playwright emulation. -// WebKit uses emulated scale, matching iOS subpixel border paint. -const ENGINES = [ - { - name: 'chromium', - launch: () => { - const executablePath = process.env.ORCA_MOBILE_WEB_RENDER_BROWSER - return chromium.launch({ - headless: true, - args: ['--force-device-scale-factor=3'], - ...(executablePath ? { executablePath } : {}) - }) - }, - pageOptions: { viewport: null } - }, - { - name: 'webkit', - launch: () => webkit.launch({ headless: true }), - pageOptions: { viewport: { width: 427, height: 952 }, deviceScaleFactor: 3 } - } -] - -// Require CommonJS copy like page dependencies; importing would measure a different react-native build. -const PAGE_ENTRY = ` -import { createElement as h } from 'react' -import { createRoot } from 'react-dom/client' -const { StyleSheet, View } = require('react-native') -const styles = StyleSheet.create({ - separatorBox: { paddingTop: 10.1, width: 12, backgroundColor: '#ffffff' }, - separator: { height: StyleSheet.hairlineWidth, backgroundColor: '#000000' } -}) -createRoot(document.getElementById('root')).render( - h(View, { testID: 'separator-box', style: styles.separatorBox }, h(View, { style: styles.separator })) -) -` - -const bundles = mobileWebAppDependenciesPresent() -const describeParity = bundles ? describe : describe.skip - -let scratch = null -let server = null -let origin = null -const browsers = new Map() - -beforeAll(async () => { - if (!bundles) { - return - } - await mkdir(join(mobileDir, '.tmp'), { recursive: true }) - scratch = await mkdtemp(join(mobileDir, '.tmp', 'native-parity-render-')) - const outDir = join(scratch, 'bundle') - await mkdir(outDir, { recursive: true }) - // Reuse page options except entry/chunking so dropping a builder shim fails here. - const shipped = mobileWebAppBuildOptions([]) - await esbuild.build({ - ...shipped, - entryPoints: undefined, - stdin: { contents: PAGE_ENTRY, resolveDir: mobileDir, loader: 'js', sourcefile: 'parity.js' }, - splitting: false, - write: true, - outdir: outDir, - entryNames: 'parity', - metafile: false - }) - await writeFile( - join(outDir, 'index.html'), - `${MOBILE_WEB_APP_ROOT_RESET}` + - `${MOBILE_WEB_APP_NATIVE_PARITY_STYLE}
` + - '' - ) - const served = await createBundleServer({ outDir, cspHeader: await readShellCsp() }) - server = served.server - origin = served.origin - for (const engine of ENGINES) { - browsers.set(engine.name, await engine.launch()) - } -}, 180_000) - -afterAll(async () => { - for (const browser of browsers.values()) { - await browser.close() - } - server?.close() - if (scratch) { - await rm(scratch, { recursive: true, force: true }) - } -}) - -async function openPage(engine) { - const page = await browsers.get(engine.name).newPage(engine.pageOptions) - await page.goto(`${origin}/`, { waitUntil: 'domcontentloaded' }) - await page.waitForSelector('[data-testid="separator-box"]') - return page -} - -describeParity.each(ENGINES)('the page against native, at a phone density, in $name', (engine) => { - it('paints a StyleSheet.hairlineWidth-tall separator one device pixel tall at a fractional offset', async () => { - const page = await openPage(engine) - try { - // At 10.1 CSS px, 0.5px separator straddles two device rows in both engines. - const shot = pngjs.PNG.sync.read( - await page.locator('[data-testid="separator-box"]').screenshot({ scale: 'device' }) - ) - const column = Math.floor(shot.width / 2) - let darkRows = 0 - for (let y = 0; y < shot.height; y++) { - // Count pure black rows in the separator clip. - if (shot.data[(y * shot.width + column) * 4] < 16) { - darkRows++ - } - } - expect(darkRows).toBe(1) - } finally { - await page.close() - } - }) -}) diff --git a/config/scripts/mobile-web-app/shell/mobile-web-app-safe-area-render.test.mjs b/config/scripts/mobile-web-app/shell/mobile-web-app-safe-area-render.test.mjs deleted file mode 100644 index 0ef291491e4..00000000000 --- a/config/scripts/mobile-web-app/shell/mobile-web-app-safe-area-render.test.mjs +++ /dev/null @@ -1,177 +0,0 @@ -import { mkdtemp, rm } from 'node:fs/promises' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { afterAll, beforeAll, describe, expect, it } from 'vitest' -import { chromium } from 'playwright-core' -import { buildMobileWebAppBundle } from '../../build/mobile-web-app/build-mobile-web-app-bundle.mjs' -import { mobileWebAppDependenciesPresent } from '../mobile-web-app-bundle-dependencies.mjs' -import { - createBundleServer, - installShellDouble, - readBridgeFaultGrant, - readBridgeProtocolVersion, - readShellCsp -} from '../preview/mobile-web-app-render-harness.mjs' - -// Measure real Expo providers/navigators: screens/root must pad edge-to-edge page exactly once from shell init insets. -const HOST_ROUTE = '/h/render-check-host' -const HOST = { - id: 'render-check-host', - name: 'Render Check Host', - endpoint: 'ws://render-check', - lastConnected: 1 -} -const INSETS = { top: 40, right: 0, bottom: 30, left: 0 } -// Use browser env insets different from shell INSETS so wrong provider cannot pass. -const ENV_INSETS = { top: 17, right: 0, bottom: 11, left: 0 } - -const bundles = mobileWebAppDependenciesPresent() -const describeRender = bundles ? describe : describe.skip - -let scratch -let server -let browser -let origin -let bridgeVersion -let faultGrant - -beforeAll(async () => { - bridgeVersion = await readBridgeProtocolVersion() - faultGrant = await readBridgeFaultGrant() - if (!bundles) { - return - } - scratch = await mkdtemp(join(tmpdir(), 'orca-mobile-web-app-safe-area-')) - const { outDir } = await buildMobileWebAppBundle({ outDir: join(scratch, 'bundle') }) - const served = await createBundleServer({ outDir, cspHeader: await readShellCsp() }) - server = served.server - origin = served.origin - const executablePath = process.env.ORCA_MOBILE_WEB_RENDER_BROWSER - browser = await chromium.launch({ headless: true, ...(executablePath ? { executablePath } : {}) }) -}, 180_000) - -afterAll(async () => { - await browser?.close() - server?.close() - if (scratch) { - await rm(scratch, { recursive: true, force: true }) - } -}) - -async function openHostRoute(safeAreaInsets, envInsets = ENV_INSETS) { - const page = await browser.newPage({ viewport: { width: 390, height: 844 } }) - const errors = [] - page.on('pageerror', (error) => errors.push(`${error.name}: ${error.message}`)) - const cdp = await page.context().newCDPSession(page) - await cdp.send('Emulation.setSafeAreaInsetsOverride', { insets: envInsets }) - await page.addInitScript(installShellDouble, { - version: bridgeVersion, - sessionId: 'safe-area-session', - buildId: 'safe-area-build', - route: { pathname: HOST_ROUTE }, - host: HOST, - storage: {}, - faultGrant, - grants: [faultGrant], - safeAreaInsets - }) - await page.goto(`${origin}/`, { waitUntil: 'load' }) - await page.waitForFunction((name) => document.body.innerText.includes(name), HOST.name, { - timeout: 30_000, - polling: 250 - }) - return { page, errors } -} - -function readEdges(page) { - return page.evaluate((name) => { - const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT) - // The list's page title is the last copy of the name; the bar holds a hidden one until the list scrolls. - let title = null - for (let node = walker.nextNode(); node !== null; node = walker.nextNode()) { - if (node.textContent === name) { - title = node - } - } - const range = document.createRange() - if (title !== null) { - range.selectNodeContents(title) - } - const fab = [...document.querySelectorAll('[role="button"]')].find( - (element) => element.getAttribute('aria-label') === 'New workspace' - ) - return { - titleTop: title === null ? null : range.getBoundingClientRect().top, - titleLeft: title === null ? null : range.getBoundingClientRect().left, - fabBottom: fab?.getBoundingClientRect().bottom ?? null, - fabRight: fab?.getBoundingClientRect().right ?? null, - envTop: (() => { - const probe = document.createElement('div') - probe.style.paddingTop = 'env(safe-area-inset-top)' - document.body.append(probe) - const top = getComputedStyle(probe).paddingTop - probe.remove() - return top - })(), - viewportHeight: window.innerHeight - } - }, HOST.name) -} - -describeRender('the page pads for the system bars once, by the shell insets', () => { - it('moves the header by exactly the inset init carried, not by the browser env', async () => { - const bare = await openHostRoute(null) - const zero = await readEdges(bare.page) - await bare.page.close() - const inset = await openHostRoute(INSETS) - const padded = await readEdges(inset.page) - await inset.page.close() - const noEnv = await openHostRoute(null, { top: 0, right: 0, bottom: 0, left: 0 }) - const envless = await readEdges(noEnv.page) - await noEnv.page.close() - expect([...bare.errors, ...inset.errors, ...noEnv.errors]).toEqual([]) - expect(zero.titleTop).not.toBeNull() - expect([zero.envTop, envless.envTop]).toEqual([`${ENV_INSETS.top}px`, '0px']) - expect(zero.titleTop).toBe(envless.titleTop) - // Require shell pad exactly once: DefaultNavigator adds browser env pad, while wrong web provider substitutes it. - expect(padded.titleTop - zero.titleTop).toBe(INSETS.top) - }, 90_000) - - // Unequal landscape side insets catch swapped sensor-housing edge. - it('keeps the screens clear of the side insets, padding them once', async () => { - const upright = await openHostRoute(INSETS) - const base = await readEdges(upright.page) - await upright.page.close() - const sideways = await openHostRoute({ ...INSETS, left: 59, right: 44 }) - const inset = await readEdges(sideways.page) - await sideways.page.close() - expect([...upright.errors, ...sideways.errors]).toEqual([]) - expect(inset.titleLeft - base.titleLeft).toBe(59) - expect(base.fabRight - inset.fabRight).toBe(44) - }, 60_000) - - it('follows a re-sent init, which is how the keyboard and rotation reach the page', async () => { - const opened = await openHostRoute(INSETS) - const before = await readEdges(opened.page) - await opened.page.evaluate( - (insets) => { - globalThis.__orcaRenderCheckResendInit({ safeAreaInsets: insets }) - }, - { ...INSETS, top: 64 } - ) - await opened.page.waitForFunction( - ({ name, top }) => { - const found = [...document.querySelectorAll('*')].some( - (element) => element.textContent === name && element.getBoundingClientRect().top > top - ) - return found - }, - { name: HOST.name, top: before.titleTop + 10 }, - { timeout: 10_000, polling: 100 } - ) - const after = await readEdges(opened.page) - await opened.page.close() - expect(opened.errors).toEqual([]) - expect(after.titleTop - before.titleTop).toBe(64 - INSETS.top) - }, 60_000) -}) diff --git a/config/scripts/mobile-web-app/terminal/mobile-web-app-session-terminal-init.test.mjs b/config/scripts/mobile-web-app/terminal/mobile-web-app-session-terminal-init.test.mjs deleted file mode 100644 index 06ba8407c0e..00000000000 --- a/config/scripts/mobile-web-app/terminal/mobile-web-app-session-terminal-init.test.mjs +++ /dev/null @@ -1,233 +0,0 @@ -import { mkdtemp, rm } from 'node:fs/promises' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { afterAll, beforeAll, describe, expect, it } from 'vitest' -import { chromium } from 'playwright-core' -import { buildMobileWebAppBundle } from '../../build/mobile-web-app/build-mobile-web-app-bundle.mjs' -import { mobileWebAppDependenciesPresent } from '../mobile-web-app-bundle-dependencies.mjs' -import { MOBILE_WEB_PAGE_ROUTES } from '../../build/mobile-web-app/mobile-web-page-routes.mjs' -import { - createBundleServer, - installShellDouble, - readBridgeFaultGrant, - readBridgeProtocolVersion, - readShellCsp -} from '../preview/mobile-web-app-render-harness.mjs' - -// Serve real-shaped tab snapshot and terminal stream; no-RPC session-render never attaches terminal. -// Surface exists at mount but grid opens only after init. Placeholder client identity gates terminal.subscribe; null once left surface 0×0. -// One test pins subscription identity and another reads painted grid, avoiding chrome-only false passes. - -const HOST_ID = 'terminal-init-host' -const WORKTREE = 'wt-1' -const SESSION_ROUTE = `/h/${HOST_ID}/session/${WORKTREE}` -const SESSION_PATTERN = '/h/[hostId]/session/[worktreeId]' -const PAGE_ROUTE_PATTERNS = [SESSION_PATTERN] -const SHELL_SESSION_ID = 'terminal-init-session' -const SHELL_BUILD_ID = 'terminal-init-build' -const SHELL_HOST = { - id: HOST_ID, - name: 'Terminal Init Host', - endpoint: 'ws://terminal-init', - lastConnected: 1 -} -const HANDLE = 'pty-handle-terminal-init' -const TAB_ID = 'tab-terminal-init' -const SCROLLBACK_MARKER = 'orca-terminal-init-marker' - -const TABS_SNAPSHOT = { - type: 'snapshot', - worktree: `id:${WORKTREE}`, - publicationEpoch: 'terminal-init-epoch', - snapshotVersion: 1, - activeTabId: TAB_ID, - activeTabType: 'terminal', - tabs: [ - { - type: 'terminal', - id: TAB_ID, - title: 'bash', - terminal: HANDLE, - status: 'ready', - isActive: true - } - ] -} - -const SCROLLBACK_EVENT = { - type: 'scrollback', - seq: 1, - cols: 80, - rows: 24, - serialized: `${SCROLLBACK_MARKER}\r\n`, - displayMode: 'phone' -} - -// Read manifest grants so fixture stays aligned with route. -function sessionGrants() { - const declared = MOBILE_WEB_PAGE_ROUTES.find((route) => route.pathname === SESSION_PATTERN) - if (!declared) { - throw new Error(`${SESSION_PATTERN} is not registered`) - } - return declared.grants -} - -const bundles = mobileWebAppDependenciesPresent() -const describeRender = bundles ? describe : describe.skip - -let scratch -let server -let browser -let origin -let cspHeader = null -let bridgeVersion = null -let faultGrant = null - -beforeAll(async () => { - if (!bundles) { - return - } - cspHeader = await readShellCsp() - bridgeVersion = await readBridgeProtocolVersion() - faultGrant = await readBridgeFaultGrant() - scratch = await mkdtemp(join(tmpdir(), 'orca-mobile-web-app-terminal-init-')) - const built = await buildMobileWebAppBundle({ outDir: join(scratch, 'bundle') }) - const served = await createBundleServer({ outDir: built.outDir, cspHeader }) - server = served.server - origin = served.origin - const executablePath = process.env.ORCA_MOBILE_WEB_RENDER_BROWSER - browser = await chromium.launch({ headless: true, ...(executablePath ? { executablePath } : {}) }) -}, 600_000) - -afterAll(async () => { - await browser?.close() - server?.close() - if (scratch) { - await rm(scratch, { recursive: true, force: true }) - } -}) - -// Answer minimum startup reads and name both streams so assertions observe loaded session, not refusal/retry states. -async function openSessionWithTerminalTab() { - const page = await browser.newPage({ viewport: { width: 390, height: 844 } }) - await page.addInitScript(installShellDouble, { - version: bridgeVersion, - sessionId: SHELL_SESSION_ID, - buildId: SHELL_BUILD_ID, - route: { pathname: SESSION_ROUTE }, - host: SHELL_HOST, - storage: {}, - faultGrant, - grants: [faultGrant, ...sessionGrants()], - pageRoutes: PAGE_ROUTE_PATTERNS, - streams: ['session.tabs.subscribe', 'terminal.subscribe'], - replies: { - 'worktree.show': { worktree: { id: WORKTREE, name: WORKTREE, path: `/tmp/${WORKTREE}` } }, - 'terminal.list': { - terminals: [{ handle: HANDLE, title: 'bash', worktree: `id:${WORKTREE}` }] - } - } - }) - const errors = [] - page.on('pageerror', (error) => errors.push(`${error.name}: ${error.message}`)) - await page.goto(`${origin}/`, { waitUntil: 'load' }) - await page.waitForFunction( - () => document.documentElement.dataset.orcaWebEntry === 'mounted', - undefined, - { timeout: 60_000, polling: 250 } - ) - const tabs = await waitForSubscribe(page, 'session.tabs.subscribe') - await page.evaluate( - ([id, event]) => globalThis.__orcaRenderCheckEmitEvent(id, event), - [tabs.id, TABS_SNAPSHOT] - ) - return { errors, page } -} - -// Serialized page function closes over nothing; xterm helper textarea measures one cell where canvas/WebGL exposes no text rows. -function readTerminalGrid() { - const surface = document.getElementById('terminal-surface') - const box = surface.getBoundingClientRect() - const read = { surface: { width: Math.round(box.width), height: Math.round(box.height) } } - const screen = surface.querySelector('.xterm-screen') - const cell = surface.querySelector('.xterm-helper-textarea') - if (!screen || !cell) { - return { ...read, grid: null } - } - const cellBox = cell.getBoundingClientRect() - if (cellBox.width <= 0 || cellBox.height <= 0) { - return { ...read, grid: null } - } - const screenBox = screen.getBoundingClientRect() - return { - ...read, - grid: { - cols: Math.round(screenBox.width / cellBox.width), - rows: Math.round(screenBox.height / cellBox.height) - } - } -} - -async function waitForSubscribe(page, method) { - try { - await page.waitForFunction( - (name) => (globalThis.__orcaRenderCheckSubscribes ?? []).some((one) => one.method === name), - method, - // Streams normally open within a second; bound failure reporting with headroom rather than adding fixed wait. - { timeout: 30_000, polling: 100 } - ) - } catch { - const opened = await page.evaluate(() => globalThis.__orcaRenderCheckSubscribes ?? []) - throw new Error( - `the page never subscribed to ${method}; it opened: ${ - opened.map((one) => one.method).join(', ') || 'nothing' - }` - ) - } - const found = await page.evaluate( - (name) => (globalThis.__orcaRenderCheckSubscribes ?? []).find((one) => one.method === name), - method - ) - return found -} - -describeRender( - 'the session route attaches its terminal on the page', - () => { - it('receives init in the document and measures a non-zero grid', async () => { - const { errors, page } = await openSessionWithTerminalTab() - const subscribe = await waitForSubscribe(page, 'terminal.subscribe') - await page.evaluate( - ([id, event]) => globalThis.__orcaRenderCheckEmitEvent(id, event), - [subscribe.id, SCROLLBACK_EVENT] - ) - // Require xterm-screen created by init/term.open, not surface present at mount. - // Await replay/resize before reading one-cell helper textarea; screen existence can precede measurable grid. - await page.waitForFunction( - () => { - const cell = document.querySelector('#terminal-surface .xterm-helper-textarea') - return ( - document.querySelector('.xterm-screen') !== null && - cell !== null && - cell.getBoundingClientRect().width > 0 - ) - }, - undefined, - { - timeout: 60_000, - polling: 250 - } - ) - const painted = await page.evaluate(readTerminalGrid) - console.log('[terminal-init]', JSON.stringify(painted)) - // Catch emulator’s original 0×0 surface failure. - expect(painted.surface.width).toBeGreaterThan(0) - expect(painted.surface.height).toBeGreaterThan(0) - // Match scrollback grid dimensions to reject defaults; terminal-render separately checks buffer bytes because WebGL exposes no text rows. - expect(painted.grid).toEqual({ cols: SCROLLBACK_EVENT.cols, rows: SCROLLBACK_EVENT.rows }) - expect(errors).toEqual([]) - await page.close() - }, 300_000) - }, - 900_000 -) diff --git a/config/scripts/performance/macos-computer-owner/macos-computer-helper-owner-loss-processes.test.mjs b/config/scripts/performance/macos-computer-owner/macos-computer-helper-owner-loss-processes.test.mjs deleted file mode 100644 index 8d04730e73b..00000000000 --- a/config/scripts/performance/macos-computer-owner/macos-computer-helper-owner-loss-processes.test.mjs +++ /dev/null @@ -1,196 +0,0 @@ -import { execFileSync, spawn } from 'node:child_process' -import { existsSync, mkdtempSync, readFileSync, rmSync } from 'node:fs' -import { tmpdir } from 'node:os' -import path from 'node:path' -import { afterEach, describe, expect, it } from 'vitest' -import { - killProcessMatchingCommand, - killRecordedAndMatchingProcesses, - killRecordedProcess, - signalValidatedProcessGroup, - writeProcessRecord -} from './macos-computer-helper-owner-loss-processes.mjs' - -const describeMacOS = process.platform === 'darwin' ? describe : describe.skip -const spawnedPids = new Set() -const temporaryDirectories = new Set() - -afterEach(() => { - for (const pid of spawnedPids) { - try { - process.kill(pid, 'SIGKILL') - } catch {} - } - spawnedPids.clear() - for (const temporaryDirectory of temporaryDirectories) { - rmSync(temporaryDirectory, { recursive: true, force: true }) - } - temporaryDirectories.clear() -}) - -describeMacOS('macOS helper owner-loss benchmark process cleanup', () => { - it('kills a timed-out trial group only after validating its environment', async () => { - const temporaryDirectory = mkdtempSync(path.join(tmpdir(), 'orca-owner-benchmark-group-test-')) - temporaryDirectories.add(temporaryDirectory) - const childPidPath = path.join(temporaryDirectory, 'child.pid') - const environmentName = `ORCA_OWNER_GROUP_${process.pid}` - const environmentValue = `${Date.now()}` - const fixture = ` - const { spawn } = require('node:child_process') - const { writeFileSync } = require('node:fs') - const child = spawn(process.execPath, ['-e', 'setInterval(() => {}, 1000)'], { - stdio: 'ignore' - }) - writeFileSync(${JSON.stringify(childPidPath)}, String(child.pid)) - setInterval(() => {}, 1000) - ` - const launcher = spawn(process.execPath, ['-e', fixture], { - detached: true, - env: { ...process.env, [environmentName]: environmentValue }, - stdio: 'ignore' - }) - spawnedPids.add(launcher.pid) - launcher.unref() - const launcherExited = new Promise((resolve) => launcher.once('exit', resolve)) - await expect.poll(() => existsSync(childPidPath), { timeout: 10_000 }).toBe(true) - const childPid = Number(readFileSync(childPidPath, 'utf8')) - spawnedPids.add(childPid) - // Send the trial timeout's own kill signal once the group is up; a real timeout would race its startup. - process.kill(launcher.pid, 'SIGKILL') - await launcherExited - spawnedPids.delete(launcher.pid) - const environmentFragment = `${environmentName}=${environmentValue}` - const groupState = { stopped: false } - - expect(() => process.kill(launcher.pid, 0)).toThrow() - expect(() => - signalValidatedProcessGroup(launcher.pid, `${environmentName}=wrong`, 'SIGSTOP') - ).toThrow('Benchmark process group no longer belongs to this trial') - expect(() => process.kill(childPid, 0)).not.toThrow() - expect( - signalValidatedProcessGroup(launcher.pid, environmentFragment, 'SIGSTOP', groupState) - ).toBe(true) - expect( - signalValidatedProcessGroup(launcher.pid, environmentFragment, 'SIGKILL', groupState) - ).toBe(true) - await expect - .poll(() => { - try { - process.kill(childPid, 0) - return true - } catch { - return false - } - }) - .toBe(false) - - spawnedPids.delete(childPid) - }) - - it('kills a recorded helper in a separate process group', async () => { - const temporaryDirectory = mkdtempSync( - path.join(tmpdir(), 'orca-owner-benchmark-cleanup-test-') - ) - temporaryDirectories.add(temporaryDirectory) - const recordPath = path.join(temporaryDirectory, 'helper.json') - const marker = `orca-owner-cleanup-${process.pid}-${Date.now()}` - const helper = spawn(process.execPath, ['-e', 'setInterval(() => {}, 1_000)', marker], { - detached: true, - stdio: 'ignore' - }) - spawnedPids.add(helper.pid) - helper.unref() - const exited = new Promise((resolve) => helper.once('exit', resolve)) - const command = execFileSync('ps', ['-p', String(helper.pid), '-o', 'command='], { - encoding: 'utf8' - }).trim() - const processGroup = Number( - execFileSync('ps', ['-p', String(helper.pid), '-o', 'pgid='], { - encoding: 'utf8' - }).trim() - ) - writeProcessRecord(recordPath, { pid: helper.pid, pgid: processGroup, command }) - - expect(processGroup).toBe(helper.pid) - expect(killRecordedProcess(recordPath, marker)).toBe(true) - await exited - expect(() => process.kill(helper.pid, 0)).toThrow() - - spawnedPids.delete(helper.pid) - }) - - it('kills every unrecorded helper using its unique trial command', async () => { - const marker = `orca-owner-unrecorded-${process.pid}-${Date.now()}` - const helpers = Array.from({ length: 2 }, () => - spawn(process.execPath, ['-e', 'setInterval(() => {}, 1_000)', marker], { - detached: true, - stdio: 'ignore' - }) - ) - for (const helper of helpers) { - spawnedPids.add(helper.pid) - helper.unref() - } - const exited = Promise.all( - helpers.map((helper) => new Promise((resolve) => helper.once('exit', resolve))) - ) - - expect(killProcessMatchingCommand([process.execPath, marker])).toBe(true) - await exited - for (const helper of helpers) { - expect(() => process.kill(helper.pid, 0)).toThrow() - spawnedPids.delete(helper.pid) - } - }) - - it('runs unique-command cleanup after an invalid process record', async () => { - const temporaryDirectory = mkdtempSync( - path.join(tmpdir(), 'orca-owner-benchmark-fallback-test-') - ) - temporaryDirectories.add(temporaryDirectory) - const recordPath = path.join(temporaryDirectory, 'helper.json') - const marker = `orca-owner-invalid-record-${process.pid}-${Date.now()}` - const helper = spawn(process.execPath, ['-e', 'setInterval(() => {}, 1_000)', marker], { - detached: true, - stdio: 'ignore' - }) - spawnedPids.add(helper.pid) - helper.unref() - const exited = new Promise((resolve) => helper.once('exit', resolve)) - const command = execFileSync('ps', ['-p', String(helper.pid), '-o', 'command='], { - encoding: 'utf8' - }).trim() - writeProcessRecord(recordPath, { pid: helper.pid, pgid: helper.pid - 1, command }) - - expect(() => - killRecordedAndMatchingProcesses(recordPath, marker, [process.execPath, marker]) - ).toThrow('Recorded benchmark helper identity is invalid') - await exited - expect(() => process.kill(helper.pid, 0)).toThrow() - - spawnedPids.delete(helper.pid) - }) - - it('rejects a record that is not a detached process-group identity', () => { - const temporaryDirectory = mkdtempSync( - path.join(tmpdir(), 'orca-owner-benchmark-identity-test-') - ) - temporaryDirectories.add(temporaryDirectory) - const recordPath = path.join(temporaryDirectory, 'helper.json') - const marker = `orca-owner-invalid-identity-${process.pid}-${Date.now()}` - const helper = spawn(process.execPath, ['-e', 'setInterval(() => {}, 1_000)', marker], { - stdio: 'ignore' - }) - spawnedPids.add(helper.pid) - helper.unref() - const command = execFileSync('ps', ['-p', String(helper.pid), '-o', 'command='], { - encoding: 'utf8' - }).trim() - writeProcessRecord(recordPath, { pid: helper.pid, pgid: helper.pid - 1, command }) - - expect(() => killRecordedProcess(recordPath, marker)).toThrow( - 'Recorded benchmark helper identity is invalid' - ) - expect(() => process.kill(helper.pid, 0)).not.toThrow() - }) -}) 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 8a09a936ba4..0c68b53e63b 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 @@ -6,7 +6,6 @@ const NODE_RUNTIME_INCLUDE = [ 'tests/e2e/linear-cli-recovery.unit.test.ts', // Exercises a real peer reset through Node's native Socket.setTypeOfService. 'src/main/network/best-effort-socket-type-of-service.test.ts', - 'src/main/runtime/agent-session/lifecycle/structured-agent-cli-writers.test.ts', 'config/scripts/ci/workflow-contracts/cloud-security-history-workflow.test.mjs', 'src/main/ssh/legacy-relay/endpoints/ssh-relay-endpoint-incumbent-shell.integration.test.ts', 'src/main/ssh/remote-exec/ssh-remote-commands.test.ts', @@ -130,7 +129,6 @@ const NODE_RUNTIME_INCLUDE = [ 'src/main/agent-hooks/server/testing/identity/server-hook-session-binding.test.ts', 'tests/e2e/helpers/persisted-profile-state.unit.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-external-acknowledgement.test.ts' ] diff --git a/config/scripts/workflow/source-routing/pr-shell-contract-prefixes.mjs b/config/scripts/workflow/source-routing/pr-shell-contract-prefixes.mjs index 09af6ccf976..395bde518be 100644 --- a/config/scripts/workflow/source-routing/pr-shell-contract-prefixes.mjs +++ b/config/scripts/workflow/source-routing/pr-shell-contract-prefixes.mjs @@ -27,7 +27,6 @@ export const SHELL_PREFIXES = [ 'src/shared/shell/wsl/fish-wsl-cwd-report', 'src/shared/shell/testing/fish-binary-requirement', 'src/shared/terminal/pty/ingress/pty-reply-echo-shapes', - 'src/shared/shell/launch/startup-shell-portability', 'src/shared/shell/command-resolution/posix-command-path-lookup', 'src/shared/agent-launch/startup/readiness/draft-paste-ready-scanner.ts', 'src/main/wsl/filesystem/wsl-shell-cwd-report', diff --git a/src/main/claude-usage/claude-usage-report-aggregation.test.ts b/src/main/claude-usage/claude-usage-report-aggregation.test.ts deleted file mode 100644 index cbc91658556..00000000000 --- a/src/main/claude-usage/claude-usage-report-aggregation.test.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { describe, expect, it } from 'vitest' -import type { ClaudeUsageDailyAggregate, ClaudeUsagePersistedState } from './types' -import { buildBreakdown, buildSummary } from './claude-usage-report-aggregation' - -function dailyRow(day: string, model: string): ClaudeUsageDailyAggregate { - return { - day, - model, - projectKey: 'project', - projectLabel: 'project', - repoId: null, - worktreeId: 'worktree-1', - turnCount: 1, - zeroCacheReadTurnCount: 0, - inputTokens: 1_000_000, - outputTokens: 1_000_000, - cacheReadTokens: 0, - cacheWriteTokens: 0, - cacheWrite1hTokens: 0 - } -} - -function stateWithDaily(dailyAggregates: ClaudeUsageDailyAggregate[]): ClaudeUsagePersistedState { - return { - schemaVersion: 6, - worktreeFingerprint: null, - processedFiles: [], - sessions: [], - dailyAggregates, - scanState: { - enabled: true, - lastScanStartedAt: null, - lastScanCompletedAt: null, - lastScanError: null - } - } -} - -describe('buildSummary unpriced models', () => { - it('keeps the priced total and flags the rows it had to leave out', () => { - const summary = buildSummary( - stateWithDaily([ - dailyRow('2026-10-15', 'claude-sonnet-5-5'), - dailyRow('2026-10-15', 'claude-opus-9') - ]), - 'all', - 'all' - ) - - expect(summary.estimatedCostUsd).toBeCloseTo(12) - expect(summary.hasUnpricedModels).toBe(true) - }) -}) - -describe('buildSummary Haiku 5.5 long-context requests', () => { - it('bills only the requests recorded over 100K at the long-context rates', () => { - const row = { - ...dailyRow('2026-10-15', 'claude-haiku-5-5'), - longContext: { - inputTokens: 500_000, - outputTokens: 0, - cacheReadTokens: 0, - cacheWriteTokens: 0, - cacheWrite1hTokens: 0 - } - } - const state = stateWithDaily([row]) - - expect(buildSummary(state, 'all', 'all').estimatedCostUsd).toBeCloseTo(0.8) - expect(buildSummary(state, 'all', 'all').hasUnpricedModels).toBe(false) - expect(buildBreakdown(state, 'all', 'all', 'model')[0]?.estimatedCostUsd).toBeCloseTo(0.8) - }) -}) diff --git a/src/main/codex/configuration/homes/codex-real-home-path.test.ts b/src/main/codex/configuration/homes/codex-real-home-path.test.ts deleted file mode 100644 index 3e175571365..00000000000 --- a/src/main/codex/configuration/homes/codex-real-home-path.test.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs' -import { tmpdir } from 'node:os' -import { join } from 'node:path' - -import { afterEach, describe, expect, it } from 'vitest' -import { hasCustomCodexHomeOverrideForLaunch } from './codex-real-home-path' - -import { __resetShellStartupEnvCache } from '../../../pty/shell-startup/shell-startup-env' - -const temporaryHomes: string[] = [] -const savedConfigHome = process.env.XDG_CONFIG_HOME - -afterEach(() => { - __resetShellStartupEnvCache() - if (savedConfigHome === undefined) { - delete process.env.XDG_CONFIG_HOME - } else { - process.env.XDG_CONFIG_HOME = savedConfigHome - } - for (const path of temporaryHomes.splice(0)) { - rmSync(path, { recursive: true, force: true }) - } -}) - -describe('hasCustomCodexHomeOverride', () => { - it.skipIf(process.platform === 'win32')( - 'detects a pane-local shell startup override from its launch HOME', - () => { - const paneHome = mkdtempSync(join(tmpdir(), 'orca-codex-pane-home-')) - temporaryHomes.push(paneHome) - writeFileSync(join(paneHome, '.zshrc'), 'export CODEX_HOME="$HOME/custom-codex-home"\n') - - expect(hasCustomCodexHomeOverrideForLaunch({ HOME: paneHome, SHELL: '/bin/zsh' })).toBe(true) - } - ) - - // Dock launches may lack XDG_CONFIG_HOME exported by fish; use the pane launch environment. - it.skipIf(process.platform === 'win32')( - 'resolves a fish override under the launch env XDG_CONFIG_HOME, not the process one', - () => { - const paneHome = mkdtempSync(join(tmpdir(), 'orca-codex-fish-home-')) - temporaryHomes.push(paneHome) - const configHome = join(paneHome, 'xdg') - mkdirSync(join(configHome, 'fish'), { recursive: true }) - writeFileSync( - join(configHome, 'fish', 'config.fish'), - 'set -gx CODEX_HOME "$HOME/custom-codex-home"\n' - ) - delete process.env.XDG_CONFIG_HOME - - const launchEnv = { - HOME: paneHome, - SHELL: '/opt/homebrew/bin/fish', - XDG_CONFIG_HOME: configHome - } - expect(hasCustomCodexHomeOverrideForLaunch(launchEnv)).toBe(true) - } - ) -}) diff --git a/src/main/ipc/pty/pty-management-async-io-health.test.ts b/src/main/ipc/pty/pty-management-async-io-health.test.ts deleted file mode 100644 index f2d09ab9d8c..00000000000 --- a/src/main/ipc/pty/pty-management-async-io-health.test.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { beforeEach, expect, it, vi } from 'vitest' -import type { DaemonAsyncIoStatus } from '../../../shared/terminal/daemon/daemon-async-io-health' - -const { handlers, provider, adapter, restart } = vi.hoisted(() => ({ - handlers: new Map Promise>(), - provider: vi.fn(), - adapter: { getDaemonIdentity: vi.fn(), getAsyncIoHealth: vi.fn() }, - restart: vi.fn() -})) - -vi.mock('electron', () => ({ - ipcMain: { - removeHandler: (name: string) => handlers.delete(name), - handle: (name: string, handler: () => Promise) => - handlers.set(name, handler) - } -})) -vi.mock('../../daemon/providers/lifecycle/daemon-provider-state', () => ({ - getDaemonProvider: provider -})) -vi.mock('../../daemon/providers/lifecycle/daemon-provider-routing', () => ({ - getCurrentDaemonAdapter: () => adapter -})) -vi.mock('../../daemon/providers/lifecycle/daemon-provider-restart', () => ({ - restartDaemon: restart -})) - -import { registerDaemonManagementHandlers } from './pty-management' - -beforeEach(() => { - vi.clearAllMocks() - provider.mockReturnValue({}) - // Real adapters return a fresh copy on every read. - adapter.getDaemonIdentity.mockImplementation(() => ({ - pid: 123, - startedAtMs: 1, - launchNonce: 'original' - })) - adapter.getAsyncIoHealth.mockResolvedValue({ state: 'stalled', pendingMs: 5000 }) - registerDaemonManagementHandlers() -}) - -async function read(): Promise { - return handlers.get('pty:management:asyncIoHealth')?.() -} - -it('discards health evidence if the daemon changes while the check is pending', async () => { - let finish: (health: DaemonAsyncIoStatus) => void = () => {} - adapter.getAsyncIoHealth.mockImplementationOnce( - () => - new Promise((resolve) => { - finish = resolve - }) - ) - const pending = read() - adapter.getDaemonIdentity.mockReturnValue({ - pid: 456, - startedAtMs: 2, - launchNonce: 'replacement' - }) - finish({ state: 'stalled', pendingMs: 5000 }) - expect(await pending).toEqual({ state: 'unverifiable' }) - expect(restart).not.toHaveBeenCalled() -}) diff --git a/src/main/managed-server/install/orcad-remote-launch.test.ts b/src/main/managed-server/install/orcad-remote-launch.test.ts deleted file mode 100644 index 5bc4f00b664..00000000000 --- a/src/main/managed-server/install/orcad-remote-launch.test.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { spawnSync } from 'node:child_process' -import { mkdtempSync, rmSync } from 'node:fs' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { describe, expect, it } from 'vitest' -import { orcadLivenessProbeCommand, parseOrcadLiveness } from './orcad-remote-launch' -import { getRemoteHostPlatform } from '../../ssh/remote-host/ssh-remote-platform' - -const posix = getRemoteHostPlatform('linux-x64') -getRemoteHostPlatform('win32-x64') -JSON.stringify({ - type: 'orca_server_ready', - schemaVersion: 1, - runtimeId: 'r1', - boundEndpoint: 'ws://127.0.0.1:7777', - advertisedEndpoint: null, - managedWslCliReconciliation: 'settled', - pairing: { available: false, reason: 'disabled_by_operator', guidance: 'n/a' }, - health: { buildHash: 'abc', terminalDaemon: { state: 'live' } } -}) - -describe('liveness', () => { - // Real host (win-lowspec): after a distro restart the probe's own shell took the recorded PID. - describe.skipIf(process.platform === 'win32')( - 'a recorded PID after a restart (real shell)', - () => { - const probeIn = (script: string): string => - spawnSync('sh', ['-c', script], { encoding: 'utf8' }).stdout - - async function withSlot(run: (slot: string, probe: string) => Promise): Promise { - const slot = mkdtempSync(join(tmpdir(), 'orcad-liveness-')) - try { - await run(slot, orcadLivenessProbeCommand(posix, slot)) - } finally { - rmSync(slot, { recursive: true, force: true }) - } - } - - it('calls dead a PID held by the probe shell or the shell wrapping it', async () => { - await withSlot(async (slot, probe) => { - const own = probeIn(`echo $$ > '${slot}/.orcad-pid'; ${probe}`) - expect(parseOrcadLiveness(own)).toBe('DEAD') - // The trailing `:` stops dash and bash from exec'ing the inner shell into the outer's PID. - const wrapped = probeIn( - `echo $$ > '${slot}/.orcad-pid'; sh -c ${JSON.stringify(probe).replace(/\$/g, '\\$')}; :` - ) - expect(parseOrcadLiveness(wrapped)).toBe('DEAD') - }) - }) - } - ) -}) diff --git a/src/main/native-chat/agent-session-timeline/provider-timeline-identity.test.ts b/src/main/native-chat/agent-session-timeline/provider-timeline-identity.test.ts deleted file mode 100644 index 8c37b1707b6..00000000000 --- a/src/main/native-chat/agent-session-timeline/provider-timeline-identity.test.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { agentJournalItemKey } from '../../../shared/agent-session/journal/agent-session-journal-item-key' -import { - createLegacyProviderTimelineIdentityScheme, - providerTimelineKeyPart, - spellProviderTimelineKey -} from './provider-timeline-identity' - -const scheme = createLegacyProviderTimelineIdentityScheme({ agent: 'grok', sessionId: 's1' }) -const provider = (value: string) => ({ source: 'provider', value }) as const - -describe('provider timeline identity spelling', () => { - it('escapes a key so it cannot forge another part', () => { - expect(providerTimelineKeyPart('a:b/c')).toBe('a%3Ab%2Fc') - expect(spellProviderTimelineKey('ns', provider('x:y'))).not.toBe( - spellProviderTimelineKey('ns:x', provider('y')) - ) - }) - - it('bounds a long key by a digest, so two long keys with one prefix stay apart', () => { - const head = 'k'.repeat(400) - const one = providerTimelineKeyPart(`${head}1`) - const two = providerTimelineKeyPart(`${head}2`) - expect(Buffer.byteLength(one, 'utf8')).toBeLessThanOrEqual(256) - expect(one).not.toBe(two) - }) - - it('spells an item per thread, and a minted key apart from any provider one', () => { - const item = (thread: string | null) => - agentJournalItemKey( - scheme.item({ namespace: 'ns', family: 'item', key: provider('m1'), thread }) - ) - expect(new Set([item(null), item('root'), item('child')]).size).toBe(3) - expect(spellProviderTimelineKey('ns', { source: 'minted', value: 'gen-1:s1' })).toBe( - 'm:gen-1%3As1' - ) - }) - - it('spells a request in the acquisition that asked it, with its incarnation', () => { - const request = (generation: string, incarnation: number) => - scheme.request({ generation, key: '0', incarnation }) - expect(request('gen-1', 1)).toMatchObject({ provider: 'legacy', recordId: 'request:g:gen-1:0' }) - expect(request('gen-1', 2)).toMatchObject({ recordId: 'request:g:gen-1:0#2' }) - expect(agentJournalItemKey(request('gen-2', 1))).not.toBe( - agentJournalItemKey(request('gen-1', 1)) - ) - }) -}) diff --git a/src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-create-receipt-collision.test.ts b/src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-create-receipt-collision.test.ts deleted file mode 100644 index a6eaf98151d..00000000000 --- a/src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-create-receipt-collision.test.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { expect, it } from 'vitest' -import { createRestTestRig } from './structured-agent-session-rest-test-rig.test-fixture' -import { claudeProfileSetupFailed } from '../../../../claude-accounts/profiles/routing/claude-profile-launch-errors' -import { - createTestParams, - CREATE_TEST_CALLER -} from './structured-agent-session-create.test-fixture' -import { - hostTestMessage, - hostTestOperationId, - hostTestAttachParams -} from './structured-agent-session-host-test-data.test-fixture' - -it('refuses a reused opening message ID without creating the second session', async () => { - const rig = await createRestTestRig() - try { - const firstMessage = { clientMessageId: hostTestOperationId(), body: hostTestMessage('Hello') } - expect( - await rig.host.create(CREATE_TEST_CALLER, createTestParams(firstMessage), { firstMessage }) - ).toMatchObject({ ok: true }) - - const second = createTestParams(firstMessage, {}, 'session-second') - expect(await rig.host.create(CREATE_TEST_CALLER, second, { firstMessage })).toMatchObject({ - ok: false, - refusal: { code: 'agent_session_operation_invalid', details: { reason: 'messageIdReused' } } - }) - expect(rig.store.getRecord('session-second')).toBeNull() - } finally { - await rig.dispose() - } -}) - -it('returns a typed preparation failure on its first response and replay, then permits recovery', async () => { - const rig = await createRestTestRig() - try { - rig.adapter.acquire.mockRejectedValueOnce(claudeProfileSetupFailed()) - const params = hostTestAttachParams(null) - const first = await rig.host.attach(CREATE_TEST_CALLER, params) - expect(first).toMatchObject({ - ok: false, - refusal: { - code: 'agent_session_operation_invalid', - details: { reason: 'claudeAccountSetupFailed', ownerVerdict: 'exited' }, - ownerVerdict: 'exited' - } - }) - await expect(rig.host.attach(CREATE_TEST_CALLER, params)).resolves.toEqual(first) - await expect( - rig.host.attach(CREATE_TEST_CALLER, hostTestAttachParams(null)) - ).resolves.toMatchObject({ ok: true }) - } finally { - await rig.dispose() - } -}) diff --git a/src/main/pi/managed-extensions/agent-status/agent-status-extension-nested-run-settlement.test.ts b/src/main/pi/managed-extensions/agent-status/agent-status-extension-nested-run-settlement.test.ts deleted file mode 100644 index 62fda783152..00000000000 --- a/src/main/pi/managed-extensions/agent-status/agent-status-extension-nested-run-settlement.test.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' - -import { createAgentStatusExtensionHarness } from './agent-status-extension-test-harness' - -function postedHookNames(fetchMock: ReturnType): string[] { - return fetchMock.mock.calls.map((call) => { - const body: { payload?: { hook_event_name?: unknown } } = JSON.parse(String(call[1]?.body)) - return typeof body.payload?.hook_event_name === 'string' ? body.payload.hook_event_name : '' - }) -} - -async function flushPosts(): Promise { - for (let i = 0; i < 20; i++) { - await Promise.resolve() - } -} - -function assistantMessage(text: string): { message: Record } { - return { message: { role: 'assistant', content: [{ type: 'text', text }] } } -} - -// Nested settlement can start the next run first; completion tracking must remain per-run rather than one resettable latch. -describe('a follow-up run started from another extension settlement', () => { - it('still reports the follow-up run completion', async () => { - const harness = createAgentStatusExtensionHarness({ kind: 'pi' }) - const context = { isIdle: vi.fn(() => true) } - - await harness.callHook('agent_start', undefined, context) - await harness.callHook('agent_end', undefined, context) - await harness.callHook('agent_settled', undefined, context) - await flushPosts() - expect(postedHookNames(harness.fetchMock)).toEqual(['agent_start', 'agent_end']) - - await harness.callHook('agent_start', undefined, context) - await harness.callHook('message_end', assistantMessage('all done'), context) - await harness.callHook('agent_end', undefined, context) - await harness.callHook('agent_start', undefined, context) - await harness.callHook('agent_settled', undefined, context) - await harness.callHook('message_end', assistantMessage('nothing durable to save'), context) - await harness.callHook('agent_end', undefined, context) - await harness.callHook('agent_settled', undefined, context) - await flushPosts() - - const posted = postedHookNames(harness.fetchMock) - expect(posted.at(-1), `posted: ${posted.join(' -> ')}`).toBe('agent_end') - }) -}) diff --git a/src/main/rate-limits/providers/auth-filesystem-operation-retention.test.ts b/src/main/rate-limits/providers/auth-filesystem-operation-retention.test.ts deleted file mode 100644 index a1c6b8c2171..00000000000 --- a/src/main/rate-limits/providers/auth-filesystem-operation-retention.test.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { getEventListeners } from 'node:events' -import { describe, expect, it } from 'vitest' -import { - createAuthFilesystemOperation, - type SharedAuthFilesystemOperation -} from './auth-filesystem-operation' - -function pendingOperation(): { - operation: SharedAuthFilesystemOperation - resolve: (value: string) => void - reject: (reason: unknown) => void - rawCalls: () => number -} { - let resolve = (_value: string): void => {} - let reject = (_reason: unknown): void => {} - let calls = 0 - const operation = createAuthFilesystemOperation('auth-retention-fixture', () => { - calls += 1 - return new Promise((resolveRaw, rejectRaw) => { - resolve = resolveRaw - reject = rejectRaw - }) - }) - return { - operation, - resolve: (value) => resolve(value), - reject: (reason) => reject(reason), - rawCalls: () => calls - } -} - -async function abortWait( - operation: SharedAuthFilesystemOperation -): Promise> { - const controller = new AbortController() - const reason = new Error('Auth poll expired') - const weakReason = new WeakRef(reason) - const result = operation.wait(controller.signal) - controller.abort(reason) - await result.catch((error: unknown) => { - if (error !== reason) { - throw new Error('Abort reason identity changed') - } - }) - expect(getEventListeners(controller.signal, 'abort')).toHaveLength(0) - return weakReason -} - -describe('shared auth filesystem wait lifetime', () => { - it('preserves a live sibling and forwards raw failure identity to later waits', async () => { - const pending = pendingOperation() - const controller = new AbortController() - const live = pending.operation.wait(controller.signal) - await Promise.resolve() - await abortWait(pending.operation) - const reason = new Error('Raw filesystem failure') - const rejected = expect(live).rejects.toBe(reason) - pending.reject(reason) - await rejected - await expect(pending.operation.wait(controller.signal)).rejects.toBe(reason) - expect(pending.rawCalls()).toBe(1) - expect(getEventListeners(controller.signal, 'abort')).toHaveLength(0) - }) -}) diff --git a/src/main/runtime/agent-session/lifecycle/structured-agent-cli-writers.test.ts b/src/main/runtime/agent-session/lifecycle/structured-agent-cli-writers.test.ts deleted file mode 100644 index 96a6385431a..00000000000 --- a/src/main/runtime/agent-session/lifecycle/structured-agent-cli-writers.test.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { describe, expect, it } from 'vitest' -import type { AgentStatusIpcPayload } from '../../../../shared/agent-status/contracts/agent-status-ipc-payload' -import { assertCliConversationWritersExited } from './structured-agent-cli-writers' - -const row: AgentStatusIpcPayload = { - paneKey: 'source', - worktreeId: 'workspace', - connectionId: null, - agentType: 'claude', - receivedAt: 1, - stateStartedAt: 1, - state: 'done', - prompt: '', - providerSession: { key: 'session_id', id: 'conversation' } -} -const conflict = { - refusal: { code: 'agent_session_conflict', details: { reason: 'conversationHeldElsewhere' } } -} - -describe('canonical status store conversation admission', () => { - // The source terminal's own agent stops with the close that follows, so it is no other writer. - it('leaves out the panes the caller closes, by key or by their PTY, unless a shared server holds it', async () => { - const ptys: Record = { 'tab-1:leaf': 'pty-1', 'legacy-1': 'pty-1' } - const admit = ( - rows: AgentStatusIpcPayload[], - topology: 'pane-owned' | 'shared' = 'pane-owned' - ) => - assertCliConversationWritersExited( - { - rows: () => rows, - observation: () => ({ current: () => true, presence: async () => 'live', topology }), - ptyResolver: () => (paneKey) => ptys[paneKey] ?? null - }, - 'claude', - 'conversation', - ['tab-1:leaf'] - ) - await expect(admit([{ ...row, paneKey: 'tab-1:leaf' }])).resolves.toBeUndefined() - await expect(admit([{ ...row, paneKey: 'legacy-1' }])).resolves.toBeUndefined() - await expect(admit([{ ...row, paneKey: 'tab-2:leaf' }])).rejects.toMatchObject(conflict) - await expect(admit([{ ...row, paneKey: 'tab-1:leaf' }], 'shared')).rejects.toMatchObject( - conflict - ) - }) - - // Many terminals can name one conversation: a check starts only a few probes at once, and none - // once a holder refused. - - // Every create, resume and acquire runs this check: resolving panes for nothing to leave out, or - // scanning every terminal for each row, would grow with rows times terminals. -}) diff --git a/src/main/runtime/mobile-cloud-relay/director/relay-http-client.test.ts b/src/main/runtime/mobile-cloud-relay/director/relay-http-client.test.ts deleted file mode 100644 index 81c3b670c72..00000000000 --- a/src/main/runtime/mobile-cloud-relay/director/relay-http-client.test.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' - -import { RelayAssignRateGate } from './relay-assign-rate-gate' -import { requestRelayAssignment } from './relay-http-client' - -type AssignInput = Parameters[0] - -function assignSuccessResponse(): Response { - return Response.json({ - v: 1, - cellUrl: 'https://relay-c1.example', - assignmentEpoch: 4, - lease: 'lease-jwt' - }) -} - -function fakeAssignClock(onSleep?: () => void) { - let now = 1_000_000 - const sleeps: number[] = [] - return { - sleeps, - advance: (ms: number): void => { - now += ms - }, - options: { - now: () => now, - random: () => 0, - sleep: async (ms: number): Promise => { - sleeps.push(ms) - now += ms - onSleep?.() - } - } - } -} - -describe('relay assignment rate gate', () => { - const request = ( - input: Partial & Pick - ): Promise => - requestRelayAssignment({ - directorUrl: 'https://relay.example', - relayToken: 'scoped-token', - relayHostId: 'AbCdEf0123_-xyZ9', - ...input - }) - - it('keeps a Retry-After hint past the retry timer the coordinator cancels', async () => { - const clock = fakeAssignClock() - const assignRateGate = new RelayAssignRateGate(clock.options) - const fetch = vi - .fn() - .mockResolvedValueOnce(new Response(null, { status: 429, headers: { 'retry-after': '30' } })) - .mockResolvedValueOnce(assignSuccessResponse()) - - await expect(request({ fetch, assignRateGate })).rejects.toThrow('relay_assignment_failed_429') - // Reconcile resets retry timers; the gate must retain long Retry-After and fail inline with the remainder. - clock.advance(6_000) - await expect(request({ fetch, assignRateGate })).rejects.toMatchObject({ - statusCode: 429, - retryAfterMs: 24_000 - }) - expect(clock.sleeps).toEqual([]) - expect(fetch).toHaveBeenCalledTimes(1) - - clock.advance(25_000) - await request({ fetch, assignRateGate }) - expect(fetch).toHaveBeenCalledTimes(2) - }) -}) diff --git a/src/main/runtime/orchestration/db/federation/federation-acknowledgment-migration.test.ts b/src/main/runtime/orchestration/db/federation/federation-acknowledgment-migration.test.ts deleted file mode 100644 index 4927df682c2..00000000000 --- a/src/main/runtime/orchestration/db/federation/federation-acknowledgment-migration.test.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { mkdtempSync, rmSync } from 'node:fs' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { afterEach, describe, expect, it } from 'vitest' -import Database from '../../../../sqlite/sync-database' -import { dropDerivedDeliverySchema } from '../schema/derived-delivery-test-fixture' -import { OrchestrationDb } from '../orchestration-db' -import { SCHEMA_VERSION } from '../contract-constants' -import '../messages/mailbox-routing-page' -import '../dispatch-row-writer' -import '../attempt-outcome-projection' -import { resolveOrchestrationMigrationStartVersion } from '../schema/orchestration-schema-version-skew' - -describe('federation acknowledgment migration', () => { - let db: OrchestrationDb | undefined - let tempDir: string | undefined - - afterEach(() => { - db?.close() - if (tempDir) { - rmSync(tempDir, { recursive: true, force: true }) - } - }) - - it('adds a zeroed durable acknowledgment watermark to v26 dispatches', () => { - tempDir = mkdtempSync(join(tmpdir(), 'orca-federation-ack-migration-')) - const dbPath = join(tempDir, 'orchestration.db') - db = new OrchestrationDb(dbPath) - db.close() - db = undefined - - const oldDb = new Database(dbPath) - dropDerivedDeliverySchema(oldDb) - oldDb.exec('ALTER TABLE federated_dispatches DROP COLUMN to_home_acknowledged_sequence') - oldDb.pragma('user_version = 26') - expect(resolveOrchestrationMigrationStartVersion(oldDb, 26, 28)).toBe(26) - oldDb - .prepare( - `INSERT INTO federated_dispatches ( - dispatch_id, environment_id, environment_name, peer_fingerprint, - protocol_version, to_home_imported_sequence - ) VALUES ('ctx_migrated', 'env', 'worker', 'peer', 3, 2)` - ) - .run() - oldDb.close() - - db = new OrchestrationDb(dbPath) - const sqlite = (db as unknown as { db: Database.Database }).db - - expect(sqlite.pragma('user_version', { simple: true })).toBe(SCHEMA_VERSION) - expect(db.getFederatedDispatch('ctx_migrated')).toMatchObject({ - to_home_imported_sequence: 2, - to_home_acknowledged_sequence: 0 - }) - }) -}) diff --git a/src/main/runtime/orchestration/db/messages/mailbox-pointer-release-query.test.ts b/src/main/runtime/orchestration/db/messages/mailbox-pointer-release-query.test.ts deleted file mode 100644 index 64d7c43777f..00000000000 --- a/src/main/runtime/orchestration/db/messages/mailbox-pointer-release-query.test.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { OrchestrationDb } from '../orchestration-db' -import '../contract-constants' -import './mailbox-routing-page' -import '../dispatch-row-writer' -import '../attempt-outcome-projection' - -describe('PTY mailbox reservation cleanup', () => { - it('uses a PTY lookup and preserves reservation settlement semantics', () => { - const db = new OrchestrationDb(':memory:') - try { - const seed = db.db.prepare(`INSERT INTO messages - (id, from_handle, to_handle, subject, read, pointer_enter_pending, - pointer_pty_id, pointer_process_incarnation, delivered_at) - VALUES (?, 'sender', 'recipient', 'test', ?, ?, ?, 'incarnation', ?)`) - db.db.exec('BEGIN') - for (let i = 0; i < 1000; i++) { - seed.run(`history-${i}`, 1, 0, null, null) - } - seed.run('reserved', 0, 1, 'target', '2026-01-01 00:00:00') - seed.run('written', 0, 2, 'target', null) - seed.run('entered', 0, 3, 'target', null) - seed.run('read', 1, 2, 'target', '2026-01-01 00:00:00') - seed.run('other', 0, 1, 'other-pty', null) - db.db.exec('COMMIT') - db.releasePendingMailboxPointerForPty('target') - const read = (id: string) => db.db.prepare('SELECT * FROM messages WHERE id = ?').get(id) - for (const id of ['reserved', 'written', 'entered', 'read']) { - expect(read(id)).toMatchObject({ - pointer_enter_pending: 0, - pointer_pty_id: null, - pointer_process_incarnation: null - }) - } - expect(read('reserved')).toMatchObject({ delivered_at: null, read: 0 }) - expect(read('written')).toMatchObject({ delivered_at: expect.any(String), read: 0 }) - expect(read('entered')).toMatchObject({ delivered_at: expect.any(String), read: 0 }) - expect(read('read')).toMatchObject({ delivered_at: '2026-01-01 00:00:00', read: 1 }) - expect(read('other')).toMatchObject({ pointer_enter_pending: 1, pointer_pty_id: 'other-pty' }) - expect(read('history-0')).toMatchObject({ read: 1, delivered_at: null }) - } finally { - db.close() - } - }) -}) diff --git a/src/main/runtime/push/notifications/mobile-notification-dismissal-read-failure.test.ts b/src/main/runtime/push/notifications/mobile-notification-dismissal-read-failure.test.ts deleted file mode 100644 index cdf2851868b..00000000000 --- a/src/main/runtime/push/notifications/mobile-notification-dismissal-read-failure.test.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { mkdtempSync, rmSync } from 'node:fs' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { expect, it, vi } from 'vitest' -import type * as SyncDatabaseModule from '../../../sqlite/sync-database' -import { MobileNotificationDismissalStore } from './mobile-notification-dismissal-store' - -const failure = vi.hoisted(() => ({ remainingOpens: 0 })) -vi.mock('../../../sqlite/sync-database', async (original) => { - const actual = await original() - class FailingOpen extends actual.default { - constructor(...args: ConstructorParameters) { - if (failure.remainingOpens > 0) { - failure.remainingOpens -= 1 - throw Object.assign(new Error('read failed'), { code: 'EIO' }) - } - super(...args) - } - } - return { ...actual, default: FailingOpen } -}) - -it('keeps history it could not read and merges dismissals recorded meanwhile', async () => { - const dir = mkdtempSync(join(tmpdir(), 'push-comment-')) - const dismiss = (notificationId: string, notificationSeq: number) => ({ - type: 'dismiss' as const, - notificationId, - notificationEpoch: 'epoch', - notificationSeq - }) - try { - const store = new MobileNotificationDismissalStore(dir) - store.record(dismiss('old', 1)) - await store.close() - // The startup read fails; close() retries it and saves what was recorded meanwhile. - failure.remainingOpens = 1 - vi.spyOn(console, 'warn').mockImplementation(() => {}) - const restarted = new MobileNotificationDismissalStore(dir) - expect(restarted.hasLiveDelivery('anything')).toBe(true) - restarted.record(dismiss('new', 2)) - await restarted.close() - - const recovered = new MobileNotificationDismissalStore(dir) - await recovered.close() - const shown = (notificationId: string) => ({ - notificationId, - notificationEpoch: 'epoch', - notificationSeq: 1 - }) - expect(recovered.reconcile([shown('old'), shown('new')])).toEqual([shown('old'), shown('new')]) - } finally { - vi.restoreAllMocks() - rmSync(dir, { recursive: true, force: true }) - } -}) diff --git a/src/main/runtime/repositories/runtime-repo-update-worktree-refresh.test.ts b/src/main/runtime/repositories/runtime-repo-update-worktree-refresh.test.ts deleted file mode 100644 index 58b909b7712..00000000000 --- a/src/main/runtime/repositories/runtime-repo-update-worktree-refresh.test.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import '../orca-runtime-tests/orca-runtime-test-lifecycle.spec' -import '../orca-runtime-tests/runtime-test-module-registration.spec' -import { OrcaRuntimeService } from '../orca-runtime' -import { listWorktrees } from '../../git/worktrees/catalog/worktree-scan-cache' -import { - TEST_REPO_ID, - TEST_REPO_PATH, - makeWorktreeInfo, - store -} from '../orca-runtime-tests/orca-runtime-test-fixtures.spec' -import type { Repo } from '../../../shared/repository/repo-types' -import type { RuntimeClientEvent } from '../../../shared/remote-runtime/session-graph/runtime-client-events' - -const externalPath = '/tmp/elsewhere/external' - -async function createScannedRuntime() { - let repo: Repo = { ...store.getRepos()[0], externalWorktreeVisibility: 'hide' } - const runtime = new OrcaRuntimeService({ - ...store, - getRepo: (id: string) => (id === repo.id ? repo : undefined), - getRepos: () => [repo], - updateRepo: (_target: Repo, updates: Partial) => { - repo = { ...repo, ...updates } - return repo - } - }) - vi.mocked(listWorktrees).mockClear() - vi.mocked(listWorktrees).mockResolvedValue([ - makeWorktreeInfo(TEST_REPO_PATH), - makeWorktreeInfo(externalPath) - ]) - const events: RuntimeClientEvent[] = [] - runtime.onClientEvent((event) => events.push(event)) - const isExternalVisible = async () => - (await runtime.listDetectedManagedWorktrees(`id:${TEST_REPO_ID}`)).worktrees.find( - (worktree) => worktree.path === externalPath - )?.visible - expect(await isExternalVisible()).toBe(false) - return { runtime, events, isExternalVisible } -} - -describe('repo.update worktree refresh', () => { - it('re-lists a newly shown external worktree without rescanning Git', async () => { - const { runtime, events, isExternalVisible } = await createScannedRuntime() - - await runtime.updateRepo(`id:${TEST_REPO_ID}`, { externalWorktreeVisibility: 'show' }) - - expect(events).toContainEqual({ type: 'worktreesChanged', repoId: TEST_REPO_ID }) - expect(await isExternalVisible()).toBe(true) - expect(listWorktrees).toHaveBeenCalledTimes(1) - }) -}) diff --git a/src/main/runtime/rpc/methods/orchestration/worker/release/worker-release-mobile-report.test.ts b/src/main/runtime/rpc/methods/orchestration/worker/release/worker-release-mobile-report.test.ts deleted file mode 100644 index 15258350c4d..00000000000 --- a/src/main/runtime/rpc/methods/orchestration/worker/release/worker-release-mobile-report.test.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { afterEach, beforeEach, expect, it, vi } from 'vitest' -import { createOrchestrationWorkerReleaseHarness } from '../testing/worker-release.test-support' - -import { registerBoundPty } from '../../../../../orca-runtime-tests/bind-first-pane.test-fixture' - -const h = createOrchestrationWorkerReleaseHarness() -beforeEach(() => h.setup()) -afterEach(() => h.cleanup()) - -// Boot-wait Keep open must find custody written at terminal creation, or a later release closes a kept pane (#19337, #19608). -it('a phone Keep open during the boot wait keeps the pane and fences the later release', async () => { - const gate = h.deferred() - vi.spyOn(h.runtime, 'waitForTerminal').mockReturnValue(gate.promise as never) - const task = h.db.createTask({ spec: 'mid-boot phone takeover', runId: h.activeRunId }) - const start = h.call('orchestration.workerStart', { - task: task.id, - from: 'term_coord', - agent: 'codex' - }) - await vi.waitFor(() => expect(h.runtime.waitForTerminal).toHaveBeenCalled()) - const dispatchId = ( - h.db.db.prepare("SELECT dispatch_id FROM worker_dispatches WHERE state = 'starting'").get() as { - dispatch_id: string - } - ).dispatch_id - - h.runtime.registerPreAllocatedHandleForPty('pty-worker', 'term_worker') - registerBoundPty(h.runtime, 'pty-worker', 'repo::worktree', null, { - tabId: 'tab_worker', - leafId: 'bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb' - }) - vi.mocked(h.runtime.getTerminalPaneKey).mockRestore() - await expect( - h.call('orchestration.workerKeepOpen', { terminal: 'term_worker', keep: true }) - ).resolves.toEqual({ autoClose: { kept: true } }) - - gate.resolve({ - handle: 'term_worker', - condition: 'tui-idle', - satisfied: true, - status: 'running', - exitCode: null - }) - await expect(start).resolves.toMatchObject({ state: 'ready' }) - - h.settle(task.id, dispatchId, 'succeeded') - await expect( - h.call('orchestration.workerRelease', { dispatch: dispatchId }) - ).resolves.toMatchObject({ state: 'retained', reason: 'user_kept', processAction: 'none' }) - expect(h.runtime.closeTerminal).not.toHaveBeenCalled() -}) diff --git a/src/main/runtime/rpc/methods/workspaces/worktree-runtime-routing.test.ts b/src/main/runtime/rpc/methods/workspaces/worktree-runtime-routing.test.ts deleted file mode 100644 index 26ea12540a0..00000000000 --- a/src/main/runtime/rpc/methods/workspaces/worktree-runtime-routing.test.ts +++ /dev/null @@ -1,53 +0,0 @@ -import '../../../../../shared/native-chat/every-agent-chat.test-fixture' -import { describe, expect, it, vi } from 'vitest' -import { RpcDispatcher } from '../../dispatcher' -import type { RpcRequest } from '../../core' -import type { OrcaRuntimeService } from '../../../orca-runtime' -import { WORKTREE_METHODS } from './worktree' -import '../../../../../shared/remote-runtime/protocol/protocol-version' -import '../../../../../shared/remote-runtime/protocol/worktree-runtime-capabilities' - -import '../../../../../shared/remote-runtime/protocol/electron-remote-runtime-client-capabilities' - -describe('worktree.rm host qualification', () => { - function makeRuntime(repoHostIds: (string | undefined)[] = ['local']): OrcaRuntimeService { - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: this fixture supplies every runtime member reached by the requests in this suite. - return { - getRuntimeId: () => 'test-runtime', - listRepos: () => - repoHostIds.map((executionHostId) => ({ - id: 'repo-1', - path: '/repo', - executionHostId - })), - showManagedWorktree: vi.fn().mockResolvedValue({ id: 'wt-1', hostId: 'local' }), - removeManagedWorktree: vi.fn().mockResolvedValue({}) - } as unknown as OrcaRuntimeService - } - - const WORKTREE_ID = 'repo-1::/repo/wt' - - function makeRequest(params: unknown): RpcRequest { - return { id: 'req-1', authToken: 'tok', method: 'worktree.rm', params } - } - - it('fails closed when the repo id carries both spellings', async () => { - const runtime = makeRuntime(['local', 'runtime:env-1']) - const dispatcher = new RpcDispatcher({ runtime, methods: WORKTREE_METHODS }) - - const response = await dispatcher.dispatch( - makeRequest({ - worktree: `id:${WORKTREE_ID}`, - hostId: 'runtime:env-1', - force: true, - runHooks: false - }) - ) - - expect(response).toMatchObject({ - ok: false, - error: { message: expect.stringContaining('ambiguous across hosts') } - }) - expect(runtime.removeManagedWorktree).not.toHaveBeenCalled() - }) -}) diff --git a/src/main/runtime/sidebar-inputs/sidebar-clock.test.ts b/src/main/runtime/sidebar-inputs/sidebar-clock.test.ts deleted file mode 100644 index b4e0058c984..00000000000 --- a/src/main/runtime/sidebar-inputs/sidebar-clock.test.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { SidebarClock } from './sidebar-clock' - -describe('SidebarClock', () => { - beforeEach(() => { - vi.useFakeTimers() - vi.setSystemTime(0) - }) - afterEach(() => { - vi.useRealTimers() - }) - - it('arms one timer for the earliest of every pending deadline', () => { - const clock = new SidebarClock() - const fired: string[] = [] - clock.schedule('late', 300, () => fired.push('late')) - clock.schedule('early', 100, () => fired.push('early')) - clock.schedule('mid', 200, () => fired.push('mid')) - expect(vi.getTimerCount()).toBe(1) - vi.advanceTimersByTime(100) - expect(fired).toEqual(['early']) - expect(vi.getTimerCount()).toBe(1) - vi.advanceTimersByTime(200) - expect(fired).toEqual(['early', 'mid', 'late']) - expect(vi.getTimerCount()).toBe(0) - }) - - it('replaces a key, cancels it, and lets a fire schedule its next deadline', () => { - const clock = new SidebarClock() - const fired: number[] = [] - clock.schedule('a', 100, () => fired.push(1)) - clock.schedule('a', 50, () => fired.push(2)) - vi.advanceTimersByTime(60) - expect(fired).toEqual([2]) - - clock.schedule('b', 500, () => fired.push(3)) - clock.cancel('b') - expect(vi.getTimerCount()).toBe(0) - - const tick = (): void => { - fired.push(4) - if (fired.filter((n) => n === 4).length < 3) { - clock.schedule('tick', Date.now() + 10, tick) - } - } - clock.schedule('tick', Date.now() + 10, tick) - vi.advanceTimersByTime(100) - expect(fired.filter((n) => n === 4)).toHaveLength(3) - expect(vi.getTimerCount()).toBe(0) - }) - - it('keeps firing the rest when one deadline throws', () => { - const clock = new SidebarClock() - const error = vi.spyOn(console, 'error').mockImplementation(() => {}) - const fired: string[] = [] - clock.schedule('bad', 10, () => { - throw new Error('boom') - }) - clock.schedule('good', 10, () => fired.push('good')) - vi.advanceTimersByTime(10) - expect(fired).toEqual(['good']) - expect(error).toHaveBeenCalledOnce() - error.mockRestore() - }) -}) diff --git a/src/main/runtime/terminal/output/headless-terminal-dispose-write-ordering.test.ts b/src/main/runtime/terminal/output/headless-terminal-dispose-write-ordering.test.ts deleted file mode 100644 index 496bb51d4d5..00000000000 --- a/src/main/runtime/terminal/output/headless-terminal-dispose-write-ordering.test.ts +++ /dev/null @@ -1,59 +0,0 @@ -/** Delete the emulator map entry before disposal so new writes create a fresh emulator. - * Chain disposal after all queued parses; reversing either order silently loses output. */ -import { afterEach, describe, expect, it, vi } from 'vitest' -import { OrcaRuntimeService } from '../../orca-runtime' - -const store = { - getRepo: () => undefined, - getRepos: () => [], - addRepo: () => {}, - updateRepo: () => undefined as never, - getAllWorktreeMeta: () => ({}), - getWorktreeMeta: () => undefined, - setWorktreeMeta: () => undefined as never, - removeWorktreeMeta: () => {}, - getRetiredWorktreeNameRegistry: () => ({ exhaustedTiers: 0, names: [] }), - addRetiredWorktreeName: () => {}, - mergeRetiredWorktreeNames: () => false, - getGitHubCache: () => ({ pr: {}, issue: {} }) as never, - getSettings: () => ({ - workspaceDir: '/tmp/workspaces', - nestWorkspaces: false, - refreshLocalBaseRefOnWorktreeCreate: false, - branchPrefix: 'none', - branchPrefixCustom: '', - terminalMainSideEffectAuthority: true - }) -} - -const PTY_ID = 'pty-dispose-ordering' - -function createRuntime(): OrcaRuntimeService { - const runtime = new OrcaRuntimeService(store) - runtime.setPtyController({ - write: () => true, - kill: () => true, - getForegroundProcess: async () => null, - getSize: () => ({ cols: 80, rows: 24 }), - resize: () => true - }) - return runtime -} - -describe('disposeHeadlessTerminal write ordering', () => { - afterEach(() => { - vi.restoreAllMocks() - }) - - it('leaves the post-disposal emulator holding only post-disposal output', async () => { - const runtime = createRuntime() - runtime.onPtyData(PTY_ID, 'QUEUED-BEFORE-DISPOSE\r\n', 1) - runtime.preparePtyExecutionContext(PTY_ID, null, { resetIncarnation: true }) - runtime.onPtyData(PTY_ID, 'ISSUED-AFTER-DISPOSE\r\n', 2) - - const snapshot = await runtime.serializeHiddenOutputRecoveryBuffer(PTY_ID) - const painted = `${snapshot?.scrollbackAnsi ?? ''}${snapshot?.data ?? ''}` - expect(painted).toContain('ISSUED-AFTER-DISPOSE') - expect(painted).not.toContain('QUEUED-BEFORE-DISPOSE') - }) -}) diff --git a/src/main/startup/configure-process-macports-path.test.ts b/src/main/startup/configure-process-macports-path.test.ts deleted file mode 100644 index d343e73a3ce..00000000000 --- a/src/main/startup/configure-process-macports-path.test.ts +++ /dev/null @@ -1,53 +0,0 @@ -import type * as NodeFs from 'node:fs' -import { afterEach, describe, expect, it, vi } from 'vitest' -import { getSystemCliInstallDirectories } from '../../shared/shell/command-resolution/system-cli-install-dirs' -import { patchPackagedProcessPath } from './configure-process' - -const fsFixture = vi.hoisted(() => ({ macPortsInstalled: false })) - -vi.mock('node:fs', async (importOriginal) => { - const actual = await importOriginal() - return { - ...actual, - existsSync: (path: string) => - path === '/opt/local/bin/port' ? fsFixture.macPortsInstalled : actual.existsSync(path) - } -}) - -vi.mock('electron', () => ({ app: { isPackaged: true } })) - -describe('patchPackagedProcessPath MacPorts seed', () => { - const originalPlatform = Object.getOwnPropertyDescriptor(process, 'platform') - - function seedDarwinPath(): string[] { - vi.stubEnv('HOME', '/Users/tester') - vi.stubEnv('PATH', '/usr/bin:/bin') - patchPackagedProcessPath() - return (process.env.PATH ?? '').split(':') - } - - afterEach(() => { - fsFixture.macPortsInstalled = false - vi.unstubAllEnvs() - if (originalPlatform) { - Object.defineProperty(process, 'platform', originalPlatform) - } - }) - - it('seeds /opt/local last only when default-prefix port exists', () => { - Object.defineProperty(process, 'platform', { configurable: true, value: 'darwin' }) - const withoutMacPorts = seedDarwinPath() - expect(withoutMacPorts).not.toContain('/opt/local/bin') - - fsFixture.macPortsInstalled = true - const segments = seedDarwinPath() - // Appending only, so no existing binary resolves differently once MacPorts is installed. - expect(segments).toEqual([...withoutMacPorts, '/opt/local/bin', '/opt/local/sbin']) - // Lookup fallback must resolve a CLI in two system dirs the same way the seeded PATH does. - const offsets = getSystemCliInstallDirectories('darwin', '/Users/tester').map((directory) => - segments.indexOf(directory) - ) - expect(offsets.every((offset) => offset >= 0)).toBe(true) - expect([...offsets].sort((a, b) => a - b)).toEqual(offsets) - }) -}) diff --git a/src/main/usage/rollups/usage-breakdown-scaling.test.ts b/src/main/usage/rollups/usage-breakdown-scaling.test.ts deleted file mode 100644 index bfacf68788d..00000000000 --- a/src/main/usage/rollups/usage-breakdown-scaling.test.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { expect, it } from 'vitest' -import { createUsageEventAggregation } from './usage-event-aggregation' -import type { UsageAttributedEventFields } from './usage-rollup-records' - -type Event = UsageAttributedEventFields & { cost: number } -const aggregation = createUsageEventAggregation({ - metric: { - empty: () => ({ cost: 0 }), - fromEvent: (event) => ({ cost: event.cost }), - fold: (target, source) => { - target.cost += source.cost - } - }, - cloneSessionForMerge: (session) => structuredClone(session) -}) - -function events(count: number): Event[] { - return Array.from({ length: count }, (_, index) => ({ - sessionId: 'session', - timestamp: '2026-09-07T00:00:00Z', - day: '2026-09-07', - model: `model-${index % 5}`, - projectKey: `path-${index}`, - projectLabel: `Path ${index}`, - repoId: null, - worktreeId: null, - inputTokens: 1, - cachedInputTokens: 0, - outputTokens: 2, - reasoningOutputTokens: 0, - totalTokens: 3, - cost: 0.5 - })) -} - -// Index newly appended rows too or later sources append duplicate location/model entries. -it('folds later sources into rows the merge itself appended', () => { - const [first] = events(1) - first.projectKey = 'new-location' - first.projectLabel = 'New location' - first.model = 'new-model' - const incoming = aggregation.aggregate([first]).sessions[0] - const existingOnly = events(1) - existingOnly[0].projectKey = 'other' - const existing = aggregation.aggregate(existingOnly).sessions[0] - aggregation.mergeSessions(new Map([['session', existing]]), [incoming, structuredClone(incoming)]) - const rows = existing.locationBreakdown.filter((entry) => entry.locationKey === 'new-location') - expect(rows.map((entry) => entry.eventCount)).toEqual([2]) - const models = existing.modelBreakdown.filter((entry) => entry.modelKey === 'new-model') - expect(models.map((entry) => entry.eventCount)).toEqual([2]) - const tuples = existing.locationModelBreakdown.filter( - (entry) => entry.locationKey === 'new-location' && entry.modelKey === 'new-model' - ) - expect(tuples.map((entry) => entry.eventCount)).toEqual([2]) -}) diff --git a/src/renderer/src/components/browser-pane/workspace-doc/use-doc-preview-guest-tools.test.ts b/src/renderer/src/components/browser-pane/workspace-doc/use-doc-preview-guest-tools.test.ts deleted file mode 100644 index 1d62ac33de7..00000000000 --- a/src/renderer/src/components/browser-pane/workspace-doc/use-doc-preview-guest-tools.test.ts +++ /dev/null @@ -1,182 +0,0 @@ -// @vitest-environment happy-dom -// Use stable browser page IDs for tools and annotations; re-mint replaces the guest without renaming its surface. -import { act, createElement, useRef } from 'react' -import { createRoot, type Root } from 'react-dom/client' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { BrowserGrabPayload } from '../../../../../shared/browser/element-grab/browser-grab-types' -import { BROWSER_ANNOTATION_VIEWPORT_MESSAGE_PREFIX } from '../../../../../shared/browser/annotations/browser-annotation-viewport-bridge' -import { makeAnnotation } from '@/store/slices/browser/annotations/browser-annotation-test-fixture' -import { getBrowserOverlayAnchor } from '../describe-page/browser-annotation-geometry' -import { attachDocPreviewWebview } from './doc-preview-webview-attach' - -type GuestToolCalls = { - annotationSend: { browserTabId: string }[] - grabAnnotations: { browserTabId: string; toolTargetId: string }[] - grabMode: string[] - viewportBridge: { toolTargetId: string; token: string }[] -} - -const calls = vi.hoisted(() => ({ - annotationSend: [], - grabAnnotations: [], - grabMode: [], - viewportBridge: [] -})) - -let pendingPayload: BrowserGrabPayload | null = null - -vi.mock('@/components/browser-pane/annotate/delivery/use-browser-page-annotation-send', () => ({ - useBrowserPageAnnotationSend: (args: { browserTabId: string }) => { - calls.annotationSend.push({ browserTabId: args.browserTabId }) - return { browserAnnotations: [] } - } -})) - -vi.mock('@/components/browser-pane/annotate/grab/use-browser-page-grab-annotations', () => ({ - useBrowserPageGrabAnnotations: (args: { browserTabId: string; toolTargetId: string }) => { - calls.grabAnnotations.push({ - browserTabId: args.browserTabId, - toolTargetId: args.toolTargetId - }) - return { - pendingAnnotationPayload: pendingPayload, - grabIntent: null, - startGrabIntent: () => undefined - } - } -})) - -vi.mock('@/components/browser-pane/annotate/capture/use-browser-page-markup-capture', () => ({ - useBrowserPageMarkupCapture: () => ({ isActive: false }) -})) - -vi.mock('@/components/browser-pane/annotate/grab/useGrabMode', () => ({ - useGrabMode: (toolTargetId: string) => { - calls.grabMode.push(toolTargetId) - return { state: 'idle' } - } -})) - -vi.mock('@/components/browser-pane/annotate/viewport/guest-annotation-viewport-bridge', () => ({ - syncGuestAnnotationViewportBridge: (args: { toolTargetId: string; token: string }) => { - calls.viewportBridge.push({ toolTargetId: args.toolTargetId, token: args.token }) - } -})) - -vi.mock('@/hooks/useShortcutLabel', () => ({ useShortcutLabel: () => 'G' })) - -import { useDocPreviewGuestTools } from './use-doc-preview-guest-tools' - -const PREVIEW_ID = 'browser-page-9f2c' -const FIRST_GRANT = 'a'.repeat(32) - -function Harness({ grantId }: { grantId: string | null }): null { - const webviewRef = useRef(null) - const containerRef = useRef(null) - latestTools = useDocPreviewGuestTools({ - previewId: PREVIEW_ID, - worktreeId: 'wt-1', - grantId, - webviewRef: webviewRef as never, - containerRef: containerRef as never, - toolsReady: true - }) - return null -} - -let container: HTMLDivElement -let root: Root -let latestTools: ReturnType | null = null - -function currentTools(): ReturnType { - if (!latestTools) { - throw new Error('preview tools not rendered') - } - return latestTools -} - -function render(grantId: string | null): void { - act(() => { - root.render(createElement(Harness, { grantId })) - }) -} - -beforeEach(() => { - vi.stubGlobal('IS_REACT_ACT_ENVIRONMENT', true) - calls.annotationSend.length = 0 - calls.grabAnnotations.length = 0 - calls.grabMode.length = 0 - calls.viewportBridge.length = 0 - pendingPayload = null - latestTools = null - container = document.createElement('div') - document.body.appendChild(container) - root = createRoot(container) -}) - -afterEach(() => { - act(() => root.unmount()) - container.remove() - vi.unstubAllGlobals() -}) - -describe('useDocPreviewGuestTools ids', () => { - it('moves the pending card from a live report after inner scroll and removes the listener on detach', () => { - const selected = makeAnnotation(PREVIEW_ID).payload - selected.page.viewportWidth = 900 - selected.target.rectPage = { x: 40, y: 300, width: 120, height: 30 } - selected.target.rectViewport = { x: 40, y: 300, width: 120, height: 30 } - pendingPayload = selected - render(FIRST_GRANT) - const token = calls.viewportBridge.at(-1)?.token - expect(token).toBeTruthy() - - const previewContainer = document.createElement('div') - document.body.appendChild(previewContainer) - const attached = attachDocPreviewWebview({ - previewId: PREVIEW_ID, - container: previewContainer, - url: 'orca-preview://grant/index.html', - ariaLabel: 'HTML preview', - onLoadStarted: () => currentTools().resetBrowserOverlayViewport(), - onLoadStopped: vi.fn(), - onLoadFailed: vi.fn(), - onNavigated: vi.fn(), - onTitleUpdated: vi.fn(), - onViewportMessage: currentTools().handleAnnotationViewportMessage - }) - const pane = { - getBoundingClientRect: () => ({ left: 0, top: 0, width: 900, height: 900 }) - } - const cardY = (): number => - getBrowserOverlayAnchor(selected, pane, pane, currentTools().browserOverlayViewport).y - const send = (message: string): void => { - act(() => { - attached.webview.dispatchEvent(Object.assign(new Event('console-message'), { message })) - }) - } - - try { - expect(cardY()).toBe(330) - const report = JSON.stringify({ - scrollX: 0, - scrollY: 0, - viewportWidth: 900, - target: { x: 40, y: 120, width: 120, height: 30 } - }) - send(`${BROWSER_ANNOTATION_VIEWPORT_MESSAGE_PREFIX}wrong-token:${report}`) - expect(cardY()).toBe(330) - send(`${BROWSER_ANNOTATION_VIEWPORT_MESSAGE_PREFIX}${token}:${report}`) - expect(cardY()).toBe(150) - - act(() => attached.webview.dispatchEvent(new Event('did-start-loading'))) - expect(cardY()).toBe(330) - attached.detach() - send(`${BROWSER_ANNOTATION_VIEWPORT_MESSAGE_PREFIX}${token}:${report}`) - expect(cardY()).toBe(330) - } finally { - attached.detach() - previewContainer.remove() - } - }) -}) diff --git a/src/renderer/src/components/native-chat/session/terminal/read/use-native-chat-live-session-pending.test.ts b/src/renderer/src/components/native-chat/session/terminal/read/use-native-chat-live-session-pending.test.ts deleted file mode 100644 index 04c24fb1d2b..00000000000 --- a/src/renderer/src/components/native-chat/session/terminal/read/use-native-chat-live-session-pending.test.ts +++ /dev/null @@ -1,194 +0,0 @@ -import { acceptedAgentStatuses } from '@/store/slices/agent-status/accepted-agent-statuses' -// @vitest-environment happy-dom - -import { act, createElement } from 'react' -import { createRoot, type Root } from 'react-dom/client' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { NativeChatMessage } from '../../../../../../../shared/native-chat/native-chat-types' -import { useAppStore } from '@/store' - -const { resetTransport, subscriptions, transport } = vi.hoisted(() => { - const subscriptions: { onFrame: (frame: unknown) => void }[] = [] - const transport = { readSession: vi.fn(), subscribe: vi.fn() } - const resetTransport = (): void => { - subscriptions.splice(0) - // Hold the seed in flight so only emitted frames move the view. - transport.readSession.mockReset().mockImplementation(() => new Promise(() => {})) - transport.subscribe.mockReset().mockImplementation((_args, onFrame) => { - subscriptions.push({ onFrame }) - return vi.fn() - }) - } - return { resetTransport, subscriptions, transport } -}) - -vi.mock('./native-chat-session-transport', () => ({ - getNativeChatSessionTransport: () => transport -})) - -import { NOTFOUND_RETRY_WINDOW_MS, useNativeChatLiveSession } from './use-native-chat-live-session' -import type { - UseNativeChatLiveSessionArgs, - NativeChatLiveSession -} from './native-chat-live-session-contract' - -import { useNativeChatRetainedSession } from './use-native-chat-retained-session' - -const BASE_ARGS: UseNativeChatLiveSessionArgs = { - paneKey: 'tab-1:leaf-1', - agent: 'claude', - sessionId: 'session-1', - transcriptPath: '/home/agent/session-1.jsonl', - enabled: true -} - -const PENDING_FRAME = { type: 'snapshot', messages: [], hasMore: false, pending: true } - -function assistant(id: string): NativeChatMessage { - return { - id, - role: 'assistant', - blocks: [{ type: 'text', text: id }], - timestamp: 1, - source: 'transcript' - } -} - -describe('useNativeChatLiveSession — unflushed transcript (pending frame)', () => { - let root: Root - let latest: NativeChatLiveSession | null = null - - function Probe(props: UseNativeChatLiveSessionArgs): null { - latest = useNativeChatLiveSession(props) - return null - } - - async function render(props: UseNativeChatLiveSessionArgs = BASE_ARGS): Promise { - await act(async () => { - root.render(createElement(Probe, props)) - await Promise.resolve() - await Promise.resolve() - }) - } - - async function emit(frame: unknown): Promise { - await act(async () => { - subscriptions[0]?.onFrame(frame) - await Promise.resolve() - }) - } - - beforeEach(() => { - globalThis.IS_REACT_ACT_ENVIRONMENT = true - root = createRoot(document.createElement('div')) - latest = null - resetTransport() - useAppStore.setState({ agentStatusByPaneKey: acceptedAgentStatuses(Object.entries({})) }) - }) - - afterEach(() => { - act(() => root.unmount()) - vi.useRealTimers() - }) - - it('keeps the readSession seed live, so the real transcript still backfills', async () => { - // A flush between stream drains needs the independent seed; pending frames must leave it eligible. - let settleRead = (_result: { messages: NativeChatMessage[] }): void => {} - transport.readSession.mockImplementationOnce( - () => new Promise((resolve) => (settleRead = resolve)) - ) - await render() - - await emit(PENDING_FRAME) - await act(async () => { - settleRead({ messages: [assistant('flushed-later')] }) - await Promise.resolve() - }) - - expect(latest?.readPhase).toBe('ready') - expect(latest?.messages.map((message) => message.id)).toEqual(['flushed-later']) - }) - - it('settles to ready when the real snapshot arrives on the same subscription', async () => { - await render() - - await emit(PENDING_FRAME) - await emit({ type: 'snapshot', messages: [assistant('m-1')], hasMore: false }) - - expect(latest?.readPhase).toBe('ready') - expect(latest?.messages.map((message) => message.id)).toEqual(['m-1']) - }) - - it('stops duplicate seed polling once the live stream owns the pending transcript', async () => { - vi.useFakeTimers() - let settleRead = (_result: { error: string; notFound: true }): void => {} - transport.readSession.mockImplementationOnce( - () => new Promise((resolve) => (settleRead = resolve)) - ) - await render() - - await emit(PENDING_FRAME) - await act(async () => { - settleRead({ error: 'no transcript', notFound: true }) - await Promise.resolve() - await vi.advanceTimersByTimeAsync(NOTFOUND_RETRY_WINDOW_MS + 30_000) - }) - - expect(latest?.readPhase).toBe('awaiting') - expect(latest?.status).not.toBe('error') - expect(transport.readSession).toHaveBeenCalledOnce() - }) - - it('does not drop live appends already merged into the window', async () => { - await render() - - await emit({ type: 'appended', messages: [assistant('appended-1')] }) - await emit(PENDING_FRAME) - - expect(latest?.readPhase).toBe('awaiting') - expect(latest?.messages.map((message) => message.id)).toEqual(['appended-1']) - }) -}) - -describe('useNativeChatRetainedSession — unflushed transcript', () => { - let root: Root - let latest: NativeChatLiveSession | null = null - - function Probe(props: UseNativeChatLiveSessionArgs): null { - latest = useNativeChatRetainedSession(props) - return null - } - - async function emit(frame: unknown): Promise { - await act(async () => { - subscriptions[0]?.onFrame(frame) - await Promise.resolve() - }) - } - - beforeEach(() => { - globalThis.IS_REACT_ACT_ENVIRONMENT = true - root = createRoot(document.createElement('div')) - latest = null - resetTransport() - useAppStore.setState({ agentStatusByPaneKey: acceptedAgentStatuses(Object.entries({})) }) - }) - - afterEach(() => { - act(() => root.unmount()) - }) - - it('retains committed history instead of capturing the empty pending window', async () => { - await act(async () => { - root.render(createElement(Probe, BASE_ARGS)) - await Promise.resolve() - await Promise.resolve() - }) - await emit({ type: 'snapshot', messages: [assistant('committed')], hasMore: false }) - - await emit(PENDING_FRAME) - - expect(latest?.readPhase).toBe('awaiting') - expect(latest?.messages.map((message) => message.id)).toEqual(['committed']) - }) -}) diff --git a/src/renderer/src/components/native-chat/tools/runs/NativeChatBrowserPageButton.test.tsx b/src/renderer/src/components/native-chat/tools/runs/NativeChatBrowserPageButton.test.tsx deleted file mode 100644 index 7b18ad247b0..00000000000 --- a/src/renderer/src/components/native-chat/tools/runs/NativeChatBrowserPageButton.test.tsx +++ /dev/null @@ -1,153 +0,0 @@ -// @vitest-environment happy-dom - -import { act, render, within } from '@testing-library/react' -import type { ReactNode } from 'react' -import { describe, expect, it, vi } from 'vitest' -import type { BrowserPage } from '../../../../../../shared/browser/workspaces/browser-workspace-types' -import type { NativeChatToolCallBlock } from '../../../../../../shared/native-chat/native-chat-types' -import { setBrowserAgentPageActive } from '../../../browser-pane/agent-cursor/browser-agent-activity-state' -import { - NativeChatVisualOwnerContext, - type NativeChatVisualOwner -} from '../../media/visuals/native-chat-visual-owner' -import { NativeChatBrowserRunPageButton } from './NativeChatBrowserPageButton' - -function page(id: string, title: string): BrowserPage { - return { - id, - workspaceId: 'ws-1', - worktreeId: 'wt-1', - url: `https://example.com/${id}`, - title, - loading: false, - faviconUrl: null, - canGoBack: false, - canGoForward: false, - loadError: null, - createdAt: 1 - } -} - -const state = vi.hoisted((): { browserPagesByWorkspace: Record } => ({ - browserPagesByWorkspace: {} -})) -vi.mock('@/store', () => ({ - useAppStore: (select: (current: typeof state) => unknown) => select(state) -})) - -const transcript = vi.hoisted(() => { - const listeners = new Set<() => void>() - let snapshot: { current: boolean; state: { items: unknown[] } } = { - current: true, - state: { items: [] } - } - return { - owner: { - getSnapshot: () => snapshot, - subscribe: (listener: () => void) => { - listeners.add(listener) - return () => listeners.delete(listener) - } - }, - setCalls(calls: readonly NativeChatToolCallBlock[]) { - snapshot = { - current: true, - state: { items: calls.map((call) => ({ body: { ...call, kind: 'tool-call' } })) } - } - listeners.forEach((listener) => listener()) - }, - setCurrent(current: boolean) { - snapshot = { ...snapshot, current } - listeners.forEach((listener) => listener()) - } - } -}) -vi.mock('../../session/structured/read/structured-agent-session-read-owner-registry', () => ({ - findStructuredAgentSessionReadOwner: () => transcript.owner -})) - -const OWNER: NativeChatVisualOwner = { - target: { kind: 'local' }, - sessionId: 'session-1', - worktreeId: 'wt-1' -} - -function wrapper({ children }: { children: ReactNode }): React.JSX.Element { - return ( - - {children} - - ) -} - -function browserCall(callId: string, command = 'orca browser click @e1'): NativeChatToolCallBlock { - return { type: 'tool-call', name: 'Bash', input: { command }, callId } -} - -function shownTitle(container: HTMLElement): string | null { - return within(container).queryByRole('button')?.getAttribute('title') ?? null -} - -describe('NativeChatBrowserRunPageButton', () => { - it("keeps an older run's page after a newer run drives another page", () => { - state.browserPagesByWorkspace = { 'ws-1': [page('p1', 'First'), page('p2', 'Second')] } - const older = browserCall('run-a') - act(() => transcript.setCalls([older])) - const olderRun = render(, { wrapper }) - act(() => setBrowserAgentPageActive('p1', true, 'wt-1', undefined, 'session-1')) - expect(shownTitle(olderRun.container)).toBe('First') - - const newer = browserCall('run-b') - act(() => transcript.setCalls([older, newer])) - const newerRun = render(, { wrapper }) - act(() => setBrowserAgentPageActive('p2', true, 'wt-1', undefined, 'session-1')) - expect(shownTitle(olderRun.container)).toBe('First') - expect(shownTitle(newerRun.container)).toBe('Second') - }) - - it('ignores other agents driving a different page', () => { - state.browserPagesByWorkspace = { 'ws-1': [page('p1', 'Mine'), page('p2', 'Theirs')] } - const call = browserCall('run-c') - act(() => transcript.setCalls([call])) - setBrowserAgentPageActive('p1', true, 'wt-1', undefined, 'session-1') - const { container } = render(, { wrapper }) - - act(() => setBrowserAgentPageActive('p2', true, 'wt-1')) - act(() => setBrowserAgentPageActive('p2', true, 'wt-1', undefined, 'session-2')) - expect(shownTitle(container)).toBe('Mine') - }) - - it('shows the page for the newest run even when its activity arrived before the run drew', () => { - state.browserPagesByWorkspace = { 'ws-1': [page('p1', 'Driven')] } - const call = browserCall('run-d') - setBrowserAgentPageActive('p1', true, 'wt-1', undefined, 'session-1') - act(() => transcript.setCalls([call])) - const { container } = render(, { wrapper }) - expect(shownTitle(container)).toBe('Driven') - }) - - it("never shows another run's page for an older run whose page this renderer never saw", () => { - state.browserPagesByWorkspace = { 'ws-1': [page('p1', 'Older'), page('p2', 'Newer')] } - const older = browserCall('run-restored') - const newer = browserCall('run-newest') - act(() => transcript.setCalls([older, newer])) - setBrowserAgentPageActive('p1', true, 'wt-1', undefined, 'session-1') - const { container } = render(, { wrapper }) - expect(shownTitle(container)).toBeNull() - - act(() => setBrowserAgentPageActive('p2', true, 'wt-1', undefined, 'session-1')) - expect(shownTitle(container)).toBeNull() - }) - - it('keeps a run off a newer page while the transcript is behind the agent', () => { - state.browserPagesByWorkspace = { 'ws-1': [page('p1', 'Mine'), page('p2', 'Unseen run')] } - const call = browserCall('run-e') - act(() => transcript.setCalls([call])) - const { container } = render(, { wrapper }) - act(() => setBrowserAgentPageActive('p1', true, 'wt-1', undefined, 'session-1')) - - act(() => transcript.setCurrent(false)) - act(() => setBrowserAgentPageActive('p2', true, 'wt-1', undefined, 'session-1')) - expect(shownTitle(container)).toBe('Mine') - }) -}) diff --git a/src/renderer/src/components/right-sidebar/ai-vault/session-list/AiVaultSessionVirtualList.measurement.test.tsx b/src/renderer/src/components/right-sidebar/ai-vault/session-list/AiVaultSessionVirtualList.measurement.test.tsx deleted file mode 100644 index e19edcffcbf..00000000000 --- a/src/renderer/src/components/right-sidebar/ai-vault/session-list/AiVaultSessionVirtualList.measurement.test.tsx +++ /dev/null @@ -1,179 +0,0 @@ -// @vitest-environment happy-dom - -import { act, cleanup, fireEvent, render } from '@testing-library/react' -import { afterEach, describe, expect, it, vi } from 'vitest' -import { TooltipProvider } from '@/components/ui/tooltip' -import type { AiVaultSession } from '../../../../../../shared/ai-vault/contracts/ai-vault-types' -import { AiVaultSessionVirtualList } from './AiVaultSessionVirtualList' - -function makeSession(index: number): AiVaultSession { - return { - id: `local:omp:session-${index}:/tmp/session-${index}.jsonl`, - executionHostId: 'local', - agent: 'omp', - sessionId: `session-${index}`, - title: `Session ${index}`, - cwd: '/repo', - branch: null, - model: 'gpt-5', - filePath: `/tmp/session-${index}.jsonl`, - codexHome: null, - createdAt: null, - updatedAt: null, - modifiedAt: '2026-09-17T00:00:00.000Z', - messageCount: 10, - totalTokens: 0, - previewMessages: [{ role: 'assistant', text: `Reply ${index}`, timestamp: null }], - queuedMessageCount: 0, - subagentTranscriptCount: 0, - resumeCommand: `omp resume session-${index}`, - subagent: null - } -} - -afterEach(() => { - cleanup() - vi.restoreAllMocks() - vi.unstubAllGlobals() -}) - -function renderList(sessions: AiVaultSession[], loading = false) { - return render( - - ({ command: session.resumeCommand })} - getOriginalPaneTarget={() => null} - isStructuredSessionOpen={() => false} - getSessionLiveState={() => null} - getWorktreeInfo={() => null} - getSessionResumeState={() => ({ - blocked: false, - worktreeId: 'worktree-1', - usesSessionWorktree: false - })} - getSessionResumeActions={() => ({ - worktree: { worktreeId: null, disabled: true }, - newTab: { worktreeId: 'worktree-1', disabled: false } - })} - getSessionResumeInChat={() => ({ available: false, reason: 'already-structured' })} - onToggleGroup={vi.fn()} - onJumpToOriginalPane={vi.fn()} - onJumpToWorktree={vi.fn()} - onResume={vi.fn()} - onContinueInNewSession={vi.fn()} - onResumeInNewChat={vi.fn()} - onResumeInNewCli={vi.fn()} - onCopyResume={vi.fn()} - onCopyId={vi.fn()} - onCopyPath={vi.fn()} - onOpenLog={vi.fn()} - onRevealLog={vi.fn()} - onOpenCwd={vi.fn()} - onRevealArtifacts={vi.fn()} - onRequestDelete={vi.fn()} - /> - - ) -} - -describe('AiVaultSessionVirtualList row measurement', () => { - it('keeps measured offsets while hidden and accepts positive sizes after restore', () => { - const observers = new Map< - ResizeObserver, - { - callback: ResizeObserverCallback - targets: Set - } - >() - class TestResizeObserver implements ResizeObserver { - constructor(callback: ResizeObserverCallback) { - observers.set(this, { callback, targets: new Set() }) - } - observe(target: Element): void { - observers.get(this)?.targets.add(target) - } - unobserve(target: Element): void { - observers.get(this)?.targets.delete(target) - } - disconnect(): void { - observers.delete(this) - } - } - vi.stubGlobal('ResizeObserver', TestResizeObserver) - vi.stubGlobal('api', { aiVault: {} }) - vi.spyOn(HTMLElement.prototype, 'offsetHeight', 'get').mockImplementation(function ( - this: HTMLElement - ) { - if (this.classList.contains('overflow-y-auto')) { - return 600 - } - return this.getAttribute('data-index') === '0' ? 32 : 98 - }) - const { container, getByText } = renderList([makeSession(1), makeSession(2), makeSession(3)]) - const first = container.querySelector('[data-index="1"]') - const second = container.querySelector('[data-index="2"]') - if (!first || !second) { - throw new Error('Expected session rows to render') - } - const resize = (element: Element, height: number): void => { - act(() => { - for (const [observer, { callback, targets }] of observers) { - if (!targets.has(element)) { - continue - } - const size = [{ blockSize: height, inlineSize: 440 }] - callback( - [ - { - target: element, - borderBoxSize: size, - contentBoxSize: size, - devicePixelContentBoxSize: size, - contentRect: element.getBoundingClientRect() - } - ], - observer - ) - } - }) - } - - expect(second.style.transform).toBe('translateY(130px)') - resize(first, 117) - expect(second.style.transform).toBe('translateY(149px)') - - fireEvent.click(getByText('Session 1')) - resize(first, 669) - expect(second.style.transform).toBe('translateY(701px)') - const scroller = container.querySelector('.overflow-y-auto') - if (!scroller) { - throw new Error('Expected scroll viewport') - } - const hiddenRects = scroller.getClientRects() - Array.prototype.splice.call(hiddenRects, 0, hiddenRects.length) - const layoutBox = vi.spyOn(scroller, 'getClientRects').mockReturnValue(hiddenRects) - resize(first, 0) - expect(second.style.transform).toBe('translateY(701px)') - layoutBox.mockRestore() - resize(first, 720) - expect(second.style.transform).toBe('translateY(752px)') - - fireEvent.click(getByText('Session 1')) - resize(first, 117) - expect(second.style.transform).toBe('translateY(149px)') - const collapsedLayoutBox = vi.spyOn(scroller, 'getClientRects').mockReturnValue(hiddenRects) - resize(first, 0) - expect(second.style.transform).toBe('translateY(149px)') - collapsedLayoutBox.mockRestore() - resize(first, 135) - expect(second.style.transform).toBe('translateY(167px)') - }) -}) diff --git a/src/renderer/src/components/sidebar/host-path-browser/RemoteFileBrowser.keyboard.test.tsx b/src/renderer/src/components/sidebar/host-path-browser/RemoteFileBrowser.keyboard.test.tsx deleted file mode 100644 index c794af5504f..00000000000 --- a/src/renderer/src/components/sidebar/host-path-browser/RemoteFileBrowser.keyboard.test.tsx +++ /dev/null @@ -1,197 +0,0 @@ -// @vitest-environment happy-dom - -import { act } from 'react' -import { createRoot, type Root } from 'react-dom/client' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { RemoteFileBrowser } from './RemoteFileBrowser' - -const browseDir = vi.fn(async ({ dirPath }: { dirPath: string }) => ({ - entries: [ - { name: 'docs', isDirectory: true }, - { name: 'src', isDirectory: true }, - { name: 'README.md', isDirectory: false } - ], - resolvedPath: dirPath === '~' ? '/home/alice' : dirPath, - pathFlavor: 'posix' as const -})) - -async function flushPromises(): Promise { - for (let index = 0; index < 4; index += 1) { - await Promise.resolve() - } -} - -async function render(): Promise<{ - container: HTMLDivElement - input: HTMLInputElement - root: Root -}> { - const container = document.createElement('div') - document.body.appendChild(container) - const root = createRoot(container) - await act(async () => { - root.render() - await flushPromises() - }) - const input = container.querySelector('input') - if (!input) { - throw new Error('Remote file browser input was not rendered') - } - return { container, input, root } -} - -async function press( - input: HTMLInputElement, - key: string, - modifiers: KeyboardEventInit = {} -): Promise { - await act(async () => { - input.dispatchEvent( - new KeyboardEvent('keydown', { key, bubbles: true, cancelable: true, ...modifiers }) - ) - await flushPromises() - }) -} - -async function type(input: HTMLInputElement, value: string): Promise { - await act(async () => { - Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value')?.set?.call(input, value) - input.dispatchEvent(new Event('input', { bubbles: true })) - }) -} - -async function settlePathResolve(): Promise { - await act(async () => { - vi.advanceTimersByTime(300) - await flushPromises() - }) -} - -function selectedRow(container: HTMLElement): string | null | undefined { - return container.querySelector('[role="option"][aria-selected="true"]')?.textContent -} - -describe('RemoteFileBrowser keyboard navigation', () => { - beforeEach(() => { - globalThis.IS_REACT_ACT_ENVIRONMENT = true - browseDir.mockClear() - Object.defineProperty(window, 'api', { configurable: true, value: { ssh: { browseDir } } }) - }) - - afterEach(() => { - vi.useRealTimers() - document.body.replaceChildren() - vi.restoreAllMocks() - }) - - it('highlights the first row and moves it with the arrow keys', async () => { - const { container, input, root } = await render() - expect(selectedRow(container)).toBe('docs') - expect(input.getAttribute('aria-activedescendant')).toBe( - container.querySelector('[role="option"][aria-selected="true"]')?.id - ) - expect(input.getAttribute('role')).toBe('combobox') - expect(input.getAttribute('aria-controls')).toBe( - container.querySelector('[role="listbox"]')?.id - ) - - await press(input, 'ArrowDown') - await press(input, 'ArrowDown') - await press(input, 'ArrowDown') - expect(selectedRow(container)).toBe('README.md') - - await press(input, 'ArrowUp') - expect(selectedRow(container)).toBe('src') - - // Modified arrows stay with the input (selection, caret jumps). - await press(input, 'ArrowDown', { shiftKey: true }) - expect(selectedRow(container)).toBe('src') - - await act(async () => root.unmount()) - }) - - // Why: the previous listing's single folder would otherwise win Enter while the next one loads. - it('ignores Enter while the next listing loads', async () => { - browseDir.mockImplementationOnce(async () => ({ - entries: [ - { name: 'docs', isDirectory: true }, - { name: 'README.md', isDirectory: false } - ], - resolvedPath: '/home/alice', - pathFlavor: 'posix' as const - })) - const { input, root } = await render() - browseDir.mockClear() - browseDir.mockImplementationOnce(() => new Promise(() => {})) - - await press(input, 'Enter') - await press(input, 'Enter') - - expect(browseDir).toHaveBeenCalledTimes(1) - await act(async () => root.unmount()) - }) - - // Why: the cached home listing comes back as the same array under `~/`, which must not keep the moved row. - it('commits a typed path instead of a row highlighted before typing it', async () => { - vi.useFakeTimers() - const { input, root } = await render() - await press(input, 'ArrowDown') - browseDir.mockClear() - - await type(input, '~/') - await settlePathResolve() - await press(input, 'Enter') - - // Committing `~/` reopens the cached home listing and clears the typed path. - expect(input.value).toBe('') - expect(browseDir).not.toHaveBeenCalledWith({ - targetId: 'target-1', - dirPath: '/home/alice/src' - }) - await act(async () => root.unmount()) - }) - - // Why: until the debounce resolves `docs/`, the preview and its moved highlight still show `~/`. - it('ignores Enter on a typed directory that has not resolved yet', async () => { - vi.useFakeTimers() - const { input, root } = await render() - await type(input, '~/') - await settlePathResolve() - await press(input, 'ArrowDown') - await press(input, 'ArrowDown') - browseDir.mockClear() - - await type(input, '~/docs/') - await press(input, 'Enter') - expect(browseDir).not.toHaveBeenCalled() - - await settlePathResolve() - await press(input, 'Enter') - expect(browseDir).toHaveBeenLastCalledWith({ - targetId: 'target-1', - dirPath: '/home/alice/docs' - }) - await act(async () => root.unmount()) - }) - - // Why: before the first preview, `.` still filters the old rows, so the default highlight is a dotfolder. - it('ignores Enter on path input that has no preview yet', async () => { - vi.useFakeTimers() - browseDir.mockImplementationOnce(async () => ({ - entries: [ - { name: '.config', isDirectory: true }, - { name: '.ssh', isDirectory: true } - ], - resolvedPath: '/home/alice', - pathFlavor: 'posix' as const - })) - const { input, root } = await render() - browseDir.mockClear() - - await type(input, '.') - await press(input, 'Enter') - - expect(browseDir).not.toHaveBeenCalled() - await act(async () => root.unmount()) - }) -}) diff --git a/src/renderer/src/hooks/ipc-events/mobile-terminal-close-ipc-bridge-reveal.test.ts b/src/renderer/src/hooks/ipc-events/mobile-terminal-close-ipc-bridge-reveal.test.ts deleted file mode 100644 index b1985ae1c34..00000000000 --- a/src/renderer/src/hooks/ipc-events/mobile-terminal-close-ipc-bridge-reveal.test.ts +++ /dev/null @@ -1,174 +0,0 @@ -import { afterEach, describe, expect, it, vi } from 'vitest' -import type { RuntimeEditorTabReveal } from '../../../../shared/file-access/runtime-editor-file-open' -import { createTestStore, seedStore } from '../../store/testing/app-store-test-fixture' -import { makeWorktree } from '../../store/slices/worktrees/worktree.test-fixture' -import { createStoreSessionMockApi } from '../../store/testing/app-store-session-api.test-fixture' -import type * as HostPersistence from '@/lib/workspace/persistence/workspace-session-host-persistence' -import { - _resetLayoutFramePositionForTests, - beginLayoutFramePositions, - noteLayoutFramePosition -} from '@/runtime/workspace-layout/frames/layout-frame-position' - -const { storeRef } = vi.hoisted(() => { - const ref: { current: ReturnType | null } = { current: null } - return { storeRef: ref } -}) - -function testStore(): ReturnType { - if (!storeRef.current) { - throw new Error('test store not created') - } - return storeRef.current -} - -vi.mock('sonner', () => ({ toast: { info: vi.fn(), success: vi.fn(), error: vi.fn() } })) -vi.mock('../../store', () => ({ - useAppStore: { - getState: () => testStore().getState(), - subscribe: (...args: Parameters['subscribe']>) => - testStore().subscribe(...args), - setState: (...args: Parameters['setState']>) => - testStore().setState(...args) - } -})) -vi.mock('@/components/terminal-pane/layout/close/closed-terminal-leaf-notice', () => ({ - applyClosedTerminalLeafNotice: vi.fn() -})) -vi.mock('@/components/terminal/terminal-tab-actions', () => ({ closeTerminalTab: vi.fn() })) -vi.mock('@/components/sidebar/workspace-actions/sleep/sleep-worktree-flow', () => ({ - runSleepWorktree: vi.fn() -})) -vi.mock('@/lib/workspace/persistence/workspace-session', () => ({ - buildWorkspaceSessionPayload: vi.fn() -})) -vi.mock( - '@/lib/workspace/persistence/workspace-session-host-persistence', - async (importOriginal) => ({ - ...(await importOriginal()), - persistWorkspaceSessionByHost: vi.fn() - }) -) - -import { registerMobileAndTerminalCloseIpcBridge } from './mobile-terminal-close-ipc-bridge' - -const WT = 'repo1::/repo1/wt' -const UNDRAWN = 'repo1::/repo1/undrawn' -const FILE = { filePath: '/repo1/wt/notes.md', relativePath: 'notes.md' } - -function setup(): { - reveal: (payload: RuntimeEditorTabReveal) => void - tabId: string - activeTabId: () => string | null | undefined - activeWorktreeId: () => string | null - store: ReturnType -} { - let reveal: ((payload: RuntimeEditorTabReveal) => void) | undefined - const noop = (): (() => void) => () => {} - vi.stubGlobal('window', { - api: { - ...createStoreSessionMockApi(), - ui: { - onOpenFileFromMobile: noop, - onOpenDiffFromMobile: noop, - onCloseTerminal: noop, - onWorkspaceSleep: noop, - onResumeSleepingAgents: noop, - onRevealEditorTabFromRuntime: (cb: (payload: RuntimeEditorTabReveal) => void) => { - reveal = cb - return () => {} - } - } - } - }) - const store = createTestStore() - storeRef.current = store - seedStore(store, { - worktreesByRepo: { - repo1: [ - makeWorktree({ id: WT, repoId: 'repo1', path: '/repo1/wt' }), - makeWorktree({ id: UNDRAWN, repoId: 'repo1', path: '/repo1/undrawn' }) - ] - } - }) - store.getState().setActiveWorktree(WT) - store.setState({ - openFiles: [ - { - ...FILE, - id: FILE.filePath, - worktreeId: WT, - language: 'markdown', - runtimeEnvironmentId: null, - isDirty: false, - mode: 'edit' - } - ] - }) - store.getState().createUnifiedTab(WT, 'editor', { entityId: FILE.filePath, label: 'notes.md' }) - store.getState().createTab(WT) - const fileTab = store - .getState() - .unifiedTabsByWorktree[WT]!.find((tab) => tab.entityId === FILE.filePath)! - registerMobileAndTerminalCloseIpcBridge([], vi.fn()) - if (!reveal) { - throw new Error('reveal listener was not registered') - } - return { - reveal, - tabId: fileTab.id, - activeWorktreeId: () => store.getState().activeWorktreeId, - store, - activeTabId: () => { - const state = store.getState() - const groupId = state.activeGroupIdByWorktree[WT] - return state.groupsByWorktree[WT]?.find((group) => group.id === groupId)?.activeTabId - } - } -} - -afterEach(() => { - _resetLayoutFramePositionForTests() - vi.unstubAllGlobals() -}) - -describe('showing a tab main wrote for a file it opened', () => { - it('waits for the frame that draws the tab, then shows it', () => { - const h = setup() - beginLayoutFramePositions() - noteLayoutFramePosition(4) - h.reveal({ worktreeId: WT, ...FILE, tabId: h.tabId, frameSeq: 5 }) - expect(h.activeTabId()).not.toBe(h.tabId) - noteLayoutFramePosition(5) - expect(h.activeTabId()).toBe(h.tabId) - }) - - it("visits a workspace the window has not drawn yet, then shows main's tab once it draws", async () => { - const h = setup() - beginLayoutFramePositions() - // Stands in for the frame sync: once the workspace draws, its flush brings main's tab in. - h.store.subscribe((state) => { - if (UNDRAWN in state.groupsByWorktree && !state.unifiedTabsByWorktree[UNDRAWN]?.length) { - queueMicrotask(() => - h.store.getState().createUnifiedTab(UNDRAWN, 'editor', { - id: 'main-tab', - entityId: '/repo1/undrawn/notes.md' - }) - ) - } - }) - h.reveal({ worktreeId: UNDRAWN, ...FILE, tabId: 'main-tab', navigation: 'host' }) - expect(h.activeWorktreeId()).toBe(UNDRAWN) - // The window seeds the visited workspace's root group after render, a later task. - await Promise.resolve() - h.store.getState().ensureWorktreeRootGroup(UNDRAWN) - await vi.waitFor(() => { - const state = h.store.getState() - const group = state.groupsByWorktree[UNDRAWN]?.find( - (entry) => entry.id === state.activeGroupIdByWorktree[UNDRAWN] - ) - expect(group?.activeTabId).toBe('main-tab') - expect(state.activeTabTypeByWorktree[UNDRAWN]).toBe('editor') - }) - }) -}) diff --git a/src/renderer/src/lib/agent-session/launch/continuation/launch-agent-session-continuation-toast.test.tsx b/src/renderer/src/lib/agent-session/launch/continuation/launch-agent-session-continuation-toast.test.tsx deleted file mode 100644 index c6487ef64ee..00000000000 --- a/src/renderer/src/lib/agent-session/launch/continuation/launch-agent-session-continuation-toast.test.tsx +++ /dev/null @@ -1,162 +0,0 @@ -// @vitest-environment happy-dom -import { act, cleanup, fireEvent, render, screen } from '@testing-library/react' -import { afterEach, beforeEach, expect, it, vi } from 'vitest' -import { Toaster, toast } from 'sonner' -import { useAppStore } from '@/store/index' -import { getDefaultSettings } from '../../../../../../shared/constants' -import { makeFolderWorkspace } from '@/store/folder-workspaces/folder-workspace.test-fixture' -import { makeWorktree } from '@/store/slices/worktrees/worktree.test-fixture' -import { launchAgentSessionContinuation } from './launch-agent-session-continuation' -import type { LaunchAgentInNewTabArgs } from '../new-tab/launch-agent-in-new-tab-args' -import type { LaunchAgentInNewTabResult } from '../new-tab/launch-agent-in-new-tab-host-agents' - -const mocks = vi.hoisted(() => ({ - launch: vi.fn<(args: LaunchAgentInNewTabArgs) => LaunchAgentInNewTabResult>() -})) -vi.mock('@/lib/agent-session/launch/new-tab/launch-agent-in-new-tab', () => ({ - launchAgentInNewTabWithOutcome: mocks.launch -})) -vi.mock('@/runtime/native-chat/tab-retirement/structured-agent-session-tab-retirement', () => ({ - beginStructuredAgentSessionTabClose: vi.fn() -})) -vi.mock('@/runtime/rpc/calls/runtime-rpc-call', async (importOriginal) => - ( - await import('@/runtime/workspace-layout/testing/layout-apply-test-transport.test-fixture') - ).runtimeRpcClientWithLayoutApply(await importOriginal()) -) -vi.mock('../inventory/host-chat-program-acquisition', () => ({ - acquireAgentLaunchChoices: async () => ({ detected: ['codex'], offered: ['codex'] }) -})) - -const initial = useAppStore.getState() -beforeEach(() => { - vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'] }) - mocks.launch.mockReset() - mocks.launch.mockImplementation(({ worktreeId, agentSessionLaunchPlan }) => { - useAppStore.getState().createUnifiedTab(worktreeId, 'agent-session', { - id: 'agent-session:continuation', - entityId: 'continuation', - executionHostId: agentSessionLaunchPlan?.executionHostId, - agentSessionAgent: 'codex', - activate: false - }) - return { surface: { kind: 'host-published' }, pasteDraftAfterLaunch: false } - }) - useAppStore.setState({ - settings: getDefaultSettings('/test'), - repos: [{ id: 'repo-1', path: '/repo', displayName: 'Repo', badgeColor: '', addedAt: 0 }], - worktreesByRepo: { - 'repo-1': [ - makeWorktree({ id: 'source', repoId: 'repo-1', path: '/repo/source', hostId: 'local' }), - makeWorktree({ - id: 'target', - repoId: 'repo-1', - path: '/repo/target', - displayName: 'Destination worktree', - hostId: 'local' - }) - ] - }, - folderWorkspaces: [ - makeFolderWorkspace({ - id: 'local-folder', - name: 'Local folder', - executionHostId: 'local' - }), - makeFolderWorkspace({ - id: 'remote-folder', - name: 'Remote folder', - executionHostId: 'runtime:paired' - }) - ], - activeRepoId: 'repo-1', - activeWorktreeId: 'source', - activeWorkspaceExecutionHostId: 'local', - activeView: 'terminal', - refreshGitHubForWorktreeIfStale: vi.fn() - }) -}) -afterEach(() => { - cleanup() - toast.dismiss() - vi.clearAllTimers() - vi.useRealTimers() - useAppStore.setState(initial, true) -}) - -it.each([ - { worktreeId: 'target', executionHostId: 'local', name: 'Destination worktree' }, - { worktreeId: 'folder:local-folder', executionHostId: 'local', name: 'Local folder' }, - { - worktreeId: 'folder:remote-folder', - executionHostId: 'runtime:paired', - name: 'Remote folder' - } -] as const)( - 'names $name and opens its host only when the toast action is clicked', - async ({ worktreeId, executionHostId, name }) => { - render() - await act(async () => { - await expect( - launchAgentSessionContinuation({ - agent: 'codex', - prompt: 'Continue the saved task', - worktreeId, - launchSource: 'sidebar', - launchChoice: { agent: 'codex', route: 'structured-native-chat', executionHostId } - }) - ).resolves.toBe(true) - }) - expect(screen.queryByText(name)).toBeNull() - expect(useAppStore.getState().activeWorktreeId).toBe('source') - - await act(async () => { - mocks.launch.mock.calls[0]?.[0].onPromptDelivered?.() - await vi.advanceTimersByTimeAsync(0) - }) - expect(screen.getByText(name)).toBeTruthy() - expect(useAppStore.getState().activeWorktreeId).toBe('source') - expect(useAppStore.getState().activeWorkspaceExecutionHostId).toBe('local') - - fireEvent.click(screen.getByRole('button', { name: 'Go to workspace' })) - - expect(useAppStore.getState().activeWorktreeId).toBe(worktreeId) - expect(useAppStore.getState().activeWorkspaceExecutionHostId).toBe(executionHostId) - expect(useAppStore.getState().unifiedTabsByWorktree[worktreeId]).toEqual([ - expect.objectContaining({ id: 'agent-session:continuation', executionHostId }) - ]) - expect(useAppStore.getState().tabsByWorktree[worktreeId] ?? []).toEqual([]) - } -) - -it.each(['target', 'folder:local-folder'])( - 'recovers an empty %s when the continuation closes before clicking the toast', - async (worktreeId) => { - render() - await act(async () => { - await launchAgentSessionContinuation({ - agent: 'codex', - prompt: 'Continue the saved task', - worktreeId, - launchSource: 'sidebar', - launchChoice: { - agent: 'codex', - route: 'structured-native-chat', - executionHostId: 'local' - } - }) - mocks.launch.mock.calls[0]?.[0].onPromptDelivered?.() - await vi.advanceTimersByTimeAsync(0) - }) - - useAppStore.getState().closeUnifiedTab('agent-session:continuation') - expect(useAppStore.getState().reconcileWorktreeTabModel(worktreeId).renderableTabCount).toBe(0) - expect(useAppStore.getState().activeWorktreeId).toBe('source') - - fireEvent.click(screen.getByRole('button', { name: 'Go to workspace' })) - - expect(useAppStore.getState().activeWorktreeId).toBe(worktreeId) - expect(useAppStore.getState().activeWorkspaceExecutionHostId).toBe('local') - expect(useAppStore.getState().tabsByWorktree[worktreeId]).toHaveLength(1) - } -) diff --git a/src/renderer/src/lib/browser/palette/browser-palette-page-entries.test.ts b/src/renderer/src/lib/browser/palette/browser-palette-page-entries.test.ts deleted file mode 100644 index 5d9b2675b7d..00000000000 --- a/src/renderer/src/lib/browser/palette/browser-palette-page-entries.test.ts +++ /dev/null @@ -1,216 +0,0 @@ -import { describe, expect, it } from 'vitest' -import type { - BrowserPage, - BrowserWorkspace -} from '../../../../../shared/browser/workspaces/browser-workspace-types' -import type { Tab } from '../../../../../shared/tab-types' -import type { Worktree } from '../../../../../shared/worktree/types' -import { getWorktreeHostIdentity } from '../../../../../shared/worktree/host-qualified-identity' -import { buildSearchableBrowserPages } from './browser-palette-page-entries' -import { searchBrowserPages } from './browser-palette-search' - -function makeWorktree(overrides: Partial = {}): Worktree { - return { - id: 'wt-1', - repoId: 'repo-1', - path: '/tmp/wt-1', - head: 'abc123', - branch: 'refs/heads/feature/browser-search', - isBare: false, - isMainWorktree: false, - displayName: 'Palette Worktree', - comment: '', - linkedIssue: null, - linkedPR: null, - linkedLinearIssue: null, - isArchived: false, - isUnread: false, - isPinned: false, - sortOrder: 0, - lastActivityAt: 0, - ...overrides - } -} - -function makeWorkspace(overrides: Partial = {}): BrowserWorkspace { - return { - id: 'ws-1', - worktreeId: 'wt-1', - activePageId: 'page-1', - pageIds: ['page-1'], - url: 'https://example.com', - title: 'Example', - loading: false, - faviconUrl: null, - canGoBack: false, - canGoForward: false, - loadError: null, - createdAt: 0, - ...overrides - } -} - -function makePage(overrides: Partial = {}): BrowserPage { - return { - id: 'page-1', - workspaceId: 'ws-1', - worktreeId: 'wt-1', - url: 'https://example.com/docs', - title: 'Project Docs', - loading: false, - faviconUrl: null, - canGoBack: false, - canGoForward: false, - loadError: null, - createdAt: 0, - ...overrides - } -} - -const repoMap = new Map([ - ['repo-1', { displayName: 'repo/one' }], - ['repo-2', { displayName: 'repo/two' }] -]) -const worktreeOrder = new Map([ - ['wt-1', 0], - ['wt-2', 1] -]) - -describe('buildSearchableBrowserPages', () => { - it('keeps same-id browser tabs isolated by execution host', () => { - const sharedId = 'repo-shared::/workspace' - const local = makeWorktree({ id: sharedId, hostId: 'local', displayName: 'Local workspace' }) - const remote = makeWorktree({ - id: sharedId, - hostId: 'runtime:host-b', - displayName: 'Remote workspace' - }) - const localWorkspace = makeWorkspace({ - id: 'ws-local', - worktreeId: sharedId, - activePageId: 'page-local' - }) - const remoteWorkspace = makeWorkspace({ - id: 'ws-remote', - worktreeId: sharedId, - activePageId: 'page-remote' - }) - const entries = buildSearchableBrowserPages({ - worktrees: [local, remote], - repoMap, - worktreeOrder: new Map([ - [getWorktreeHostIdentity(local), 0], - [getWorktreeHostIdentity(remote), 1] - ]), - browserTabsByWorktree: { - [sharedId]: [localWorkspace, remoteWorkspace] - }, - browserPagesByWorkspace: { - 'ws-local': [ - makePage({ - id: 'page-local', - workspaceId: 'ws-local', - worktreeId: sharedId, - title: 'Local docs' - }) - ], - 'ws-remote': [ - makePage({ - id: 'page-remote', - workspaceId: 'ws-remote', - worktreeId: sharedId, - title: 'Remote docs' - }) - ] - }, - unifiedTabsByWorktree: { - [sharedId]: [ - browserUnifiedTab('tab-local', 'ws-local', sharedId, 'local'), - browserUnifiedTab('tab-remote', 'ws-remote', sharedId, 'runtime:host-b') - ] - }, - activeBrowserTabId: null, - activeWorktreeId: null, - activeTabType: 'terminal' - }) - - expect(entries.map((entry) => [entry.page.id, entry.worktree.hostId])).toEqual([ - ['page-local', 'local'], - ['page-remote', 'runtime:host-b'] - ]) - expect( - searchBrowserPages(entries, 'docs').map((result) => [result.pageId, result.executionHostId]) - ).toEqual([ - ['page-local', 'local'], - ['page-remote', 'runtime:host-b'] - ]) - }) - - it('does not re-host a tab whose stamped owner is absent from the catalog', () => { - const sharedId = 'repo-shared::/workspace' - const remote = makeWorktree({ id: sharedId, hostId: 'runtime:host-b' }) - const entries = buildSearchableBrowserPages({ - worktrees: [remote], - repoMap, - worktreeOrder: new Map([[getWorktreeHostIdentity(remote), 0]]), - browserTabsByWorktree: { - [sharedId]: [ - makeWorkspace({ id: 'ws-local', worktreeId: sharedId, activePageId: 'page-local' }) - ] - }, - browserPagesByWorkspace: { - 'ws-local': [makePage({ id: 'page-local', workspaceId: 'ws-local', worktreeId: sharedId })] - }, - unifiedTabsByWorktree: { - [sharedId]: [browserUnifiedTab('tab-local', 'ws-local', sharedId, 'local')] - }, - activeBrowserTabId: null, - activeWorktreeId: null, - activeTabType: 'terminal' - }) - - expect(entries).toEqual([]) - }) - - it('does not route one ambiguous legacy browser bucket to both hosts', () => { - const sharedId = 'repo-shared::/workspace' - const workspace = makeWorkspace({ worktreeId: sharedId }) - - expect( - buildSearchableBrowserPages({ - worktrees: [ - makeWorktree({ id: sharedId, hostId: 'local' }), - makeWorktree({ id: sharedId, hostId: 'runtime:host-b' }) - ], - repoMap, - worktreeOrder, - browserTabsByWorktree: { [sharedId]: [workspace] }, - browserPagesByWorkspace: { [workspace.id]: [makePage({ worktreeId: sharedId })] }, - activeBrowserTabId: null, - activeWorktreeId: null, - activeTabType: 'terminal' - }) - ).toEqual([]) - }) -}) - -function browserUnifiedTab( - id: string, - entityId: string, - worktreeId: string, - executionHostId?: Tab['executionHostId'] -): Tab { - return { - id, - entityId, - groupId: `group-${id}`, - worktreeId, - ...(executionHostId ? { executionHostId } : {}), - contentType: 'browser', - label: entityId, - customLabel: null, - color: null, - sortOrder: 0, - createdAt: 0 - } -} diff --git a/src/renderer/src/lib/workspace/persistence/wsl-move-renderer-store-rewrites.test.ts b/src/renderer/src/lib/workspace/persistence/wsl-move-renderer-store-rewrites.test.ts deleted file mode 100644 index 0b4c8cdf4e6..00000000000 --- a/src/renderer/src/lib/workspace/persistence/wsl-move-renderer-store-rewrites.test.ts +++ /dev/null @@ -1,159 +0,0 @@ -// @vitest-environment happy-dom -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { WslMovePendingRendererRewrite } from '../../../../../shared/wsl-move/wsl-move-renderer-rewrite-types' -import { WSL_MOVE_RENDERER_REWRITE_STORE_IDS } from '../../../../../shared/wsl-move/wsl-move-renderer-rewrite-types' -import type * as RunnerModule from './wsl-move-renderer-store-rewrites' - -const client = vi.hoisted(() => ({ - list: vi.fn<() => Promise>(), - record: vi.fn() -})) -vi.mock('./wsl-move-renderer-rewrite-client', () => ({ - listPendingWslMoveRendererRewrites: client.list, - recordWslMoveRendererStoreRewritten: client.record -})) -vi.mock('@/store/index', () => ({ useAppStore: { getState: () => ({}) } })) - -const UNC_ROOT = '\\\\wsl.localhost\\Ubuntu\\home\\u\\proj' -const LOCAL_ID = `repo-1::${UNC_ROOT}` -const HOST_ID = 'repo-1::/home/u/proj' -const QUICK_OPEN = 'orca.quick-open-history.v1' -const PDF = 'orca.pdf.scale-preferences.v1' -const CSV = 'orca.csv.column-widths.v1' -const NOTEBOOKS = 'orca.notebookPythonEnvironments' -const APPLIED = 'orca.wsl-move.renderer-rewrites.v1' - -const localRoute = { executionHostId: 'local', runtimeEnvironmentId: null } -const hostRoute = { executionHostId: 'runtime:wsl-env', runtimeEnvironmentId: 'wsl-env' } -const localQuickOpen = JSON.stringify([localRoute, LOCAL_ID, '//wsl/ubuntu/home/u/proj']) -const hostQuickOpen = JSON.stringify([hostRoute, HOST_ID, '/home/u/proj']) -const sshQuickOpen = JSON.stringify([ - { executionHostId: 'ssh:box', runtimeEnvironmentId: null }, - 'repo-9::/srv/x', - '/srv/x' -]) -const localPdf = JSON.stringify([LOCAL_ID, 'local', null, `${UNC_ROOT}\\a.pdf`]) -const hostPdf = JSON.stringify([HOST_ID, 'wsl-env', null, '/home/u/proj/a.pdf']) -const localCsv = JSON.stringify([ - JSON.stringify([LOCAL_ID, 'local', null, `${UNC_ROOT}\\a.csv`]), - ',' -]) -const hostCsv = JSON.stringify([ - JSON.stringify([HOST_ID, 'wsl-env', null, '/home/u/proj/a.csv']), - ',' -]) - -function move( - overrides: Partial = {} -): WslMovePendingRendererRewrite { - return { - migrationId: 'move-1', - storeIds: [...WSL_MOVE_RENDERER_REWRITE_STORE_IDS], - destinationEnvironmentId: 'wsl-env', - destinationHostId: 'runtime:wsl-env', - distro: 'Ubuntu', - scopeRepoIds: ['repo-1'], - scopeFolderWorkspaceIds: [], - scopeRootPaths: ['/home/u/proj'], - ...overrides - } -} - -function seedStorage(): void { - localStorage.setItem( - QUICK_OPEN, - JSON.stringify([ - [sshQuickOpen, ['x.ts']], - [localQuickOpen, ['src/a.ts']] - ]) - ) - localStorage.setItem(PDF, JSON.stringify({ [localPdf]: { scale: 1.5 } })) - localStorage.setItem(CSV, JSON.stringify({ [localCsv]: { 0: 120 } })) - localStorage.setItem( - NOTEBOOKS, - JSON.stringify({ - [`${UNC_ROOT}\\nb.ipynb`]: { path: `${UNC_ROOT}\\.venv\\bin\\python`, name: '.venv' } - }) - ) -} - -const read = (key: string): unknown => JSON.parse(localStorage.getItem(key) ?? 'null') - -// A fresh module graph is a renderer reload: in-memory caches start over from storage. -async function loadRunner(): Promise { - vi.resetModules() - return import('./wsl-move-renderer-store-rewrites') -} - -beforeEach(() => { - localStorage.clear() - client.list.mockReset() - client.record.mockReset() - client.record.mockResolvedValue({ recorded: true }) -}) -afterEach(() => { - vi.doUnmock('../../../components/editor/notebook/kernel/ipynb-kernel-store') -}) - -describe('WSL move renderer store rewrites', () => { - it('adds a host copy beside each moved entry, then records every store', async () => { - seedStorage() - client.list.mockResolvedValue([move()]) - await (await loadRunner()).runWslMoveRendererStoreRewrites() - - expect(read(QUICK_OPEN)).toEqual([ - [sshQuickOpen, ['x.ts']], - [localQuickOpen, ['src/a.ts']], - [hostQuickOpen, ['src/a.ts']] - ]) - expect(read(PDF)).toEqual({ [localPdf]: { scale: 1.5 }, [hostPdf]: { scale: 1.5 } }) - expect(read(CSV)).toEqual({ [localCsv]: { 0: 120 }, [hostCsv]: { 0: 120 } }) - expect(read(NOTEBOOKS)).toMatchObject({ - '/home/u/proj/nb.ipynb': { path: '/home/u/proj/.venv/bin/python', name: '.venv' } - }) - expect(client.record.mock.calls).toEqual( - WSL_MOVE_RENDERER_REWRITE_STORE_IDS.map((id) => ['move-1', id]) - ) - }) - - it('does not re-apply a landed store after a reload, but still records it if pending', async () => { - seedStorage() - client.list.mockResolvedValue([move()]) - await (await loadRunner()).runWslMoveRendererStoreRewrites() - // The user drops the host copy afterwards; a reload must not bring it back. - const pdf = { [localPdf]: { scale: 1.5 } } - localStorage.setItem(PDF, JSON.stringify(pdf)) - client.record.mockClear() - - await (await loadRunner()).runWslMoveRendererStoreRewrites() - - expect(read(PDF)).toEqual(pdf) - expect(client.record).toHaveBeenCalledTimes(WSL_MOVE_RENDERER_REWRITE_STORE_IDS.length) - }) - - it('makes room in a full store by dropping the moved source, never another project', async () => { - const others = Array.from({ length: 63 }, (_, index) => [`other-${index}`, ['x.ts']]) - localStorage.setItem(QUICK_OPEN, JSON.stringify([[localQuickOpen, ['src/a.ts']], ...others])) - client.list.mockResolvedValue([move()]) - await (await loadRunner()).runWslMoveRendererStoreRewrites() - expect(read(QUICK_OPEN)).toEqual([[hostQuickOpen, ['src/a.ts']], ...others]) - }) - - it('neither marks nor records a store whose write storage refused', async () => { - seedStorage() - client.list.mockResolvedValue([move()]) - const setItem = localStorage.setItem.bind(localStorage) - const refuse = vi.spyOn(localStorage, 'setItem').mockImplementation((key, value) => { - if (key === QUICK_OPEN) { - throw new Error('quota') - } - setItem(key, value) - }) - const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) - await (await loadRunner()).runWslMoveRendererStoreRewrites() - refuse.mockRestore() - warn.mockRestore() - expect(client.record).not.toHaveBeenCalledWith('move-1', 'quick-open-history') - expect(read(APPLIED)).not.toContain('move-1:quick-open-history') - }) -}) diff --git a/src/renderer/src/runtime/web-session-tabs-sync/navigation/web-session-tabs-sync.test.ts b/src/renderer/src/runtime/web-session-tabs-sync/navigation/web-session-tabs-sync.test.ts deleted file mode 100644 index 76714884ecb..00000000000 --- a/src/renderer/src/runtime/web-session-tabs-sync/navigation/web-session-tabs-sync.test.ts +++ /dev/null @@ -1,171 +0,0 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { RuntimeMobileSessionTabsResult } from '../../../../../shared/remote-runtime/session-graph/runtime-session-contracts' -import { toWebTerminalSurfaceTabId } from '../../../../../shared/workspace-layout/terminal-surface-id' -import '../../../../../shared/agent-session/view/structured-agent-session-projection' -import '../../../../../shared/constants' -import { - clearWebSessionCloseIntent, - recordWebSessionCloseIntent -} from '../closing/web-session-close-intent' -import { recordWebSessionReorderIntent } from './web-session-reorder-intent' - -import { acceptReplayedWebSessionTabsSnapshot, type WebSessionTabsSyncState } from '../state' -import { applyFreshWebSessionTabsSnapshot, applyWebSessionTabsSnapshot } from '../snapshot-api' -import '../tracking-mappings' -import '../tracking-decisions' -import '../tracking' - -import { - ENV, - HOST_SURFACE_ID, - LEAF_ID, - NOW, - SECOND_LEAF_ID, - WT, - makeSnapshot, - makeState, - resetWebSessionTabsSyncTestState -} from '../testing/web-session-tabs-sync.test-fixture' - -vi.mock('../../../store/index', () => ({ - useAppStore: { - setState: vi.fn(), - // Snapshot receipt reads the held paired-tab closes; none here. - getState: () => ({}) - } -})) - -vi.mock('@/hooks/agent-hook-completion-notifications', () => ({ - observeAgentHookCompletionForNotification: vi.fn() -})) -describe('applyWebSessionTabsSnapshot', () => { - beforeEach(resetWebSessionTabsSyncTestState) - - it('suppresses a tab the client is closing until the host confirms removal (no close flash)', () => { - const surface = { - type: 'terminal' as const, - id: HOST_SURFACE_ID, - parentTabId: 'host-tab-1', - leafId: LEAF_ID, - title: 'Terminal', - status: 'ready' as const, - terminal: 'term_host', - isActive: true - } - // Client closed host-tab-1; an in-flight pre-close snapshot still lists it. - recordWebSessionCloseIntent({ environmentId: ENV }, WT, 'host-tab-1', NOW) - const stalePreClose = applyWebSessionTabsSnapshot( - makeState(), - makeSnapshot([surface]), - ENV, - NOW - ) - expect((stalePreClose.tabsByWorktree?.[WT] ?? []).map((tab) => tab.id)).not.toContain( - toWebTerminalSurfaceTabId('host-tab-1') - ) - - // Host omission clears close intent; a genuinely new tab reusing that ID must show. - applyWebSessionTabsSnapshot(makeState(), makeSnapshot([]), ENV, NOW + 1) - const reopened = applyWebSessionTabsSnapshot( - makeState(), - makeSnapshot([surface], { snapshotVersion: 5 }), - ENV, - NOW + 2 - ) - expect((reopened.tabsByWorktree?.[WT] ?? []).map((tab) => tab.id)).toContain( - toWebTerminalSurfaceTabId('host-tab-1') - ) - }) - - it('reapplies an unchanged host snapshot after a lifecycle close is refused', () => { - const surface = { - type: 'terminal' as const, - id: HOST_SURFACE_ID, - parentTabId: 'host-tab-1', - leafId: LEAF_ID, - title: 'Terminal', - status: 'ready' as const, - terminal: 'term_host', - isActive: true - } - const authoritative = makeSnapshot([surface], { snapshotVersion: 6 }) - - const initial = makeState() - recordWebSessionCloseIntent({ environmentId: ENV }, WT, 'host-tab-1', NOW) - const hiddenPatch = applyFreshWebSessionTabsSnapshot(initial, authoritative, ENV, NOW) - const hidden = { ...initial, ...(hiddenPatch as Partial) } - expect((hidden.tabsByWorktree[WT] ?? []).map((tab) => tab.id)).not.toContain( - toWebTerminalSurfaceTabId('host-tab-1') - ) - - // Live-PTY refusal needs unchanged snapshot replay immediately, without waiting for a publish. - clearWebSessionCloseIntent({ environmentId: ENV }, WT, 'host-tab-1') - acceptReplayedWebSessionTabsSnapshot(ENV, WT) - const restoredPatch = applyFreshWebSessionTabsSnapshot(hidden, authoritative, ENV, NOW + 1) - const restored = { ...hidden, ...(restoredPatch as Partial) } - expect((restored.tabsByWorktree[WT] ?? []).map((tab) => tab.id)).toContain( - toWebTerminalSurfaceTabId('host-tab-1') - ) - }) - - it('keeps a client reorder until the host echoes it (no order snap-back)', () => { - const local1 = toWebTerminalSurfaceTabId('host-tab-1') - const local2 = toWebTerminalSurfaceTabId('host-tab-2') - const surfaces: RuntimeMobileSessionTabsResult['tabs'] = [ - { - type: 'terminal', - id: `host-tab-1::${LEAF_ID}`, - parentTabId: 'host-tab-1', - leafId: LEAF_ID, - title: 'Terminal 1', - status: 'ready', - terminal: 'term_host_1', - isActive: true - }, - { - type: 'terminal', - id: `host-tab-2::${SECOND_LEAF_ID}`, - parentTabId: 'host-tab-2', - leafId: SECOND_LEAF_ID, - title: 'Terminal 2', - status: 'ready', - terminal: 'term_host_2', - isActive: false - } - ] - const groupWithOrder = (tabOrder: string[]): RuntimeMobileSessionTabsResult['tabGroups'] => [ - { id: 'host-group-1', activeTabId: 'host-tab-1', tabOrder } - ] - - // Optimistic reorder must survive in-flight pre-move host order. - recordWebSessionReorderIntent({ environmentId: ENV }, WT, 'host-group-1', [local2, local1], NOW) - const stalePreMove = applyWebSessionTabsSnapshot( - makeState(), - makeSnapshot(surfaces, { tabGroups: groupWithOrder(['host-tab-1', 'host-tab-2']) }), - ENV, - NOW - ) as Partial - expect(stalePreMove.groupsByWorktree?.[WT]?.[0]?.tabOrder).toEqual([local2, local1]) - - // Host confirmation clears reorder intent; later host order changes must apply. - applyWebSessionTabsSnapshot( - makeState(), - makeSnapshot(surfaces, { - snapshotVersion: 5, - tabGroups: groupWithOrder(['host-tab-2', 'host-tab-1']) - }), - ENV, - NOW + 1 - ) - const reverted = applyWebSessionTabsSnapshot( - makeState(), - makeSnapshot(surfaces, { - snapshotVersion: 6, - tabGroups: groupWithOrder(['host-tab-1', 'host-tab-2']) - }), - ENV, - NOW + 2 - ) as Partial - expect(reverted.groupsByWorktree?.[WT]?.[0]?.tabOrder).toEqual([local1, local2]) - }) -}) diff --git a/src/renderer/src/store/repos/all-host-catalog-settlement.test.ts b/src/renderer/src/store/repos/all-host-catalog-settlement.test.ts deleted file mode 100644 index daf4cbf4c72..00000000000 --- a/src/renderer/src/store/repos/all-host-catalog-settlement.test.ts +++ /dev/null @@ -1,179 +0,0 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest' -import { createTestStore } from '../testing/app-store-test-fixture' -import type { FolderWorkspace } from '../../../../shared/folder-workspaces/folder-workspace-types' -import type { ProjectGroup } from '../../../../shared/project/groups/project-group-types' -import type { Repo } from '../../../../shared/repository/repo-types' -import { - createCompatibleRuntimeStatusResponseIfNeeded, - type RuntimeEnvironmentCallRequest -} from '../../runtime/rpc/testing/runtime-compatibility-test-fixture' -import { clearRuntimeCompatibilityCache as clearRuntimeCompatibilityCacheForTests } from '../../runtime/rpc/compatibility/runtime-compatibility-cache' -import { folderWorkspaceKey } from '../../../../shared/workspace/identity/workspace-scope' - -const localRepo: Repo = { - id: 'local-repo', - path: '/l', - displayName: 'L', - badgeColor: '#000', - addedAt: 1 -} -const remoteRepo: Repo = { - id: 'remote-repo', - path: '/r', - displayName: 'R', - badgeColor: '#000', - addedAt: 1 -} -const group = (id: string, parentPath: string): ProjectGroup => ({ - id, - name: id, - parentPath, - parentGroupId: null, - createdFrom: 'manual', - tabOrder: 0, - isCollapsed: false, - color: null, - createdAt: 1, - updatedAt: 1 -}) -const folder = (id: string, projectGroupId: string, folderPath: string): FolderWorkspace => ({ - id, - projectGroupId, - name: id, - folderPath, - linkedTask: null, - comment: '', - isArchived: false, - isUnread: false, - isPinned: false, - sortOrder: 0, - lastActivityAt: 1, - createdAt: 1, - updatedAt: 1 -}) -const localGroup = group('local-group', '/l') -const remoteGroup = group('remote-group', '/r') -const localFolder = folder('local-folder', 'local-group', '/l') -const remoteFolder = folder('remote-folder', 'remote-group', '/r') -const restoredFolderKey = folderWorkspaceKey('remote-folder') - -const reposList = vi.fn() -const projectGroupsList = vi.fn() -const folderWorkspacesList = vi.fn() -const runtimeEnvironmentsList = vi.fn() -const runtimeEnvironmentCall = vi.fn() - -function rpc(result: unknown): unknown { - return { id: 'rpc', ok: true, result, _meta: { runtimeId: 'runtime-remote' } } -} - -function remoteResult(method: string): unknown { - switch (method) { - case 'repo.list': - return rpc({ repos: [remoteRepo] }) - case 'projectGroup.list': - return rpc({ groups: [remoteGroup] }) - case 'folderWorkspace.list': - return rpc({ folderWorkspaces: [remoteFolder] }) - case 'settings.get': - return rpc({ settings: { worktreeVisibilityDefaults: { external: 'show' } } }) - default: - return rpc({ projects: [], setups: [] }) - } -} - -beforeEach(() => { - clearRuntimeCompatibilityCacheForTests() - for (const mock of [ - reposList, - projectGroupsList, - folderWorkspacesList, - runtimeEnvironmentsList, - runtimeEnvironmentCall - ]) { - mock.mockReset() - } - reposList.mockResolvedValue([localRepo]) - projectGroupsList.mockResolvedValue([localGroup]) - folderWorkspacesList.mockResolvedValue([localFolder]) - runtimeEnvironmentsList.mockResolvedValue([{ id: 'env-1', name: 'remote' }]) - runtimeEnvironmentCall.mockImplementation((args: RuntimeEnvironmentCallRequest) => - remoteResult(args.method) - ) - vi.stubGlobal('window', { - api: { - repos: { list: reposList }, - projects: { - list: vi.fn().mockResolvedValue([]), - listHostSetups: vi.fn().mockResolvedValue([]) - }, - projectGroups: { list: projectGroupsList }, - folderWorkspaces: { list: folderWorkspacesList }, - runtimeEnvironments: { - list: runtimeEnvironmentsList, - call: (args: RuntimeEnvironmentCallRequest) => - createCompatibleRuntimeStatusResponseIfNeeded(args) ?? runtimeEnvironmentCall(args) - } - }, - dispatchEvent: vi.fn() - }) - vi.spyOn(console, 'error').mockImplementation(() => {}) - vi.spyOn(console, 'warn').mockImplementation(() => {}) -}) - -function storeWithRestoredFolderOwner(): ReturnType { - const store = createTestStore() - store.setState({ - projectGroups: [ - { ...localGroup, executionHostId: 'local' }, - { ...remoteGroup, executionHostId: 'runtime:env-1' } - ], - restoredRuntimeHostIdByWorkspaceSessionKey: { [restoredFolderKey]: 'runtime:env-1' } - }) - return store -} - -describe('all-host folder workspace settlement', () => { - it('drops a restored owner its own host settled even when the local catalog fails', async () => { - folderWorkspacesList.mockRejectedValue(new Error('local down')) - const store = storeWithRestoredFolderOwner() - - await store.getState().fetchFolderWorkspacesForAllHosts() - - expect(store.getState().folderWorkspaces.map((w) => w.id)).toEqual(['remote-folder']) - expect(store.getState().restoredRuntimeHostIdByWorkspaceSessionKey).toEqual({}) - }) -}) - -describe('all-host repo settlement', () => { - it('settles the local waiter with the error and still loads remote repos when local fails', async () => { - const localError = new Error('local down') - reposList.mockRejectedValue(localError) - const store = createTestStore() - - await store.getState().fetchReposForAllHosts() - - await expect(store.getState().awaitLocalRepoCatalogSettlement()).rejects.toBe(localError) - expect(store.getState().repos.map((r) => r.id)).toEqual(['remote-repo']) - }) - - it('applies visibility defaults but keeps saved filters when one remote repo catalog fails', async () => { - runtimeEnvironmentCall.mockImplementation((args: RuntimeEnvironmentCallRequest) => { - if (args.method === 'repo.list') { - throw new Error('runtime_unreachable') - } - return remoteResult(args.method) - }) - const store = createTestStore() - store.setState({ activeRepoId: 'remote-repo', filterRepoIds: ['remote-repo'] }) - - await store.getState().fetchReposForAllHosts() - - expect(store.getState().repos.map((r) => r.id)).toEqual(['local-repo']) - expect(store.getState().worktreeVisibilityDefaultsByHost['runtime:env-1']).toEqual({ - external: 'show' - }) - expect(store.getState().activeRepoId).toBe('remote-repo') - expect(store.getState().filterRepoIds).toEqual(['remote-repo']) - }) -}) diff --git a/src/renderer/src/store/slices/tabs/store-open-to-side-layout-owner.test.ts b/src/renderer/src/store/slices/tabs/store-open-to-side-layout-owner.test.ts deleted file mode 100644 index ee0973436f9..00000000000 --- a/src/renderer/src/store/slices/tabs/store-open-to-side-layout-owner.test.ts +++ /dev/null @@ -1,158 +0,0 @@ -// With main layout ownership, each split and tab must reach main together; drawn frames must preserve group parity. -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type * as AgentStatusModule from '@/lib/agent-status/aggregation/worktree-agent-status' -import { createTestStore, seedStore } from '../../testing/app-store-test-fixture' -import { makeWorktree } from '../worktrees/worktree.test-fixture' -import { createStoreCascadesMockApi } from '../../testing/app-store-cascade-api.test-fixture' -import '@/runtime/workspace-layout/commands/layout-owner-new-group-split' -import '@/runtime/workspace-layout/intents/layout-owner-content-tab-open' -import './content-tab-open-placement' -import { layoutApplyTestTransport } from '@/runtime/workspace-layout/testing/layout-apply-test-transport.test-fixture' -import type { TabGroupLayoutNode } from '../../../../../shared/tab-types' -import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../../shared/layout-owner-switch' -import type { LayoutCommand } from '../../../../../shared/workspace-layout/workspace-layout-command-types' -import { drawTabsFromMain, type TabsDrawnFromMain } from './tabs-drawn-from-main.test-fixture' - -vi.mock('@/runtime/rpc/calls/runtime-rpc-call', async (importOriginal) => - ( - await import('@/runtime/workspace-layout/testing/layout-apply-test-transport.test-fixture') - ).runtimeRpcClientWithLayoutApply(await importOriginal()) -) -vi.mock('@/runtime/workspace-layout/frames/runtime-layout-client', async (importOriginal) => - ( - await import('@/runtime/workspace-layout/testing/layout-apply-test-transport.test-fixture') - ).runtimeLayoutClientWithTestFrames(await importOriginal()) -) -vi.mock('sonner', () => ({ - toast: { info: vi.fn(), success: vi.fn(), error: vi.fn(), warning: vi.fn() } -})) -vi.mock('@/lib/agent-status/aggregation/worktree-agent-status', async (importOriginal) => { - const actual = await importOriginal() - return { ...actual, detectAgentStatusFromTitle: vi.fn().mockReturnValue(null) } -}) - -createStoreCascadesMockApi() - -const WT = 'repo1::/path/wt1' -const ROOT = 'group-root' - -let store: ReturnType -let main: TabsDrawnFromMain -let sentSoFar = 0 - -beforeEach(async () => { - store = createTestStore() - seedStore(store, { - worktreesByRepo: { repo1: [makeWorktree({ id: WT, repoId: 'repo1', path: '/path/wt1' })] }, - activeWorktreeId: WT, - groupsByWorktree: { [WT]: [{ id: ROOT, worktreeId: WT, activeTabId: null, tabOrder: [] }] }, - activeGroupIdByWorktree: { [WT]: ROOT }, - unifiedTabsByWorktree: { [WT]: [] } - }) - main = await drawTabsFromMain(store) - sentSoFar = 0 -}) - -afterEach(() => { - main.close() -}) - -/** What the window sent since the last call, once main answered it and its frames are drawn. */ -async function settledSent(): Promise { - await main.settle() - const sent = layoutApplyTestTransport.sent.slice(sentSoFar) - sentSoFar = layoutApplyTestTransport.sent.length - return [...sent] -} - -/** Groups by id: the detector matches them by id, and main appends a group the window kept. */ -function byId(groups: readonly { id: string; tabOrder: string[] }[]) { - return groups - .map(({ id, tabOrder }) => ({ id, tabOrder })) - .sort((left, right) => left.id.localeCompare(right.id)) -} - -/** The window's groups that hold tabs: main stores no empty group. */ -function windowView() { - const state = store.getState() - return { - groups: byId((state.groupsByWorktree[WT] ?? []).filter((group) => group.tabOrder.length > 0)), - tree: splitTree(state.layoutByWorktree[WT]) - } -} - -function mainView() { - const workspace = layoutApplyTestTransport.mainModel!.workspaces[WT]! - return { - groups: byId(workspace.groups), - tree: splitTree(workspace.groupLayout) - } -} - -/** A lone group's tree is implied: the window stores its leaf, main none. */ -function splitTree(tree: TabGroupLayoutNode | undefined): TabGroupLayoutNode | null { - return tree?.type === 'split' ? tree : null -} - -function openFile(path: string, options?: { preview?: boolean; targetGroupId?: string }) { - store - .getState() - .openFile( - { filePath: path, relativePath: path.slice(1), worktreeId: WT, language: 'ts', mode: 'edit' }, - options - ) -} - -function onlyTabOf(groupId: string): string { - const group = store.getState().groupsByWorktree[WT]!.find((entry) => entry.id === groupId)! - expect(group.tabOrder).toHaveLength(1) - return group.tabOrder[0]! -} - -describe.runIf(ORCA_LAYOUT_OWNER_IS_MAIN)('open to the side in a layout-owner build', () => { - it('makes each new split in main with its tab, so main and the window agree after every step', async () => { - openFile('/a.ts') - await settledSent() - expect(mainView()).toEqual(windowView()) - - const editorGroup = store.getState().createEmptySplitGroup(WT, ROOT, 'right')! - openFile('/a.ts', { targetGroupId: editorGroup }) - expect(await settledSent()).toEqual([ - expect.objectContaining({ - type: 'openEditorTab', - tabId: onlyTabOf(editorGroup), - groupId: editorGroup, - split: { besideGroupId: ROOT, direction: 'right' } - }) - ]) - expect(mainView()).toEqual(windowView()) - - store.getState().createTab(WT, undefined, undefined, { - split: { sourceGroupId: editorGroup, splitDirection: 'down' } - }) - const terminalGroup = store.getState().groupsByWorktree[WT]!.at(-1)!.id - const browser = store.getState().createBrowserTab(WT, 'about:blank', { - split: { sourceGroupId: ROOT, splitDirection: 'left' } - }) - const sentNow = await settledSent() - const browserGroup = store - .getState() - .unifiedTabsByWorktree[WT]!.find((tab) => tab.entityId === browser.id)!.groupId - expect(sentNow).toEqual([ - expect.objectContaining({ - type: 'createTerminalTab', - tabId: onlyTabOf(terminalGroup), - groupId: terminalGroup, - split: { besideGroupId: editorGroup, direction: 'down' } - }), - expect.objectContaining({ - type: 'openBrowserTab', - tabId: onlyTabOf(browserGroup), - groupId: browserGroup, - split: { besideGroupId: ROOT, direction: 'left' } - }) - ]) - expect(mainView()).toEqual(windowView()) - expect(mainView().groups).toHaveLength(4) - }) -}) diff --git a/src/renderer/src/store/slices/worktrees/metadata/worktrees-fetch-remote-lineage.test.ts b/src/renderer/src/store/slices/worktrees/metadata/worktrees-fetch-remote-lineage.test.ts deleted file mode 100644 index b3e0cd4026c..00000000000 --- a/src/renderer/src/store/slices/worktrees/metadata/worktrees-fetch-remote-lineage.test.ts +++ /dev/null @@ -1,176 +0,0 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { AppState } from '../../../types' -import type { RuntimeEnvironmentCallRequest } from '../../../../runtime/rpc/testing/runtime-compatibility-test-fixture' -import { clearHugeRepoWarningDismissalsForTests } from '@/lib/source-control/warnings/source-control-huge-repo-warning-dismissals' -import { worktreeWorkspaceKey } from '../../../../../../shared/workspace/identity/workspace-scope' -import { makeDetectedResult } from '../listing/worktrees-detected-listing-fixtures' -import { makeLineage, makeWorkspaceLineage } from './workspace-lineage.test-fixture' -import { makeWorktree } from '../worktree.test-fixture' -import { TEST_REPO } from '../../../repos/repo.test-fixture' - -// The client stamps a server's repo row on arrival; focus alone never names the owner. -function createRemoteRepoStore() { - const store = createTestStore() - store.setState({ repos: [{ ...TEST_REPO, executionHostId: 'runtime:env-1' }] }) - return store -} -import { - createTestStore, - resetRemoteRuntimeMocks, - resetWorktreeSliceModuleMemory, - runtimeEnvironmentCall -} from '../worktrees-slice-test-harness' - -const requestWorktreeBaseFallbackNotice = vi.hoisted(() => vi.fn()) - -vi.mock('sonner', () => ({ - toast: { - warning: vi.fn(), - info: vi.fn(), - success: vi.fn(), - error: vi.fn(), - dismiss: vi.fn() - } -})) - -vi.mock('@/components/worktree-base-fallback-notice', () => ({ - requestWorktreeBaseFallbackNotice -})) - -beforeEach(resetWorktreeSliceModuleMemory) - -describe('fetchWorktrees', () => { - beforeEach(() => { - vi.clearAllMocks() - resetRemoteRuntimeMocks() - clearHugeRepoWarningDismissalsForTests() - }) - - it('keeps a parent reassignment written while the host lineage request was in flight', async () => { - const store = createRemoteRepoStore() - const worktree = makeWorktree({ - id: 'repo1::/remote/wt1', - repoId: 'repo1', - path: '/remote/wt1', - branch: 'refs/heads/remote', - hostId: 'runtime:env-1' - }) - const childKey = worktreeWorkspaceKey(worktree.id) - const before = makeLineage({ - worktreeId: worktree.id, - parentWorktreeId: 'repo1::/remote/old-parent' - }) - const beforeWorkspace = makeWorkspaceLineage({ - childWorkspaceKey: childKey, - parentWorkspaceKey: worktreeWorkspaceKey('repo1::/remote/old-parent') - }) - store.setState({ - settings: { activeRuntimeEnvironmentId: 'env-1' } as never, - worktreesByRepo: { repo1: [worktree] }, - worktreeLineageById: { [before.worktreeId]: before }, - workspaceLineageByChildKey: { [childKey]: beforeWorkspace } - } as Partial) - - let releaseLineage: (() => void) | undefined - const lineageReplied = new Promise((resolve) => { - releaseLineage = resolve - }) - runtimeEnvironmentCall.mockImplementation(async ({ method }: RuntimeEnvironmentCallRequest) => { - if (method === 'worktree.lineageList') { - await lineageReplied - return { - id: 'rpc-1', - ok: true, - result: { - lineage: { [before.worktreeId]: before }, - workspaceLineage: { [childKey]: beforeWorkspace } - }, - _meta: { runtimeId: 'runtime-remote' } - } - } - return { - id: 'rpc-2', - ok: true, - result: makeDetectedResult('repo1', [worktree]), - _meta: { runtimeId: 'runtime-remote' } - } - }) - - const pending = store.getState().fetchWorktreeLineage({ executionHostId: 'runtime:env-1' }) - const reassigned = makeLineage({ - worktreeId: worktree.id, - parentWorktreeId: 'repo1::/remote/new-parent' - }) - const reassignedWorkspace = makeWorkspaceLineage({ - childWorkspaceKey: childKey, - parentWorkspaceKey: worktreeWorkspaceKey('repo1::/remote/new-parent') - }) - store.setState({ - worktreeLineageById: { [reassigned.worktreeId]: reassigned }, - workspaceLineageByChildKey: { [childKey]: reassignedWorkspace } - } as Partial) - - releaseLineage?.() - await pending - - expect(store.getState().worktreeLineageById).toEqual({ [reassigned.worktreeId]: reassigned }) - expect(store.getState().workspaceLineageByChildKey).toEqual({ [childKey]: reassignedWorkspace }) - }) - - it('keeps a lineage row deleted while the host lineage request was in flight', async () => { - const store = createRemoteRepoStore() - const worktree = makeWorktree({ - id: 'repo1::/remote/wt1', - repoId: 'repo1', - path: '/remote/wt1', - branch: 'refs/heads/remote', - hostId: 'runtime:env-1' - }) - const childKey = worktreeWorkspaceKey(worktree.id) - const before = makeLineage({ worktreeId: worktree.id }) - const beforeWorkspace = makeWorkspaceLineage({ childWorkspaceKey: childKey }) - store.setState({ - settings: { activeRuntimeEnvironmentId: 'env-1' } as never, - worktreesByRepo: { repo1: [worktree] }, - worktreeLineageById: { [before.worktreeId]: before }, - workspaceLineageByChildKey: { [childKey]: beforeWorkspace } - } as Partial) - - let releaseLineage: (() => void) | undefined - const lineageReplied = new Promise((resolve) => { - releaseLineage = resolve - }) - runtimeEnvironmentCall.mockImplementation(async ({ method }: RuntimeEnvironmentCallRequest) => { - if (method === 'worktree.lineageList') { - await lineageReplied - return { - id: 'rpc-1', - ok: true, - result: { - lineage: { [before.worktreeId]: before }, - workspaceLineage: { [childKey]: beforeWorkspace } - }, - _meta: { runtimeId: 'runtime-remote' } - } - } - return { - id: 'rpc-2', - ok: true, - result: makeDetectedResult('repo1', [worktree]), - _meta: { runtimeId: 'runtime-remote' } - } - }) - - const pending = store.getState().fetchWorktreeLineage({ executionHostId: 'runtime:env-1' }) - store.setState({ - worktreeLineageById: {}, - workspaceLineageByChildKey: {} - } as Partial) - - releaseLineage?.() - await pending - - expect(store.getState().worktreeLineageById).toEqual({}) - expect(store.getState().workspaceLineageByChildKey).toEqual({}) - }) -}) diff --git a/src/shared/secure-storage/windows-secure-dacl.test.ts b/src/shared/secure-storage/windows-secure-dacl.test.ts deleted file mode 100644 index 7324f1a6d81..00000000000 --- a/src/shared/secure-storage/windows-secure-dacl.test.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { findSecureDaclViolation } from './windows-secure-dacl' -import { daclFromSddl } from './windows-security-addon.test-fixture' - -const USER = 'S-1-5-21-432636774-4279371817-3971399515-1001' -const fileViolation = (sddl: string) => findSecureDaclViolation(daclFromSddl(sddl), USER, false) -const directoryViolation = (sddl: string) => findSecureDaclViolation(daclFromSddl(sddl), USER, true) - -describe('findSecureDaclViolation', () => { - // No migration: these are byte-for-byte what the icacls hardening left on this machine. - it('accepts what the icacls-era hardening left on disk', () => { - expect(fileViolation(`D:PAI(A;;FA;;;BA)(A;;FA;;;SY)(A;;FA;;;${USER})`)).toBeNull() - expect( - directoryViolation(`D:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICI;FA;;;${USER})`) - ).toBeNull() - }) - - it('accepts a protected DACL granting the user alone, and ignores deny rules', () => { - expect(fileViolation(`D:P(A;;FA;;;${USER})`)).toBeNull() - expect(fileViolation(`D:P(D;;FA;;;WD)(A;;FA;;;${USER})`)).toBeNull() - expect(fileViolation(`D:P(A;;0x1f01ff;;;${USER})`)).toBeNull() - expect(fileViolation(`D:P(A;;GA;;;${USER})`)).toBeNull() - }) - - it.each([ - ['explicit Everyone', `D:P(A;;FA;;;${USER})(A;;FR;;;WD)`, 'S-1-1-0'], - [ - 'inherited Authenticated Users (a relocated root)', - `D:AI(A;ID;FA;;;${USER})(A;ID;0x1301bf;;;AU)`, - 'S-1-5-11' - ], - [ - 'inherit-only Users on a directory', - `D:P(A;OICI;FA;;;${USER})(A;OICIIO;FR;;;BU)`, - 'S-1-5-32-545' - ] - ])('rejects %s', (_label, sddl, sid) => { - expect(directoryViolation(sddl)).toBe(`unexpected rule for ${sid}`) - }) - - // Object, callback and conditional ACEs can grant by rules this check cannot evaluate. - it.each([ - ['last', `D:P(A;;FA;;;SY)(A;;FA;;;${USER})(XA;;FA;;;WD;(@User.Department == "Finance"))`], - ['first', `D:P(XA;;FA;;;WD;(@User.Department == "Finance"))(A;;FA;;;SY)(A;;FA;;;${USER})`], - ['an object ACE', `D:P(A;;FA;;;${USER})(OA;;FR;;;WD)`] - ])('fails closed on an ACE it cannot evaluate: %s', (_label, sddl) => { - expect(fileViolation(sddl)).toMatch(/unsupported ACE type/) - }) - - // Loosening the parent reaches anything that still inherits, however tidy it looks today. - it('requires protection, even when every inherited rule names an allowed principal', () => { - expect(directoryViolation(`D:AI(A;OICIID;FA;;;SY)(A;OICIID;FA;;;${USER})`)).toMatch( - /not protected/ - ) - expect(fileViolation(`D:AI(A;ID;FA;;;SY)(A;ID;FA;;;BA)(A;ID;FA;;;${USER})`)).toMatch( - /not protected/ - ) - }) - - // An inherit-only rule grants the directory itself nothing, so Orca could not write into it. - it('rejects a path the user cannot actually use', () => { - const missing = `missing full control for ${USER}` - expect(directoryViolation(`D:P(A;OICIIO;FA;;;${USER})(A;OICI;FA;;;SY)`)).toBe(missing) - expect(directoryViolation(`D:P(A;;FA;;;${USER})`)).toBe(missing) - expect(fileViolation(`D:P(A;;FR;;;${USER})`)).toBe(missing) - }) - - it('fails closed on a NULL DACL, which grants everyone everything', () => { - expect(findSecureDaclViolation(null, USER, false)).toMatch(/NULL DACL/) - }) - - // The addon hands back raw SIDs, so the built-in Administrator (the CI runner) needs no alias. - it('checks a RID-500 user by its raw SID', () => { - const builtinAdmin = 'S-1-5-21-432636774-4279371817-3971399515-500' - expect( - findSecureDaclViolation( - daclFromSddl(`D:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICI;FA;;;${builtinAdmin})`), - builtinAdmin, - true - ) - ).toBeNull() - expect(fileViolation(`D:P(A;;FA;;;${builtinAdmin})(A;;FA;;;${USER})`)).toBe( - `unexpected rule for ${builtinAdmin}` - ) - }) -}) diff --git a/src/shared/shell/command-resolution/node-cli-command-async-resolution.test.ts b/src/shared/shell/command-resolution/node-cli-command-async-resolution.test.ts deleted file mode 100644 index 3060dd0c239..00000000000 --- a/src/shared/shell/command-resolution/node-cli-command-async-resolution.test.ts +++ /dev/null @@ -1,105 +0,0 @@ -import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs' -import type * as NodeFs from 'node:fs' -import { tmpdir } from 'node:os' -import { delimiter, join } from 'node:path' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { resolveCliCommandAsync } from './node-cli-command-async-resolution' -import { resolveCliCommand } from './node-cli-command-resolution' - -const syncFs = vi.hoisted(() => ({ forbidden: false, calls: new Array() })) - -// Throws from every sync read a CLI lookup could make while forbidden, proving the async lookup makes none. -vi.mock('node:fs', async (importOriginal) => { - const actual = await importOriginal() - const guard = - (name: string, read: (...args: A) => R) => - (...args: A): R => { - if (syncFs.forbidden) { - syncFs.calls.push(name) - throw new Error(`sync fs call: ${name}`) - } - return read(...args) - } - return { - ...actual, - accessSync: guard('accessSync', actual.accessSync), - existsSync: guard('existsSync', actual.existsSync), - lstatSync: guard('lstatSync', actual.lstatSync), - readdirSync: guard('readdirSync', actual.readdirSync), - readFileSync: guard('readFileSync', actual.readFileSync), - realpathSync: guard('realpathSync', actual.realpathSync), - statSync: guard('statSync', actual.statSync) - } -}) - -let root: string - -beforeEach(() => { - root = mkdtempSync(join(tmpdir(), 'orca-cli-resolve-async-')) -}) - -afterEach(() => { - syncFs.forbidden = false - syncFs.calls = [] - rmSync(root, { recursive: true, force: true }) -}) - -function stage(...relative: string[]): void { - for (const path of relative) { - mkdirSync(join(root, path, '..'), { recursive: true }) - writeFileSync(join(root, path), '') - } -} - -// Windows' spawn recheck uses the async resolver; it must pick what panes' sync resolver picks. -// platform: 'win32' skips the X_OK check, so these run on any host. -describe('resolveCliCommandAsync agrees with resolveCliCommand on Windows', () => { - const options = (...dirs: string[]) => ({ - pathEnv: dirs.map((dir) => join(root, dir)).join(delimiter), - homePath: join(root, 'home'), - platform: 'win32' as const - }) - - it.each([ - { - name: 'the .cmd shim beats .exe and .bat in one dir', - files: ['a/codex.exe', 'a/codex.bat', 'a/codex.cmd'], - expected: 'a/codex.cmd' - }, - { name: '.exe beats .bat', files: ['a/codex.bat', 'a/codex.exe'], expected: 'a/codex.exe' }, - { - name: 'an earlier PATH dir beats a better extension later', - files: ['a/codex.bat', 'b/codex.cmd'], - expected: 'a/codex.bat' - }, - { - name: 'a PATH miss falls back to the npm global dir', - files: ['home/AppData/Roaming/npm/codex.cmd'], - expected: 'home/AppData/Roaming/npm/codex.cmd' - }, - { - name: 'a PATH copy beats an install-dir copy', - files: ['home/AppData/Roaming/npm/codex.cmd', 'b/codex.exe'], - expected: 'b/codex.exe' - }, - { - name: "nvm's default alias outranks a newer nvm install", - files: [ - 'home/.nvm/alias/default', - 'home/.nvm/versions/node/v22.0.0/bin/codex.cmd', - 'home/.nvm/versions/node/v20.1.0/bin/codex.cmd' - ], - alias: '20', - expected: 'home/.nvm/versions/node/v20.1.0/bin/codex.cmd' - }, - { name: 'a miss everywhere returns the bare name', files: [], expected: null } - ])('$name', async ({ files, alias, expected }) => { - stage(...files) - if (alias) { - writeFileSync(join(root, 'home/.nvm/alias/default'), alias) - } - const sync = resolveCliCommand('codex', options('a', 'b')) - expect(sync).toBe(expected === null ? 'codex' : join(root, expected)) - expect(await resolveCliCommandAsync('codex', options('a', 'b'))).toBe(sync) - }) -}) diff --git a/src/shared/shell/launch/agents/claude-shell-function.test.ts b/src/shared/shell/launch/agents/claude-shell-function.test.ts deleted file mode 100644 index d37a0317b02..00000000000 --- a/src/shared/shell/launch/agents/claude-shell-function.test.ts +++ /dev/null @@ -1,135 +0,0 @@ -import { spawnSync } from 'node:child_process' -import { - chmodSync, - existsSync, - mkdirSync, - mkdtempSync, - rmSync, - statSync, - writeFileSync -} from 'node:fs' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { afterEach, describe, expect, it } from 'vitest' -import { getPosixClaudeShellFunction, getFishClaudeShellFunction } from './claude-shell-function' -import { agentSessionSignInCommand } from '../../../agent-session/lifecycle/launch/agent-session-setup-commands' -// Skip missing zsh/fish instead of failing with exit 127 on CI images. -const POSIX_SHELLS = ['/bin/bash', '/bin/zsh'].filter((shell) => existsSync(shell)) -const FISH = ['/opt/homebrew/bin/fish', '/usr/local/bin/fish', '/usr/bin/fish'].find(existsSync) -const SHELLS = [...POSIX_SHELLS, ...(FISH ? [FISH] : [])] -const roots: string[] = [] -afterEach(() => { - roots.splice(0).forEach((root) => rmSync(root, { recursive: true, force: true })) -}) -function fixture() { - const root = mkdtempSync(join(tmpdir(), 'claude-shell-')) - roots.push(root) - const a = join(root, 'account a ü') - const bin = join(root, 'bin') - for (const dir of [a, bin]) { - mkdirSync(dir) - } - const fake = join(bin, 'claude') - writeFileSync( - fake, - '#!/bin/sh\nprintf "HOME=%s KEY=%s TWIN=%s\\n" "${CLAUDE_CONFIG_DIR-default}" "${ANTHROPIC_API_KEY-none}" "${ORCA_CLAUDE_INJECTED_CONFIG_DIR-none}"\nexit 23\n' - ) - chmodSync(fake, 0o700) - const pointer = join(root, 'selected') - const run = ( - shell: string, - env: string[] = [], - fakeKind: 'summary' | 'direct' = 'summary', - userSetup = '', - command = 'claude' - ) => { - if (fakeKind === 'direct') { - // A subshell left between the pane shell and Claude leads Claude's foreground group. - writeFileSync(fake, '#!/bin/sh\n[ "$PPID" = "$PANE_SHELL_PID" ] && echo direct\n') - } - const fish = shell.endsWith('fish') - const fn = fish ? getFishClaudeShellFunction() : getPosixClaudeShellFunction() - // Abort if system config shadows the fake with a real claude binary. - const guard = fish - ? `test (command -s claude) = '${fake}'; or exit 97` - : `[ "$(command -v claude)" = '${fake}' ] || exit 97` - const result = spawnSync( - '/usr/bin/env', - [ - '-i', - `HOME=${root}`, - `PATH=${bin}:/usr/bin:/bin`, - `ORCA_CLAUDE_PROFILE_POINTER=${pointer}`, - 'ANTHROPIC_API_KEY=fake', - ...env, - shell, - ...(fish ? ['--no-config'] : shell.endsWith('zsh') ? ['-f'] : ['--norc', '--noprofile']), - '-c', - `${guard}\n${userSetup}\n${fn}\n${command}` - ], - { encoding: 'utf8', cwd: root } - ) - expect(result.status).not.toBe(97) - expect(result.stderr).toBe('') - return result - } - return { a, pointer, run } -} -const injected = (home: string) => [ - `CLAUDE_CONFIG_DIR=${home}`, - `ORCA_CLAUDE_INJECTED_CONFIG_DIR=${home}` -] - -describe.each(SHELLS)('the claude function in %s', (shell) => { - it('signs the system account in while a managed profile is selected, preserving later routing', () => { - const f = fixture() - writeFileSync(f.pointer, f.a) - const command = agentSessionSignInCommand('claude', { account: 'system', remote: false }) - const env = [...injected(f.a), 'ORCA_CLAUDE_USER_CONFIG_DIR=/user/system account/'] - const result = f.run(shell, env, 'summary', '', `${command}; claude`) - expect(result.stdout).toBe( - `HOME=/user/system account/ KEY=fake TWIN=none\nHOME=${f.a} KEY=fake TWIN=${f.a}\n` - ) - expect(result.status).toBe(23) - expect(f.run(shell, injected(f.a), 'summary', '', command!).stdout).toBe( - 'HOME=default KEY=fake TWIN=none\n' - ) - }) - - it('creates a missing account folder and runs Claude in it, printing nothing', () => { - const f = fixture() - const fresh = join(f.a, 'claude-profiles', 'id', 'home') - writeFileSync(f.pointer, fresh) - const result = f.run(shell) - expect(result.stdout).toBe(`HOME=${fresh} KEY=fake TWIN=${fresh}\n`) - expect(result.status).toBe(23) - expect(existsSync(fresh)).toBe(true) - // Match private login-folder permissions. - expect(statSync(fresh).mode & 0o777).toBe(0o700) - }) - - it.skipIf(!POSIX_SHELLS.includes(shell))( - 'keeps the user’s own claude function when the cwd has a claude entry', - () => { - const f = fixture() - writeFileSync(f.pointer, f.a) - mkdirSync(join(f.a, '..', 'claude')) - const userFn = 'claude() { echo user function; }' - expect(f.run(shell, [], 'summary', userFn).stdout).toBe('user function\n') - } - ) - - it.skipIf(shell.endsWith('fish'))( - 'replaces the subshell so Claude is a direct child of the pane shell', - () => { - const f = fixture() - const own = 'ORCA_CLAUDE_USER_CONFIG_DIR=/user/own' - const setup = 'export PANE_SHELL_PID=$$' - writeFileSync(f.pointer, f.a) - expect(f.run(shell, [], 'direct', setup).stdout).toBe('direct\n') - writeFileSync(f.pointer, '') - expect(f.run(shell, [...injected(f.a), own], 'direct', setup).stdout).toBe('direct\n') - expect(f.run(shell, [], 'direct', setup).stdout).toBe('direct\n') - } - ) -}) diff --git a/src/shared/shell/launch/startup-shell-portability.live-shell.test.ts b/src/shared/shell/launch/startup-shell-portability.live-shell.test.ts deleted file mode 100644 index b6e4b9f98bf..00000000000 --- a/src/shared/shell/launch/startup-shell-portability.live-shell.test.ts +++ /dev/null @@ -1,89 +0,0 @@ -/** Real-shell byte round trips validate one POSIX startup string across sh/bash/zsh/dash/fish. - * Regression cases retain fish backslashes/apostrophes and zsh builtin eval, which command eval cannot run. */ -import { execFileSync } from 'node:child_process' -import { existsSync, mkdtempSync, rmSync } from 'node:fs' -import { tmpdir } from 'node:os' -import path from 'node:path' -import { afterAll, describe, expect, it } from 'vitest' -import { resolveFishBinary } from '../testing/fish-binary-requirement' -import { clearEnvCommand } from '../../agent-launch/startup/tui-agent-startup-shell' - -const FISH = resolveFishBinary(4) - -type LiveShell = { name: string; path: string } - -function discoverShells(): LiveShell[] { - const shells: LiveShell[] = [] - for (const path of [ - '/bin/sh', - '/bin/bash', - '/bin/zsh', - '/bin/dash', - '/usr/bin/dash', - '/bin/ksh' - ]) { - if (existsSync(path) && !shells.some((shell) => shell.name === basename(path))) { - shells.push({ name: basename(path), path }) - } - } - if (FISH.available) { - // Sandbox PATH cannot resolve bare fish. - const path = FISH.path.includes('/') - ? FISH.path - : execFileSync('command', ['-v', FISH.path], { encoding: 'utf8', shell: true }).trim() - shells.push({ name: 'fish', path }) - } - return shells -} - -function basename(path: string): string { - return path.split('/').pop() ?? path -} - -// Fish needs a writable HOME for universal variables or every launch warns. -const SANDBOX_HOME = mkdtempSync(path.join(tmpdir(), 'orca-shell-portability-')) - -function sandboxEnv(): NodeJS.ProcessEnv { - return { - PATH: '/usr/bin:/bin:/usr/sbin:/sbin', - HOME: SANDBOX_HOME, - XDG_CONFIG_HOME: path.join(SANDBOX_HOME, 'config'), - XDG_DATA_HOME: path.join(SANDBOX_HOME, 'data') - } -} - -function runInShell(shell: LiveShell, script: string): string { - return execFileSync(shell.path, ['-c', script], { - encoding: 'utf8', - timeout: 20_000, - env: sandboxEnv() - }) -} - -const SHELLS = discoverShells() - -afterAll(() => { - rmSync(SANDBOX_HOME, { recursive: true, force: true }) -}) - -// Windows has no discovered POSIX shells; skip instead of failing on missing tools. -describe.skipIf(process.platform === 'win32')( - 'one POSIX startup dialect is correct in every Unix shell', - () => { - describe.each(SHELLS)('$name', (shell) => { - // Keep -g: erasing a lone universal would permanently change future fish sessions, including clipboard launches without injected env. - it.runIf(shell.name === 'fish')('never deletes a lone universal variable', () => { - const clear = clearEnvCommand('ORCA_PI_PREFILL', 'posix') - const probe = `set -Ux ORCA_PI_PREFILL persisted; ${clear}; set -q ORCA_PI_PREFILL; and echo "RESULT=$ORCA_PI_PREFILL"; or echo RESULT=DESTROYED; set -Ue ORCA_PI_PREFILL` - expect(runInShell(shell, probe)).toContain('RESULT=persisted') - }) - - // Erase the injected global so the user’s shadowed universal reappears. - it.runIf(shell.name === 'fish')('reveals a shadowed universal instead of deleting it', () => { - const clear = clearEnvCommand('ORCA_PI_PREFILL', 'posix') - const probe = `set -Ux ORCA_PI_PREFILL mine; set -gx ORCA_PI_PREFILL injected; ${clear}; echo "RESULT=$ORCA_PI_PREFILL"; set -Ue ORCA_PI_PREFILL` - expect(runInShell(shell, probe)).toContain('RESULT=mine') - }) - }) - } -) diff --git a/src/shared/source-control/listing/source-control-discard-all-sequence.test.ts b/src/shared/source-control/listing/source-control-discard-all-sequence.test.ts deleted file mode 100644 index 9bb529a47c4..00000000000 --- a/src/shared/source-control/listing/source-control-discard-all-sequence.test.ts +++ /dev/null @@ -1,233 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import { - getDiscardAllPaths, - getStageAllPaths, - getUnstageAllPaths, - isStageableStatusEntry, - runDiscardAllForArea -} from './source-control-discard-all-sequence' -import type { GitStatusEntry } from '../../git/status/git-status-types' - -function entry(partial: Partial & { path: string }): GitStatusEntry { - return { - status: 'modified', - area: 'unstaged', - ...partial - } -} - -describe('getDiscardAllPaths', () => { - it('skips non-recursing present submodules and children but keeps restorable ones', () => { - const submodule = { commitChanged: false, trackedChanges: true, untrackedChanges: false } - const entries: GitStatusEntry[] = [ - entry({ path: 'dirty-sub', submodule }), - entry({ path: 'dirty-sub/file.ts', submoduleRoot: 'dirty-sub' }), - entry({ path: 'deleted-sub', status: 'deleted', submodule }), - entry({ path: 'recursing-sub', submodule: { ...submodule, restoreRecurses: true } }), - entry({ path: 'parent.ts' }) - ] - expect(getDiscardAllPaths(entries, 'unstaged')).toEqual([ - 'deleted-sub', - 'recursing-sub', - 'parent.ts' - ]) - }) - - it('skips entries with an unresolved conflict', () => { - const entries: GitStatusEntry[] = [ - entry({ path: 'clean.ts', area: 'unstaged' }), - entry({ - path: 'conflict.ts', - area: 'unstaged', - conflictKind: 'both_modified', - conflictStatus: 'unresolved' - }) - ] - // Restoring unresolved conflicts silently clears the u record before review, matching the per-row discard guard. - expect(getDiscardAllPaths(entries, 'unstaged')).toEqual(['clean.ts']) - }) - - it('skips entries resolved locally but not yet re-staged', () => { - const entries: GitStatusEntry[] = [ - entry({ path: 'clean.ts', area: 'unstaged' }), - entry({ - path: 'resolved.ts', - area: 'unstaged', - conflictKind: 'both_modified', - conflictStatus: 'resolved_locally' - }) - ] - // Bulk discard must preserve local resolutions or users would have to resolve them again. - expect(getDiscardAllPaths(entries, 'unstaged')).toEqual(['clean.ts']) - }) -}) - -describe('getStageAllPaths', () => { - it('skips entries with an unresolved conflict', () => { - const entries: GitStatusEntry[] = [ - entry({ path: 'clean.ts', area: 'unstaged' }), - entry({ - path: 'conflict.ts', - area: 'unstaged', - conflictKind: 'both_modified', - conflictStatus: 'unresolved' - }) - ] - // git add silently clears unresolved u records before review, matching the per-row Stage guard. - expect(getStageAllPaths(entries, 'unstaged')).toEqual(['clean.ts']) - }) - - it('includes entries that are resolved locally', () => { - const entries: GitStatusEntry[] = [ - entry({ path: 'clean.ts', area: 'unstaged' }), - entry({ - path: 'resolved.ts', - area: 'unstaged', - conflictKind: 'both_modified', - conflictStatus: 'resolved_locally' - }) - ] - // Staging a local resolution finishes the normal conflict workflow and must remain available. - expect(getStageAllPaths(entries, 'unstaged')).toEqual(['clean.ts', 'resolved.ts']) - }) - - it('skips submodule rows that only contain nested worktree dirtiness', () => { - const entries: GitStatusEntry[] = [ - entry({ - path: 'nested-repo', - area: 'unstaged', - submodule: { commitChanged: false, trackedChanges: false, untrackedChanges: true } - }), - entry({ - path: 'changed-gitlink', - area: 'unstaged', - submodule: { commitChanged: true, trackedChanges: false, untrackedChanges: true } - }) - ] - expect(getStageAllPaths(entries, 'unstaged')).toEqual(['changed-gitlink']) - }) -}) - -describe('status entry stageability', () => { - it('marks lazily-expanded submodule-internal entries as not stageable', () => { - const innerEntry = entry({ - path: 'flutter_mine/lib/main.dart', - area: 'unstaged', - submoduleRoot: 'flutter_mine' - }) - - // Parent-worktree git add cannot stage inner submodule changes. - expect(isStageableStatusEntry(innerEntry)).toBe(false) - expect(getStageAllPaths([innerEntry], 'unstaged')).toEqual([]) - }) -}) - -describe('getUnstageAllPaths', () => { - it('includes staged conflict rows', () => { - const entries: GitStatusEntry[] = [ - entry({ path: 'clean.ts', area: 'staged' }), - entry({ - path: 'conflict.ts', - area: 'staged', - conflictKind: 'both_modified', - conflictStatus: 'unresolved' - }), - entry({ - path: 'resolved.ts', - area: 'staged', - conflictKind: 'both_modified', - conflictStatus: 'resolved_locally' - }) - ] - // Unstaging conflicts safely mirrors the per-row action; no conflict filtering is needed. - expect(getUnstageAllPaths(entries)).toEqual(['clean.ts', 'conflict.ts', 'resolved.ts']) - }) -}) - -describe('runDiscardAllForArea', () => { - function makeDeps( - overrides: { - bulkUnstageError?: unknown - discardManyError?: unknown - discardOneError?: (path: string) => unknown - } = {} - ) { - const bulkUnstageCalls: string[][] = [] - const discardManyCalls: string[][] = [] - const discardOneCalls: string[] = [] - const errors: unknown[] = [] - - const bulkUnstage = vi.fn(async (paths: string[]) => { - bulkUnstageCalls.push([...paths]) - if (overrides.bulkUnstageError !== undefined) { - throw overrides.bulkUnstageError - } - }) - const discardMany = vi.fn(async (paths: string[]) => { - discardManyCalls.push([...paths]) - if (overrides.discardManyError !== undefined) { - throw overrides.discardManyError - } - }) - const discardOne = vi.fn(async (path: string) => { - discardOneCalls.push(path) - if (overrides.discardOneError) { - const err = overrides.discardOneError(path) - if (err !== undefined) { - throw err - } - } - }) - const onError = vi.fn((error: unknown) => { - errors.push(error) - }) - - return { - deps: { bulkUnstage, discardOne, onError }, - depsWithBulkDiscard: { bulkUnstage, discardMany, discardOne, onError }, - bulkUnstageCalls, - discardManyCalls, - discardOneCalls, - errors, - bulkUnstage, - discardMany, - discardOne, - onError - } - } - - it('falls back to per-file discard when bulk discard rejects', async () => { - const ctx = makeDeps({ discardManyError: new Error('unknown method') }) - const result = await runDiscardAllForArea('unstaged', ['a.ts', 'b.ts'], ctx.depsWithBulkDiscard) - expect(result).toEqual({ discarded: ['a.ts', 'b.ts'], failed: [], aborted: false }) - expect(ctx.discardManyCalls).toEqual([['a.ts', 'b.ts']]) - expect(ctx.discardOneCalls).toEqual(['a.ts', 'b.ts']) - expect(ctx.onError).not.toHaveBeenCalled() - }) - - it('aborts and skips the discard loop if bulk-unstage rejects', async () => { - const error = new Error('index locked') - const ctx = makeDeps({ bulkUnstageError: error }) - const result = await runDiscardAllForArea('staged', ['a.ts', 'b.ts'], ctx.deps) - expect(result).toEqual({ discarded: [], failed: [], aborted: true }) - // Abort after failed unstage; restoring only the worktree would leave a mismatched staged delta. - expect(ctx.discardOne).not.toHaveBeenCalled() - expect(ctx.errors).toEqual([error]) - }) - - it('continues past a per-file discard failure and records it in `failed`', async () => { - const error = new Error('EPERM') - const ctx = makeDeps({ - discardOneError: (path) => (path === 'b.ts' ? error : undefined) - }) - const result = await runDiscardAllForArea('unstaged', ['a.ts', 'b.ts', 'c.ts'], ctx.deps) - expect(result).toEqual({ - discarded: ['a.ts', 'c.ts'], - failed: ['b.ts'], - aborted: false - }) - expect(ctx.discardOneCalls).toEqual(['a.ts', 'b.ts', 'c.ts']) - // Reserve aborted for failed bulk unstage so callers can distinguish no work from partial success. - expect(ctx.errors).toEqual([error]) - }) -}) diff --git a/src/shared/speech/dictation/dictation-term-spelling.test.ts b/src/shared/speech/dictation/dictation-term-spelling.test.ts deleted file mode 100644 index 181ad84a45f..00000000000 --- a/src/shared/speech/dictation/dictation-term-spelling.test.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { createDictationDictionary } from './dictation-term-spelling' - -const spell = (terms: Parameters[0], text: string): string => - createDictationDictionary(terms)!(text) - -describe('createDictationDictionary', () => { - // Parakeet v3's real output for the dev bench's code-term clips. - it('joins the words a model splits a code term into back into the term', () => { - const terms = [ - { term: 'useAudioCapture' }, - { term: 'usePcmWorklet' }, - { term: 'stt-worker.ts' }, - { term: 'numThreads' }, - { term: 'useMemo' }, - { term: 'onChange' } - ] - expect( - spell(terms, 'Rename use audio capture to use PCM worklet in the dictation controller.') - ).toBe('Rename useAudioCapture to usePcmWorklet in the dictation controller.') - expect(spell(terms, 'Open stt worker TS and set num threads to 4.')).toBe( - 'Open stt-worker.ts and set numThreads to 4.' - ) - expect(spell(terms, 'Wrap it in use memo and pass the on-change call back.')).toBe( - 'Wrap it in useMemo and pass the onChange call back.' - ) - }) - - // Parakeet v3 and Whisper large-v3 turbo's real output for `say` clips of the terms. - it('spells a misheard word as the term when it sounds the same and is spelled close', async () => { - const clean = createDictationDictionary([ - { term: 'Supabase' }, - { term: 'Vercel' }, - { term: 'oxlint' }, - { term: 'Silero' } - ])! - await expect - .poll(() => clean('We moved the auth tables from Superbase to Postgres last week.'), { - timeout: 5000 - }) - .toBe('We moved the auth tables from Supabase to Postgres last week.') - expect(clean('Deploy the preview to Versal before the review.')).toBe( - 'Deploy the preview to Vercel before the review.' - ) - expect(clean('Run auxlint on the changed files before you push.')).toBe( - 'Run oxlint on the changed files before you push.' - ) - expect(clean('Parakeet and Celero both run inside the speech child.')).toBe( - 'Parakeet and Silero both run inside the speech child.' - ) - expect(clean("It doesn't work on Versal.")).toBe("It doesn't work on Vercel.") - }) - - it('leaves ordinary words, names, runs of words and other languages alone', async () => { - const clean = createDictationDictionary([ - { term: 'Bazel' }, - { term: 'Jupyter' }, - { term: 'Istio' }, - { term: 'Saleor' }, - { term: 'Vercel' } - ])! - await expect - .poll(() => clean('Deploy the preview to Versal before the review.'), { timeout: 5000 }) - .toBe('Deploy the preview to Vercel before the review.') - for (const text of [ - 'The vessel reached the harbor just after noon.', - 'The phone has a thin bezel.', - 'The planet Jupiter is bright tonight.', - 'It is too late to call him now.', - 'The ship was a very fast sailer.', - 'Despliega la vista previa en Versal antes de la revisión.' - ]) { - expect(clean(text)).toBe(text) - } - // A bilingual model's Chinese sentence is not English, even though English is one of its languages. - const bilingual = createDictationDictionary([{ term: 'Vercel' }], ['zh', 'en'])! - expect(bilingual('请在 Versal 上部署预览。')).toBe('请在 Versal 上部署预览。') - expect(bilingual('Deploy the preview to Versal before the review.')).toBe( - 'Deploy the preview to Vercel before the review.' - ) - }) -}) diff --git a/src/shared/workspace-attachments/workspace-review-checks.test.ts b/src/shared/workspace-attachments/workspace-review-checks.test.ts deleted file mode 100644 index dc2e0f4877f..00000000000 --- a/src/shared/workspace-attachments/workspace-review-checks.test.ts +++ /dev/null @@ -1,124 +0,0 @@ -import { describe, expect, it } from 'vitest' -import type { WorkspaceAttachment } from '../worktree/types' -import { getWorkspaceAttachmentKey } from './workspace-attachment-normalization' -import { - summarizeWorkspaceReviewChecks, - type WorkspaceReviewCheckDetails -} from './workspace-review-checks' - -function attachment(number: number, provider: 'github' | 'gitlab' = 'github'): WorkspaceAttachment { - return { - provider, - type: provider === 'gitlab' ? 'mr' : 'pr', - number, - url: - provider === 'github' - ? `https://github.com/acme/orca/pull/${number}` - : `https://gitlab.com/acme/orca/-/merge_requests/${number}` - } -} -function details( - item: WorkspaceAttachment, - status: 'success' | 'failure' | 'pending' | 'neutral', - stale = false -): WorkspaceReviewCheckDetails { - return { stale, review: { provider: item.provider, number: item.number, url: item.url, status } } -} -function map( - entries: [WorkspaceAttachment, WorkspaceReviewCheckDetails][] -): Record { - return Object.fromEntries( - entries.map(([item, detail]) => [getWorkspaceAttachmentKey(item), detail]) - ) -} - -describe('all workspace review checks', () => { - it('retains matched lifecycle and staleness without check results and rejects foreign details', () => { - const item = attachment(1) - const retained = { - stale: true, - review: { provider: 'github', number: 1, url: item.url, state: 'merged' } - } as const - expect(summarizeWorkspaceReviewChecks([item], map([[item, retained]]))).toMatchObject({ - reviewState: 'merged', - stale: 1, - state: 'unknown', - unknown: 1 - }) - const foreign = { - ...retained, - review: { ...retained.review, url: 'https://github.com/other/project/pull/1' } - } - expect(summarizeWorkspaceReviewChecks([item], map([[item, foreign]]))).toMatchObject({ - reviewState: undefined, - stale: 0, - state: 'unknown' - }) - }) - - it('aggregates every review rather than a selected compatibility slot', () => { - const first = attachment(1) - const second = attachment(2) - expect( - summarizeWorkspaceReviewChecks( - [first, second], - map([ - [first, details(first, 'success')], - [second, details(second, 'failure')] - ]) - ) - ).toMatchObject({ state: 'failure', total: 2, known: 2, passed: 1, failed: 1 }) - }) - it('keeps all unknown or partially known collections from looking green', () => { - const first = attachment(1) - const second = attachment(2) - expect(summarizeWorkspaceReviewChecks([first, second], {})).toMatchObject({ - state: 'unknown', - unknown: 2 - }) - expect( - summarizeWorkspaceReviewChecks([first, second], map([[first, details(first, 'success')]])) - ).toMatchObject({ state: 'unknown', known: 1, unknown: 1 }) - }) - it('never certifies stale success and conservatively retains stale failure', () => { - const item = attachment(1) - expect( - summarizeWorkspaceReviewChecks([item], map([[item, details(item, 'success', true)]])) - ).toMatchObject({ state: 'unknown', stale: 1 }) - expect( - summarizeWorkspaceReviewChecks([item], map([[item, details(item, 'failure', true)]])) - ).toMatchObject({ state: 'failure', stale: 1 }) - }) - it('isolates equal numbers by provider and repository scope', () => { - const github = attachment(1) - const gitlab = attachment(1, 'gitlab') - const foreign = { ...github, url: 'https://github.com/other/project/pull/1' } - expect( - summarizeWorkspaceReviewChecks( - [github, gitlab], - map([ - [github, details(gitlab, 'success')], - [gitlab, details(github, 'failure')] - ]) - ) - ).toMatchObject({ state: 'unknown', unknown: 2, failed: 0 }) - expect( - summarizeWorkspaceReviewChecks([github], map([[github, details(foreign, 'success')]])) - ).toMatchObject({ state: 'unknown', unknown: 1 }) - }) - it('ignores tasks and deduplicates review metadata without filtering lifecycle states', () => { - const first = attachment(1) - const second = attachment(2) - const task: WorkspaceAttachment = { provider: 'github', type: 'issue', number: 3 } - expect( - summarizeWorkspaceReviewChecks( - [first, first, second, task], - map([ - [first, details(first, 'failure')], - [second, details(second, 'success')] - ]) - ) - ).toMatchObject({ total: 2, failed: 1, state: 'failure' }) - expect(summarizeWorkspaceReviewChecks([task], {})).toMatchObject({ state: 'none', total: 0 }) - }) -})